public bool Actualizar() { if (id == null) { return(false); } condiciones = $"id = {this.id}"; parametros = new Dictionary <string, object>() { { "nombre", this.nombre }, { "fecha", this.fecha.ToString("dd/MM/yyyy") } }; return(Ejecutor.Actualizar(TABLA, parametros, condiciones)); }
public bool Actualizar() { if (id == null) { return(false); } condiciones = $"id = {this.id}"; parametros = new Dictionary <string, object>() { { "nombre", this.nombre }, { "login", this.login } }; return(Ejecutor.Actualizar(TABLA, parametros, condiciones)); }
public bool Actualizar() { if (id == null) { return(false); } condiciones = $"id = {this.id}"; parametros = new Dictionary <string, object>() { { "nombre", this.nombre }, { "derechoBono", this.derechoBono }, { "horasExtras", this.horasExtras }, { "porcentajeBono", this.porcentajeBono } }; return(Ejecutor.Actualizar(TABLA, parametros, condiciones)); }
public bool Eliminar(bool quitar = false) { if (id == null) { return(false); } if (quitar) { return(Ejecutor.Eliminar(TABLA, $"Id = {this.id}")); // Eliminar el registro de la base } else { return(Ejecutor.Actualizar(TABLA, new Dictionary <string, object>() { { "estado", false } }, $"Id = {this.id}")); // Cambiar estado a false } }
public bool Actualizar() { if (id == null) { return(false); } condiciones = $"id = {this.id}"; parametros = new Dictionary <string, object>() { { "isss", this.Isss }, { "sueldoBase", this.SueldoBase }, { "afpEmpleado", this.AfpEmpleado }, { "afpEmpleador", this.AfpEmpleador }, { "renta", this.Renta } }; return(Ejecutor.Actualizar(TABLA, parametros, condiciones)); }
public bool Actualizar() { if (id == null) { return(false); } condiciones = $"id = {this.id}"; parametros = new Dictionary <string, object>() { { "nombre", this.nombre }, { "apellido", this.apellido }, { "email", this.email }, { "direccion", this.direccion }, { "telefono", this.telefono }, { "sueldoBase", this.sueldoBase }, { "idGerencia", this.idGerencia } }; return(Ejecutor.Actualizar(TABLA, parametros, condiciones)); }
public bool Eliminar(bool quitar = false) { if (id == null) { return(false); } if (this.ObtenerTodo().Count == 1) { return(false); // Porque no se puede quedar sin ningĂșn usuario } if (quitar) { return(Ejecutor.Eliminar(TABLA, $"Id = {this.id}")); // Eliminar el registro de la base } else { return(Ejecutor.Actualizar(TABLA, new Dictionary <string, object>() { { "estado", false } }, $"Id = {this.id}")); // Cambiar estado a false } }