public bool anularDB(ro_empleado_x_ro_rubro_Info info) { try { using (Entities_rrhh Context = new Entities_rrhh()) { ro_empleado_x_ro_rubro Entity = Context.ro_empleado_x_ro_rubro.FirstOrDefault(q => q.IdEmpresa == info.IdEmpresa && q.IdRubroFijo == info.IdRubroFijo); if (Entity == null) { return(false); } Entity.IdUsuarioUltAnu = info.IdUsuarioUltAnu; Entity.Fecha_UltAnu = DateTime.Now; Context.ro_empleado_x_ro_rubro.Remove(Entity); Context.SaveChanges(); } return(true); } catch (Exception) { throw; } }
public Boolean GrabarBD(ro_empleado_x_ro_rubro_Info Info, ref string msg) { try { List <ro_empleado_x_ro_rubro_Info> Lst = new List <ro_empleado_x_ro_rubro_Info>(); using (EntitiesRoles Context = new EntitiesRoles()) { var Address = new ro_empleado_x_ro_rubro(); Address.IdEmpresa = Info.IdEmpresa; Address.IdNomina_Tipo = Info.IdNomina_Tipo; Address.IdNomina_TipoLiqui = Info.IdNomina_TipoLiqui; Address.IdEmpleado = Info.IdEmpleado; Address.IdRubro = Info.IdRubro; Address.Valor = Info.Valor; Context.ro_empleado_x_ro_rubro.Add(Address); Context.SaveChanges(); // } return(true); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); mensaje = ex.InnerException + " " + ex.Message; oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); throw new Exception(ex.InnerException.ToString()); } }
public bool guardarDB(ro_empleado_x_ro_rubro_Info info) { try { using (Entities_rrhh Context = new Entities_rrhh()) { ro_empleado_x_ro_rubro Entity = new ro_empleado_x_ro_rubro { IdEmpresa = info.IdEmpresa, IdRubroFijo = get_id(info.IdEmpresa), IdEmpleado = info.IdEmpleado, IdNomina_Tipo = info.IdNomina_Tipo, IdNomina_TipoLiqui = info.IdNomina_TipoLiqui, Valor = info.Valor, IdRubro = info.IdRubro, FechaInicio = info.FechaInicio, FechaFin = info.FechaFin, es_indifinido = info.es_indifinido, IdUsuario = info.IdUsuario, Fecha_Transac = DateTime.Now }; Context.ro_empleado_x_ro_rubro.Add(Entity); Context.SaveChanges(); } return(true); } catch (Exception) { throw; } }
public bool modificarDB(ro_empleado_x_ro_rubro_Info info) { try { using (Entities_rrhh Context = new Entities_rrhh()) { ro_empleado_x_ro_rubro Entity = Context.ro_empleado_x_ro_rubro.FirstOrDefault(q => q.IdEmpresa == info.IdEmpresa && q.IdRubroFijo == info.IdRubroFijo); if (Entity == null) { return(false); } Entity.IdEmpleado = info.IdEmpleado; Entity.IdRubro = info.IdRubro; Entity.IdNomina_Tipo = info.IdNomina_Tipo; Entity.IdNomina_TipoLiqui = info.IdNomina_TipoLiqui; Entity.Valor = info.Valor; Entity.FechaFin = info.FechaFin; Entity.FechaInicio = info.FechaInicio; Entity.es_indifinido = info.es_indifinido; Entity.IdUsuarioUltMod = info.IdUsuarioUltMod; Entity.Fecha_UltMod = DateTime.Now; Context.SaveChanges(); } return(true); } catch (Exception) { throw; } }
public ro_empleado_x_ro_rubro_Info get_info(int IdEmpresa, int IdRubroFijo) { try { ro_empleado_x_ro_rubro_Info info = new ro_empleado_x_ro_rubro_Info(); using (Entities_rrhh Context = new Entities_rrhh()) { ro_empleado_x_ro_rubro Entity = Context.ro_empleado_x_ro_rubro.FirstOrDefault(q => q.IdEmpresa == IdEmpresa && q.IdRubroFijo == IdRubroFijo); if (Entity == null) { return(null); } info = new ro_empleado_x_ro_rubro_Info { IdEmpresa = Entity.IdEmpresa, IdRubroFijo = Entity.IdRubroFijo, IdEmpleado = Entity.IdEmpleado, IdNomina_Tipo = Entity.IdNomina_Tipo, IdNomina_TipoLiqui = Entity.IdNomina_TipoLiqui, Valor = Entity.Valor, IdRubro = Entity.IdRubro, FechaInicio = Entity.FechaInicio, FechaFin = Entity.FechaFin, es_indifinido = Entity.es_indifinido, IdDivision = Entity.IdDivision, IdArea = Entity.IdArea }; } return(info); } catch (Exception) { throw; } }
public bool modificarDB(ro_empleado_x_ro_rubro_Info info) { try { using (Entities_rrhh Context = new Entities_rrhh()) { ro_empleado_x_ro_rubro Entity = Context.ro_empleado_x_ro_rubro.FirstOrDefault(q => q.IdEmpresa == info.IdEmpresa && q.IdRubroFijo == info.IdRubroFijo); if (Entity == null) { return(false); } Entity.IdEmpleado = info.IdEmpleado; Entity.IdRubro = info.IdRubro; Entity.IdNomina_Tipo = info.IdNomina_Tipo; Entity.IdNomina_TipoLiqui = info.IdNomina_TipoLiqui; Entity.Valor = info.Valor; Entity.FechaFin = info.FechaFin; Entity.FechaInicio = info.FechaInicio; Entity.es_indifinido = info.es_indifinido; Entity.IdDivision = info.IdDivision; Entity.IdArea = info.IdArea; Entity.IdUsuarioUltMod = info.IdUsuarioUltMod; Entity.Fecha_UltMod = DateTime.Now; Context.SaveChanges(); } return(true); } catch (Exception ex) { tb_LogError_Data LogData = new tb_LogError_Data(); LogData.GuardarDB(new tb_LogError_Info { Descripcion = ex.Message, InnerException = ex.InnerException == null ? null : ex.InnerException.Message, Clase = "ro_empleado_x_ro_rubro_Data", Metodo = "modificarDB", IdUsuario = info.IdUsuario }); return(false); } }
public bool guardarDB(ro_empleado_x_ro_rubro_Info info) { try { using (Entities_rrhh Context = new Entities_rrhh()) { ro_empleado_x_ro_rubro Entity = new ro_empleado_x_ro_rubro { IdEmpresa = info.IdEmpresa, IdRubroFijo = get_id(info.IdEmpresa), IdEmpleado = info.IdEmpleado, IdNomina_Tipo = info.IdNomina_Tipo, IdNomina_TipoLiqui = info.IdNomina_TipoLiqui, Valor = info.Valor, IdRubro = info.IdRubro, FechaInicio = info.FechaInicio, FechaFin = info.FechaFin, es_indifinido = info.es_indifinido, IdDivision = info.IdDivision, IdArea = info.IdArea, IdUsuario = info.IdUsuario, Fecha_Transac = DateTime.Now }; Context.ro_empleado_x_ro_rubro.Add(Entity); Context.SaveChanges(); } return(true); } catch (Exception ex) { tb_LogError_Data LogData = new tb_LogError_Data(); LogData.GuardarDB(new tb_LogError_Info { Descripcion = ex.Message, InnerException = ex.InnerException == null ? null : ex.InnerException.Message, Clase = "ro_empleado_x_ro_rubro_Data", Metodo = "guardarDB", IdUsuario = info.IdUsuario }); return(false); } }