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 ActionResult Modificar(ro_empleado_x_ro_rubro_Info info) { try { info.IdUsuarioUltMod = SessionFixed.IdUsuario; if (ModelState.IsValid) { info.Valor = Math.Round(info.Valor, 2); info.IdEmpresa = GetIdEmpresa(); if (!bus_rubro_fijos.modificarDB(info)) { cargar_combos(info.IdNomina_Tipo); return(View(info)); } else { return(RedirectToAction("Index", new { IdEmpleado = info.IdEmpleado })); } } else { return(View(info)); } } catch (Exception) { throw; } }
public ro_empleado_x_ro_rubro_Info Get_Info_empleado_x_ro_rubro(int IdEmpresa, decimal IdEmpleado) { EntitiesRoles oEnti = new EntitiesRoles(); ro_empleado_x_ro_rubro_Info Info = new ro_empleado_x_ro_rubro_Info(); try { var Objeto = oEnti.ro_empleado_x_ro_rubro.First(var => var.IdEmpresa == IdEmpresa && var.IdEmpleado == IdEmpleado); Info.IdEmpresa = Objeto.IdEmpresa; Info.IdNomina_Tipo = Objeto.IdNomina_Tipo; Info.IdNomina_TipoLiqui = Objeto.IdNomina_TipoLiqui; Info.IdEmpleado = Objeto.IdEmpleado; Info.IdRubro = Objeto.IdRubro; Info.IdCentroCosto = Objeto.IdCentroCosto; // Info.Secuencia = Objeto.Secuencia; Info.Valor = Objeto.Valor; return(Info); } 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 ActionResult Nuevo(ro_empleado_x_ro_rubro_Info info) { try { IdEmpresa = GetIdEmpresa(); info.IdEmpresa = IdEmpresa; if (ModelState.IsValid) { info.Valor = Math.Round(info.Valor); if (!bus_rubro_fijos.guardarDB(info)) { cargar_combos(0); return(View(info)); } else { return(RedirectToAction("Index", new { IdEmpleado = info.IdEmpleado })); } } else { return(View(info)); } } 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.IdCentroCosto = "001"; 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 Boolean ModificarDB(ro_empleado_x_ro_rubro_Info info) { try { using (EntitiesRoles context = new EntitiesRoles()) { var contact = context.ro_empleado_x_ro_rubro.First(minfo => minfo.IdEmpresa == info.IdEmpresa && minfo.IdEmpleado == info.IdEmpleado && minfo.IdNomina_Tipo == info.IdNomina_Tipo && minfo.IdNomina_TipoLiqui == info.IdNomina_TipoLiqui && minfo.IdRubro == info.IdRubro); contact.Valor = info.Valor; 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 }; 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; Context.SaveChanges(); } return(true); } catch (Exception) { throw; } }
public bool anularDB(ro_empleado_x_ro_rubro_Info info) { try { return(odata.anularDB(info)); } catch (Exception) { throw; } }
public bool modificarDB(ro_empleado_x_ro_rubro_Info info) { try { return(odata.modificarDB(info)); } catch (Exception ex) { tb_LogError_Bus LogData = new tb_LogError_Bus(); LogData.GuardarDB(new tb_LogError_Info { Descripcion = ex.Message, InnerException = ex.InnerException == null ? null : ex.InnerException.Message, Clase = "ro_empleado_x_ro_rubro_Bus", Metodo = "modificarDB", IdUsuario = info.IdUsuario }); return(false); } }
public Boolean ModificarDB(ro_empleado_x_ro_rubro_Info info) { try { return(odata.ModificarDB(info)); } catch (Exception ex) { Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message); throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "ModificarDB", ex.Message), ex) { EntityType = typeof(ro_empleado_x_ro_rubro_Bus) }; } }
public Boolean GrabarBD(ro_empleado_x_ro_rubro_Info Info, ref string msg) { try { return(odata.GrabarBD(Info, ref msg)); } catch (Exception ex) { Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message); throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "GrabarBD", ex.Message), ex) { EntityType = typeof(ro_empleado_x_ro_rubro_Bus) }; } }
public ActionResult Modificar(int IdNomina_Tipo = 0, int IdRubroFijo = 0) { try { IdEmpresa = GetIdEmpresa(); ro_empleado_x_ro_rubro_Info model = new ro_empleado_x_ro_rubro_Info(); model = bus_rubro_fijos.get_info(IdEmpresa, IdRubroFijo); cargar_combos(IdNomina_Tipo); return(View(model)); } catch (Exception) { throw; } }
public ActionResult Nuevo() { try { ro_empleado_x_ro_rubro_Info model = new ro_empleado_x_ro_rubro_Info { IdNomina_Tipo = 1, FechaInicio = DateTime.Now.Date, FechaFin = DateTime.Now.AddMonths(3) }; cargar_combos(0); return(View(model)); } catch (Exception) { throw; } }
public List <ro_empleado_x_ro_rubro_Info> Get_Info_empleado_x_ro_rubro(int IdEmpresa, decimal IdEmpleado, int idNomina, int idNominaLiqui) { List <ro_empleado_x_ro_rubro_Info> Lst = new List <ro_empleado_x_ro_rubro_Info>(); EntitiesRoles oEnti = new EntitiesRoles(); try { var datos = from a in oEnti.vwRo_Nomina_x_Liqui_x_Rubro_x_Empleado where a.IdEmpresa == IdEmpresa && a.IdEmpleado == IdEmpleado && a.IdNomina_Tipo == idNomina && a.IdNomina_TipoLiqui == idNominaLiqui select a; foreach (var item in datos) { ro_empleado_x_ro_rubro_Info Obj = new ro_empleado_x_ro_rubro_Info(); Obj.IdEmpresa = item.IdEmpresa; Obj.IdNomina_Tipo = item.IdNomina_Tipo; Obj.IdNomina_TipoLiqui = item.IdNomina_TipoLiqui; Obj.IdEmpleado = Convert.ToDecimal(item.IdEmpleado); Obj.IdRubro = item.IdRubro; Obj.Valor = Convert.ToDecimal(item.Valor == null ? 0 : item.Valor); Obj.Descripcion = item.Descripcion; Obj.DescripcionProcesoNomina = item.DescripcionProcesoNomina; Obj.rub_codigo = item.rub_codigo; Obj.ru_descripcion = item.ru_descripcion; Lst.Add(Obj); } return(Lst); } 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 ActionResult Anular(ro_empleado_x_ro_rubro_Info info) { try { if (!bus_rubro_fijos.anularDB(info)) { cargar_combos(info.IdNomina_Tipo); return(View(info)); } else { return(RedirectToAction("Index")); } } catch (Exception) { throw; } }
public ActionResult Anular(int IdNomina_Tipo = 0, int IdRubroFijo = 0) { try { ro_empleado_x_ro_rubro_Info model = new ro_empleado_x_ro_rubro_Info(); cargar_combos(IdNomina_Tipo); IdEmpresa = GetIdEmpresa(); model = bus_rubro_fijos.get_info(IdEmpresa, IdRubroFijo); if (model == null) { return(RedirectToAction("Index")); } return(View(model)); } catch (Exception) { throw; } }
public List <ro_empleado_x_ro_rubro_Info> Get_List_empleado_x_ro_rubro(int IdEmpresa, decimal IdEmpleado) { List <ro_empleado_x_ro_rubro_Info> Lst = new List <ro_empleado_x_ro_rubro_Info>(); EntitiesRoles oEnti = new EntitiesRoles(); try { var Query = from q in oEnti.vwRo_Conf_Rubros_Empleado where q.IdEmpresa == IdEmpresa && q.IdEmpleado == IdEmpleado orderby q.OrdenPres select q; foreach (var item in Query) { ro_empleado_x_ro_rubro_Info Obj = new ro_empleado_x_ro_rubro_Info(); Obj.IdEmpresa = item.IdEmpresa; Obj.IdEmpleado = Convert.ToDecimal(item.IdEmpleado); Obj.IdRubro = item.IdRubro; Obj.InfoTipoRubro.ru_descripcion = item.ru_descripcion; Obj.InfoTipoRubro.ru_tipo = item.ru_tipo; Obj.InfoTipoRubro.NombreCorto = item.NombreCorto; //Obj.IdCentroCosto = item.IdCentroCosto; Obj.Valor = Convert.ToDecimal(item.valor == null ? 0 : item.valor); // Obj.Secuencia = Convert.ToInt32(item.secuencia == null ? 0:item.valor); Lst.Add(Obj); } return(Lst); } 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 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 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 List <ro_empleado_x_ro_rubro_Info> Get_List_empleado_x_ro_rubro_x_Conf_Rubros(int IdEmpresa) { List <ro_empleado_x_ro_rubro_Info> Lst = new List <ro_empleado_x_ro_rubro_Info>(); EntitiesRoles oEnti = new EntitiesRoles(); try { var Query = from q in oEnti.vwRo_Conf_Rubros where q.IdEmpresa == IdEmpresa orderby q.OrdenPres select q; foreach (var item in Query) { ro_empleado_x_ro_rubro_Info Obj = new ro_empleado_x_ro_rubro_Info(); Obj.IdEmpresa = item.IdEmpresa; Obj.IdRubro = item.IdRubro; Obj.InfoTipoRubro.ru_descripcion = item.ru_descripcion; Obj.InfoTipoRubro.ru_tipo = item.ru_tipo; Obj.InfoTipoRubro.NombreCorto = item.NombreCorto; Lst.Add(Obj); } return(Lst); } 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, 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); } }
public List <ro_empleado_x_ro_rubro_Info> Get_List_empleado_x_ro_rubro_x_Empleado(int IdEmpresa, decimal IdEmpleado) { List <ro_empleado_x_ro_rubro_Info> Lst = new List <ro_empleado_x_ro_rubro_Info>(); EntitiesRoles db = new EntitiesRoles(); try { var datos = from a in db.ro_empleado_x_ro_rubro where a.IdEmpresa == IdEmpresa && a.IdEmpleado == IdEmpleado select a; foreach (var item in datos) { ro_empleado_x_ro_rubro_Info Obj = new ro_empleado_x_ro_rubro_Info(); Obj.IdEmpresa = item.IdEmpresa; Obj.IdNomina_Tipo = item.IdNomina_Tipo; Obj.IdNomina_TipoLiqui = item.IdNomina_TipoLiqui; Obj.IdEmpleado = item.IdEmpleado; Obj.IdRubro = item.IdRubro; Obj.IdCentroCosto = item.IdCentroCosto; Obj.Valor = item.Valor; Lst.Add(Obj); } return(Lst); } 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 ActionResult CmbRubro_EmpxRub() { ro_empleado_x_ro_rubro_Info model = new ro_empleado_x_ro_rubro_Info(); return(PartialView("_CmbRubro_EmpxRub", model)); }