viernes, 11 de febrero de 2022

Macros útiles:

 

Insertar Filas entre filas:

Sub InsertarFilas()

    

    Do While Not IsEmpty(ActiveCell)

        ActiveCell.EntireRow.Insert

        ActiveCell.Offset(2, 0).Select

    Loop

    

End Sub

jueves, 4 de julio de 2019

dbSistemas



--Tabla categoría
create table categoria (
idcategoria integer primary key identity,
nombre varchar(50) not null unique,
descripcion varchar(255) null,
estado bit default(1) 
);

go

--Tabla artículo
create table articulo (
idarticulo integer primary key identity,
idcategoria integer not null,
codigo varchar(50) null,
nombre varchar(100) not null unique,
precio_venta decimal(11,2) not null,
stock integer not null,
descripcion varchar(255) null,
imagen varchar(20) null,
estado bit default(1),
FOREIGN KEY (idcategoria) REFERENCES categoria(idcategoria)
);

go

--Tabla Persona
create table persona(
idpersona integer primary key identity,
tipo_persona varchar(20) not null,
nombre varchar(100) not null,
tipo_documento varchar(20) null,
num_documento varchar(20) null,
direccion varchar(70) null,
telefono varchar(20) null,
email varchar(50) null
);
go

--Tabla rol
create table rol(
idrol integer primary key identity,
nombre varchar(30) not null,
descripcion varchar(255) null,
estado bit default(1)
);
go

--Tabla uduario
create table usuario(
idusuario integer primary key identity,
idrol integer not null,
nombre varchar(100) not null,
tipo_documento varchar(20) null,
num_documento varchar (20) null,
direccion varchar(70) null,
telefono varchar(20) null,
email varchar(50) not null,
clave varbinary(MAX) not null,
estado bit default(1),
FOREIGN KEY (idrol) REFERENCES rol (idrol)
);
go

--Tabla ingreso
create table ingreso(
idingreso integer primary key identity,
idproveedor integer not null,
idusuario integer not null,
tipo_comprobante varchar(20) null,
serie_comprobante varchar(7) null,
num_comprobante varchar(10) null,
fecha datetime not null,
impuesto decimal (4,2) not null,
total decimal (11,2) not null,
estado varchar(20) not null,
FOREIGN KEY (idproveedor) REFERENCES persona (idpersona),
FOREIGN KEY (idusuario) REFERENCES usuario (idusuario)
);
go


--Tabla detalle_ingreso
create table detalle_ingreso (
iddetalle_ingreso integer primary key identity,
idingreso integer not null,
idarticulo integer not null,
cantidad integer not null,
precio decimal(11,2) not null,
FOREIGN KEY (idingreso) REFERENCES ingreso (idingreso) ON DELETE CASCADE,
FOREIGN KEY (idarticulo) REFERENCES articulo (idarticulo)
);
go

--Tabla venta
create table venta(
idventa integer primary key identity,
idcliente integer not null,
idusuario integer not null,
tipo_comprobante varchar (20) not null,
serie_comprobante varchar(7) null,
num_comprobante varchar (10) not null,
fecha datetime not null,
impuesto decimal (4,2) not null,
total decimal (11,2) not null,
estado varchar (20) not null,
FOREIGN KEY (idcliente) REFERENCES persona (idpersona),
FOREIGN KEY (idusuario) REFERENCES usuario (idusuario)
);
go


--Tabla detalle_venta
create table detalle_venta (
iddetalle_venta integer primary key identity,
idventa integer not null,
idarticulo integer not null,
cantidad integer not null,
precio decimal(11,2) not null,
descuento decimal(11,2) not null,
FOREIGN KEY (idventa) REFERENCES venta (idventa) ON DELETE CASCADE,
FOREIGN KEY (idarticulo) REFERENCES articulo (idarticulo)
);

lunes, 17 de diciembre de 2018

Copiar TODO


Con el permiso del autor del código, mi estimado amigo John quien me autorizó pegar su código en este blog, pues les comparto estas líneas.

Copiarlo en un archivo .txt y cuardarlo como un .bat

Saludos.


@echo off
cls
set rutaOrigen1=
set rutaDestino1=
set rutaOrigen2=
set rutaDestino2=
set rutaOrigen3=
set rutaDestino3=
set rutaOrigen4=
set rutaDestino4=
set rutaOrigen5=
set rutaDestino5=

echo ---*** Bienvenido a CopiaTodo ***---
echo CREADO POR: John Christian Junior Montalvo Samame
echo INSTRUCCIONES:
echo -Para una buena copia debe ejecutar este archivo como ADMINISTRADOR.
echo -No es necesario llenar todos los que se pide ya que cualquier campo
echo  que no se rellene, no se ejecutara el copiado.
echo -las rutas de destino que no se encuentren se crearan.
echo -ingrese correctamente con lo solicitado.
echo.
echo.
set /p rutaOrigen1= Ingrese la ruta de origen1:
set /p rutaDestino1= Ingrese la ruta de destino1:
echo.
echo.
set /p rutaOrigen2= Ingrese la ruta de origen2 (*Opcional):
set /p rutaDestino2= Ingrese la ruta de destino2 (*Opcional):
echo.
echo.
set /p rutaOrigen3= Ingrese la ruta de origen3 (*Opcional):
set /p rutaDestino3= Ingrese la ruta de destino3 (*Opcional):
echo.
echo.
set /p rutaOrigen4= Ingrese la ruta de origen4 (*Opcional):
set /p rutaDestino4= Ingrese la ruta de destino4 (*Opcional):
echo.
echo.
set /p rutaOrigen5= Ingrese la ruta de origen5  (*Opcional):
set /p rutaDestino5= Ingrese la ruta de destino5  (*Opcional):

if DEFINED rutaOrigen1 (
if DEFINED rutaDestino1 (
if NOT EXIST "%rutaDestino1%" Md "%rutaDestino1%" && echo se creo la carpeta : "%rutaDestino1%" , Listo
robocopy "%rutaOrigen1%" "%rutaDestino1%" /w:0 /r:0 /s && echo Copiado Completo, Listo
attrib "%rutaDestino1%/*.*" /s /d -s -h -r && echo Archivo ocultos visibles, Listo
) else (
echo no se ha definido la RUTA DESTINO 1
)
) else (
echo no se ha definido la RUTA ORIGEN 1
)
if DEFINED rutaOrigen2 (
if DEFINED rutaDestino2 (
if NOT EXIST "%rutaDestino2%" Md "%rutaDestino2%" && echo se creo la carpeta : "%rutaDestino2%" , Listo
robocopy "%rutaOrigen2%" "%rutaDestino2%" /w:0 /r:0 /s && echo Copiado Completo, Listo
attrib "%rutaDestino2%/*.*" /s /d -s -h -r && echo Archivo ocultos visibles, Listo
) else (
echo no se ha definido la RUTA DESTINO 2
)
) else (
echo no se ha definido la RUTA ORIGEN 2
)
if DEFINED rutaOrigen3 (
if DEFINED rutaDestino3 (
if NOT EXIST "%rutaDestino3%" Md "%rutaDestino3%" && echo se creo la carpeta : "%rutaDestino3%" , Listo
robocopy "%rutaOrigen3%" "%rutaDestino3%" /w:0 /r:0 /s && echo Copiado Completo, Listo
attrib "%rutaDestino3%/*.*" /s /d -s -h -r && echo Archivo ocultos visibles, Listo
) else (
echo no se ha definido la RUTA DESTINO 3
)
) else (
echo no se ha definido la RUTA ORIGEN 3
)
if DEFINED rutaOrigen4 (
if DEFINED rutaDestino4 (
if NOT EXIST "%rutaDestino4%" Md "%rutaDestino4%" && echo se creo la carpeta : "%rutaDestino4%" , Listo
robocopy "%rutaOrigen4%" "%rutaDestino4%" /w:0 /r:0 /s && echo Copiado Completo, Listo
attrib "%rutaDestino4%/*.*" /s /d -s -h -r && echo Archivo ocultos visibles, Listo
) else (
echo no se ha definido la RUTA DESTINO 4
)
) else (
echo no se ha definido la RUTA ORIGEN 4
)
if DEFINED rutaOrigen5 (
if DEFINED rutaDestino5 (
if NOT EXIST "%rutaDestino5%" Md "%rutaDestino5%" && echo se creo la carpeta : "%rutaDestino5%" , Listo
robocopy "%rutaOrigen5%" "%rutaDestino5%" /w:0 /r:0 /s && echo Copiado Completo, Listo
attrib "%rutaDestino5%/*.*" /s /d -s -h -r && echo Archivo ocultos visibles, Listo
) else (
echo no se ha definido la RUTA DESTINO 5
)
) else (
echo no se ha definido la RUTA ORIGEN 5
)
echo Presione una tecla para salir
pause>nul

jueves, 15 de noviembre de 2018

Rutas EA, Centros Emp.

128.1.2.0/24     192.168.19.1
192.168.13.0/24 ""

martes, 30 de octubre de 2018

USB Para restaurar PCs del Centro de Informática y Sistemas CIS


Configuración Autoexec:

:RED
@echo off
prompt $p$g
REM \net\netbind.com
MOUSE.COM
cd \ghost
echo Loading...
GHOST.EXE
goto end


:LAB43
REM gdisk 1 /hide /p:5
Ghost.exe -clone,mode=pload,src=2.4:\BOOT.GHO:1,dst=2:1 -ia -span -sure -auto
Ghost.exe -clone,mode=pload,src=2.4:\win.GHO:1,dst=2:2 -span -sure -auto -rb
goto end



:DOS


:END




Configuración CONFIG.SYS

[menu]
menuitem=LAB43, Restaurar Boot y Win10 en Lab41, 42, 43, 44 y 45.
menuitem=DOS, Iniciar solamente DOS.

menudefault=LAB43,30
menucolor=7,1


[LAB43]
DEVICE=himem.sys


[RED]
DEVICE=\net\protman.dos /I:\net
DEVICE=\net\dis_pkt.dos
rem DEVICE=\net\El90x.dos
DEVICE=\net\e1000.dos
DEVICE=himem.sys

[DOS]
DEVICE=himem.sys

martes, 12 de junio de 2018