public Boolean Guardar() { Boolean Resultado = false; String Sentencia = @"INSERT INTO usuarios(usuario,clave,rol,idempleados) VALUES('" + this.usuario + "','" + this.clave + "','" + this.idrol + "','" + this.idempleado + "'); "; Console.WriteLine(Sentencia); try { DataManager.CLS.OperacionBD Operacion = new DataManager.CLS.OperacionBD(); if (Operacion.Insertar(Sentencia) > 0) { Resultado = true; } else { Resultado = false; } } catch { Resultado = false; } return(Resultado); }
public Boolean Editar() { Boolean Resultado = false; String Sentencia = @"UPDATE Empleados SET Nombres = '" + this._Nombres + "', Apellidos = '" + this._Apellidos + "', FechaNacimiento = '" + this._FechaNacimiento + "', Sexo = '" + this._Sexo + "', Telefono = '" + this._Telefono + "', DUI = '" + this._DUI + "', NIT = '" + this._NIT + "', Titulo = '" + this._Titulo + "' WHERE IDEmpleado = '" + this._IDEmpleado + "';"; try { DataManager.CLS.OperacionBD Operacion = new DataManager.CLS.OperacionBD(); if (Operacion.Actualizar(Sentencia) > 0) { Resultado = true; } else { Resultado = false; } } catch { Resultado = false; } return(Resultado); }
public Boolean Guardar() { Boolean Resultado = false; String Sentencia = @"INSERT INTO Empleados(Nombres, Apellidos, FechaNacimiento, Sexo, Telefono, DUI, NIT, Titulo)" + @" VALUES('" + this.Nombres + "', '" + this._Apellidos + "', '" + this._FechaNacimiento + "', '" + this._Sexo + "', '" + this._Telefono + "', '" + this._DUI + "', '" + this._NIT + "', '" + this._Titulo + "');"; try { DataManager.CLS.OperacionBD Operacion = new DataManager.CLS.OperacionBD(); if (Operacion.Insertar(Sentencia) > 0) { Resultado = true; } else { Resultado = false; } } catch { Resultado = false; } return(Resultado); }
public static DataTable REPORTE_CANCELACIONES(int pIdcontrato) { DataTable Resultados = new DataTable(); DataManager.CLS.OperacionBD Consultor = new DataManager.CLS.OperacionBD(); String Consulta = @"SELECT b.idcontratos, c.idclientes as ID, concat(c.nombres,' ',c.apellidos) Cliente, e.idTipoDeContrato, e.nombre as TipoContrato, d.idservicios, d.nombre as Servicio, b.fecha, b.extendido, b.Precio FROM contratos b, clientes c, servicios d, tipodecontrato e WHERE c.idclientes=b.contratista AND b.idservicios=d.idservicios AND b.tipoDeContrato=e.idTipoDeContrato AND b.idcontratos='" + pIdcontrato + @"' ;"; try { Resultados = Consultor.Consultar(Consulta); } catch { Resultados = new DataTable(); } return(Resultados); }
public Boolean Editar() { Boolean Resultado = false; String Sentencia = @"UPDATE usuarios SET usuario='" + this.usuario + "',clave='" + this.clave + "', rol='" + this.idrol + "', idempleados= " + this.idempleado + " " + "WHERE idusuarios = " + this._idusuario + ";"; Console.WriteLine(Sentencia); try { DataManager.CLS.OperacionBD Operacion = new DataManager.CLS.OperacionBD(); if (Operacion.Actualizar(Sentencia) > 0) { Resultado = true; } else { Resultado = false; } } catch { Resultado = false; } return(Resultado); }
public Boolean Editar() { Boolean Resultado = false; String Sentencia = @"UPDATE Usuarios SET Usuario = '" + this._Usuario + "', IDRol = '" + this._IDRol + "'," + @"Clave = SHA1(MD5('" + this._Clave + "')) , IDEmpleado = '" + this._IDEmpleado + "';"; try { DataManager.CLS.OperacionBD Operacion = new DataManager.CLS.OperacionBD(); if (Operacion.Actualizar(Sentencia) > 0) { Resultado = true; } else { Resultado = false; } } catch { Resultado = false; } return(Resultado); }
public static DataTable INICIAR_SESION(String pUsuario, String pClave)//PARAMETRIZAR p { DataTable Resultados = new DataTable(); DataManager.CLS.OperacionBD Consultor = new DataManager.CLS.OperacionBD(); String Consulta = @"SELECT a.IDUsuario, a.Usuario, a.IDEmpleado, a.IDRol, CONCAT(b.Nombres, ' ',b.Apellidos) Empleado, c.Rol FROM usuarios a, empleados b, roles c WHERE a.Usuario = '" + pUsuario + @"' AND a.Clave=SHA1(MD5('" + pClave + @"')) AND a.IDEmpleado = b.IDEmpleado AND a.IDRol = c.IDRol;" ; try { Resultados = Consultor.Consultar(Consulta); } catch { Resultados = new DataTable(); } return(Resultados); }
public Boolean Guardar() { Boolean Resultado = false; String Sentencia = @"INSERT INTO Usuarios(Usuario, IDRol, Clave, IDEmpleado)" + @"VALUES('" + this._Usuario + "', '" + this._IDRol + "', SHA1(MD5('" + this._Clave + "')), '" + this._IDEmpleado + "');"; try { DataManager.CLS.OperacionBD Operacion = new DataManager.CLS.OperacionBD(); if (Operacion.Insertar(Sentencia) > 0) { Resultado = true; } else { Resultado = false; } } catch { Resultado = false; } return(Resultado); }
/* * public int idcontratos { get => _idcontratos; set => _idcontratos = value; } * public int idTipoDeContrato { get => _idTipoDeContrato; set => _idTipoDeContrato = value; } * public int idServicio{ get => _idServicio; set => _idServicio = value; } * public string extendido{ get => _extendido; set => _extendido = value; } * public string Estado{ get => _Estado; set => _Estado = value; } * public string FormaDePago{ get => _FormaDePago; set => _FormaDePago = value; } * public string observaciones{ get => _observaciones; set => _observaciones = value; } * public DateTime Fecha{ get => _Fecha; set => _Fecha = value; } * public int idvendedor{ get => _idvendedor; set => _idvendedor = value; } * public int idcliente { get => _contratista; set => _contratista = value; } * public string estado{ get => _estado; set => _estado = value; } * public float saldo{ get => _saldo; set => _saldo = value; } * public int beneficiario1{ get => _beneficiario1; set => _beneficiario1 = value; } * public int beneficiario2{ get => _beneficiario2; set => _beneficiario2 = value; } */ public Boolean Guardar() { Boolean Resultado = false; String Sentencia = @"INSERT INTO contratos (extendido,tipoDeContrato,idservicios,formaspago,fecha,vendedor,contratista,Estado,monto,Beneficiario1,Beneficiario2,observaciones) VALUES ('" + this.Extendido + "'," + this.IdTipoDeContrato + "," + this.IdServicio + ", '" + this.FormaDePago + "', '" + this.Fecha.ToString("yyyy/MM/dd") + "'," + this.Idvendedor + "," + this.Contratista + ",'" + this.Estado + "'," + this.Saldo + "," + this.Beneficiario1 + "," + this.Beneficiario2 + ", '" + this.Observaciones + "'); "; Console.WriteLine(Sentencia); try { DataManager.CLS.OperacionBD Operacion = new DataManager.CLS.OperacionBD(); if (Operacion.Insertar(Sentencia) > 0) { Resultado = true; } else { Resultado = false; } } catch { Resultado = false; } return(Resultado); }
public static DataTable REPORTE_CLIENTE_PAGO(Int32 pDia) { DataTable Resultados = new DataTable(); DataManager.CLS.OperacionBD Consultor = new DataManager.CLS.OperacionBD(); String Consulta = @"SELECT c.idclientes as ID, b.Idcontratos as Contrato, concat(c.nombres,' ',c.apellidos) Cliente, c.direccion, c.telefono, c.dui FROM contratos b, clientes c WHERE c.idclientes=b.contratista AND day(b.fecha)='" + pDia + @"' ;"; try { Resultados = Consultor.Consultar(Consulta); } catch { Resultados = new DataTable(); } return(Resultados); }
public Boolean Guardar() { Boolean Resultado = false; int ultimoIngreso = CacheManager.CLS.SucursalCache.Ultima_Ingreso() + 1; String Sentencia = @"INSERT INTO empleados(nombres,apellidos,fechanacimiento,telefono,direccion,DUI,idsucursales,fechacontratacion,puesto) VALUES(' " + this._Nombre + " ',' " + this._Apellido + " ',' " + this.dt.ToString("yyyy/MM/dd") + " ',' " + this._telefono + " ',' " + this._direccion + " ',' " + this._DUI + " ', " + this._sucursal + " ,' " + this.fechaContratacion.ToString("yyyy/MM/dd") + " ', " + this.puesto + " );"; Console.Write(Sentencia); try { DataManager.CLS.OperacionBD Operacion = new DataManager.CLS.OperacionBD(); if (Operacion.Insertar(Sentencia) > 0) { Resultado = true; } else { Resultado = false; } } catch { Resultado = false; } return(Resultado); }
public Boolean Guardar() { Boolean Resultado = false; int ultimoIngreso = CacheManager.CLS.SucursalCache.Ultima_Ingreso() + 1; String Sentencia = @"INSERT INTO puestos(nombre,descripcion) VALUES(' " + this._Nombre + " ',' " + this._Descripcion + "');"; Console.Write(Sentencia); try { DataManager.CLS.OperacionBD Operacion = new DataManager.CLS.OperacionBD(); if (Operacion.Insertar(Sentencia) > 0) { Resultado = true; } else { Resultado = false; } } catch (Exception e) { Console.WriteLine(e.Message); Resultado = false; } return(Resultado); }
public static int Ultima_Ingreso() { int id = -1; DataTable Resultados = new DataTable(); DataManager.CLS.OperacionBD Consultor = new DataManager.CLS.OperacionBD(); String Consulta = @"select idsucursales from sucursales order by idsucursales desc limit 1;"; try { Resultados = Consultor.Consultar(Consulta); } catch { Resultados = new DataTable(); } if (Resultados.Rows.Count == 1)//validar que solo venga una fila { id = (int)Convert.ToInt64(Resultados.Rows[0]["idsucursales"]); } return(id); }
public Boolean Editar() { Boolean Resultado = false; String Sentencia = @"UPDATE difuntos SET nombre=' " + this.Nombres + " ' , apellidos=' " + this.Apellidos + " ' , Direcciondetoma=' " + this.DireccionDeToma + " ' , Direcciondeentrega='" + this.DireccionDeEntrega + "' , CausadeMuerte='" + this.CausaMuerte + "' , FechadeMuerte='" + this.FechanMuerte.ToString("yyyy/MM/dd") + "' , FechadeNacimiento='" + this.Fechanacimiento.ToString("yyyy/MM/dd") + "',contrato=" + this.Idcontrato + " WHERE iddifuntos = " + this.Iddifunto + ";"; Console.WriteLine(Sentencia); try { DataManager.CLS.OperacionBD Operacion = new DataManager.CLS.OperacionBD(); if (Operacion.Actualizar(Sentencia) > 0) { Resultado = true; } else { Resultado = false; } } catch { Resultado = false; } return(Resultado); }
/* * public int iddifunto { get => _iddifunto; set => _iddifunto = value; } * public int idcontrato { get => _idcontrato; set => _idcontrato = value; } * public string nombres { get => _nombres; set => _nombres = value; } * public string apellidos { get => _apellidos; set => _apellidos = value; } * public string direccionDeToma { get => _direccionDeToma; set => _direccionDeToma = value; } * public string direccionDeEntrega { get => _direccionDeEntrega; set => _direccionDeEntrega = value; } * public string CausaMuerte { get => _CausaMuerte; set => _CausaMuerte = value; } * public DateTime fechanacimiento { get => _fechanacimiento; set => _fechanacimiento = value; } * public DateTime fechanMuerte { get => _fechanMuerte; set => _fechanMuerte = value; } */ public Boolean Guardar() { Boolean Resultado = false; String Sentencia = @"INSERT INTO difuntos(nombre,apellidos,Direcciondetoma,Direcciondeentrega,CausadeMuerte,FechadeMuerte,FechadeNacimiento,contrato) VALUES('" + this.Nombres + " ','" + this.Apellidos + "','" + this.DireccionDeToma + "','" + this.DireccionDeEntrega + "','" + this.CausaMuerte + "','" + this.FechanMuerte.ToString("yyyy/MM/dd") + "','" + this.Fechanacimiento.ToString("yyyy/MM/dd") + "'," + this.Idcontrato + "); "; Console.WriteLine(Sentencia); try { DataManager.CLS.OperacionBD Operacion = new DataManager.CLS.OperacionBD(); if (Operacion.Insertar(Sentencia) > 0) { Resultado = true; } else { Resultado = false; } } catch { Resultado = false; } return(Resultado); }
public Boolean Guardar() { Boolean Resultado = false; String Sentencia = @"INSERT INTO clientes(nombres,apellidos,dui,direccion,fechanacimiento,telefono,oficio) VALUES(' " + this._nombres + " ',' " + this._apellidos + " ',' " + this._dui + " ',' " + this._direccion + " ',' " + this._fechanacimiento.ToString("yyyy/MM/dd") + " ',' " + this._telefono + " ',' " + this._oficio + " '); "; Console.WriteLine(Sentencia); try { DataManager.CLS.OperacionBD Operacion = new DataManager.CLS.OperacionBD(); if (Operacion.Insertar(Sentencia) > 0) { Resultado = true; } else { Resultado = false; } } catch { Resultado = false; } return(Resultado); }
public Boolean Editar() { Boolean Resultado = false; String Sentencia = @"UPDATE clientes SET nombres='" + this._nombres + "' , apellidos='" + this._apellidos + "' , dui='" + this._dui + "' , direccion='" + this._direccion + "' , fechanacimiento='" + this._fechanacimiento.ToString("yyyy/MM/dd") + "' , telefono='" + this._telefono + "' , oficio='" + this._oficio + "' " + "WHERE idclientes = " + this._idclientes + ";"; Console.WriteLine(Sentencia); try { DataManager.CLS.OperacionBD Operacion = new DataManager.CLS.OperacionBD(); if (Operacion.Actualizar(Sentencia) > 0) { Resultado = true; } else { Resultado = false; } } catch { Resultado = false; } return(Resultado); }
public Boolean Guardar() { Boolean Resultado = false; String Sentencia = @"INSERT INTO Secciones(Descripcion, Turno, Aula, Cupo, IDGrado) VALUES('" + this._Descripcion + "', '" + this._Turno + "', '" + this._Aula + "', '" + this._Cupo + "', '" + this._IDGrado + "');"; try { DataManager.CLS.OperacionBD Operacion = new DataManager.CLS.OperacionBD(); if (Operacion.Insertar(Sentencia) > 0) { Resultado = true; } else { Resultado = false; } } catch { Resultado = false; } return(Resultado); }
/* * public int IdTipoDeContrato { get => _idTipoDeContrato; set => _idTipoDeContrato = value; } * public float factor { get => _factor; set => _factor = value; } * public string Nombre { get => _nombre; set => _nombre = value; } * public string Descripcion { get => _Descripcion; set => _Descripcion = value; } * public int tratamientos { get => _tratamientos; set => _tratamientos = value; } */ public Boolean Guardar() { Boolean Resultado = false; String Sentencia = @"INSERT INTO tipodecontrato(nombre,Descripcion,factor,tratamiento) VALUES('" + this.Nombre + "','" + this.Descripcion + "', " + this.Factor + "," + this.Tratamientos + " ); "; Console.WriteLine(Sentencia); try { DataManager.CLS.OperacionBD Operacion = new DataManager.CLS.OperacionBD(); if (Operacion.Insertar(Sentencia) > 0) { Resultado = true; } else { Resultado = false; } } catch { Resultado = false; } return(Resultado); }
/* * public int idMovimiento { get => _idMovimiento; set => _idMovimiento = value; } * public int idVendedor { get => _idVendedor; set => _idVendedor = value; } * public int idContrato { get => _idContrato; set => _idContrato = value; } * public String Concepto { get => _Concepto; set => _Concepto = value; } * public float Abono { get => _Abono; set => _Abono = value; } * public DateTime fecha { get => _fecha; set => _fecha = value; } */ public Boolean Guardar() { Boolean Resultado = false; String Sentencia = @"INSERT INTO movimientos (Fecha,idContrato,Concepto,Abono,idEmpleado) VALUES ('" + this.Fecha.ToString("yyyy/MM/dd") + "'," + this.IdContrato + ",'" + this.Concepto + "'," + this.Abono + "," + this.IdVendedor + "); "; Console.WriteLine(Sentencia); try { DataManager.CLS.OperacionBD Operacion = new DataManager.CLS.OperacionBD(); if (Operacion.Insertar(Sentencia) > 0) { Resultado = true; } else { Resultado = false; } } catch { Resultado = false; } return(Resultado); }
public Boolean Editar() { Boolean Resultado = false; String Sentencia = @"UPDATE sucursales SET direccion=' " + this._Direccion + " ' , telefono=' " + this._Telefono + " ' " + "WHERE idsucursales = " + this._idsucursales + ";" + "update sucursales_encargados set idEncargado=" + this._Encargado + " where idSucursal=" + this._idsucursales + ";"; Console.WriteLine(Sentencia); try { DataManager.CLS.OperacionBD Operacion = new DataManager.CLS.OperacionBD(); if (Operacion.Actualizar(Sentencia) > 0) { Resultado = true; } else { Resultado = false; } } catch { Resultado = false; } return(Resultado); }
public Boolean Editar() { Boolean Resultado = false; String Sentencia = @"UPDATE tipodecontrato SET nombre=' " + this.Nombre + " ' , Descripcion=' " + this.Descripcion + " ' " + ",factor=" + this.Factor + "" + "WHERE idTipoDeContrato = " + this.IdTipoDeContrato + ";"; Console.WriteLine(Sentencia); try { DataManager.CLS.OperacionBD Operacion = new DataManager.CLS.OperacionBD(); if (Operacion.Actualizar(Sentencia) > 0) { Resultado = true; } else { Resultado = false; } } catch { Resultado = false; } return(Resultado); }
public Boolean Guardar() { Boolean Resultado = false; int ultimoIngreso = CacheManager.CLS.SucursalCache.Ultima_Ingreso() + 1; String Sentencia = @"INSERT INTO sucursales(direccion,telefono) VALUES(' " + this._Direccion + " ',' " + this._Telefono + " ');" + @"Insert into sucursales_encargados(idSucursal,idEncargado) values( (select idsucursales from sucursales order by idsucursales desc limit 1) ," + this._Encargado + " );"; Console.WriteLine(Sentencia); try { DataManager.CLS.OperacionBD Operacion = new DataManager.CLS.OperacionBD(); if (Operacion.Insertar(Sentencia) > 0) { Resultado = true; } else { Resultado = false; } } catch { Resultado = false; } return(Resultado); }
public Boolean Editar() { Boolean Resultado = false; String Sentencia = @"UPDATE servicios SET nombre=' " + this.Nombre + " ' , valorcontado=" + this.Valorcontado + ", valorcuota=" + this.Valorcuota + ", descripcion=' " + this.Descripcion + " ' , prima=" + this.Prima + "" + "WHERE idservicios = " + this.Idservicios + ";"; Console.WriteLine(Sentencia); try { DataManager.CLS.OperacionBD Operacion = new DataManager.CLS.OperacionBD(); if (Operacion.Actualizar(Sentencia) > 0) { Resultado = true; } else { Resultado = false; } } catch { Resultado = false; } return(Resultado); }
/* * public int Idservicios { get => _idservicios; set => _idservicios = value; } * public string Nombre { get => _nombre; set => _nombre = value; } * public float Valorcontado { get => _valorcontado; set => _valorcontado = value; } * public float Valorcuota { get => _valorcuota; set => _valorcuota = value; } * public string Descripcion { get => _descripcion; set => _descripcion = value; } * public float Prima { get => _prima; set => _prima = value; } */ public Boolean Guardar() { Boolean Resultado = false; String Sentencia = @"INSERT INTO servicios(nombre,valorcontado,valorcuota,descripcion,prima) VALUES(' " + this.Nombre + " '," + this.Valorcontado + ", " + this.Valorcuota + " ,' " + this.Descripcion + " '," + this.Prima + " ); "; Console.WriteLine(Sentencia); try { DataManager.CLS.OperacionBD Operacion = new DataManager.CLS.OperacionBD(); if (Operacion.Insertar(Sentencia) > 0) { Resultado = true; } else { Resultado = false; } } catch { Resultado = false; } return(Resultado); }
public static DataTable Listar_Puestos() { DataTable Resultados = new DataTable(); DataManager.CLS.OperacionBD Consultor = new DataManager.CLS.OperacionBD(); String Consulta = @"select * from puestos;"; try { Resultados = Consultor.Consultar(Consulta); } catch { Resultados = new DataTable(); } return Resultados; }
public static DataTable Traer_Puesto(int id) { DataTable Resultados = new DataTable(); DataManager.CLS.OperacionBD Consultor = new DataManager.CLS.OperacionBD(); String Consulta = @"select * from puestos where idpuestos=" + id; try { Resultados = Consultor.Consultar(Consulta); } catch { Resultados = new DataTable(); } return Resultados; }
public static DataTable Listar_Usuarios_Neto() { DataTable Resultados = new DataTable(); DataManager.CLS.OperacionBD Consultor = new DataManager.CLS.OperacionBD(); String Consulta = @"select * from usuarios;"; try { Resultados = Consultor.Consultar(Consulta); } catch { Resultados = new DataTable(); } return(Resultados); }
public static DataTable Listar_Usuarios() { DataTable Resultados = new DataTable(); DataManager.CLS.OperacionBD Consultor = new DataManager.CLS.OperacionBD(); String Consulta = @"select a.idusuarios as ID, a.usuario,a.clave, a.rol,concat(c.nombres,c.apellidos) as empleado, c.DUI from usuarios a,empleados c where a.idempleados=c.idempleados;"; try { Resultados = Consultor.Consultar(Consulta); } catch { Resultados = new DataTable(); } return(Resultados); }
public static DataTable Traer_Empleado(int id) { DataTable Resultados = new DataTable(); DataManager.CLS.OperacionBD Consultor = new DataManager.CLS.OperacionBD(); String Consulta = @"SELECT * from empleados where idempleados=" + id; try { Resultados = Consultor.Consultar(Consulta); } catch { Resultados = new DataTable(); } return(Resultados); }