public Boolean GrabarBD(ro_empleado_x_Proyeccion_Gastos_Personales_Info info, ref string msg) { try { Boolean valorRetornar = false; //MODIFICA if (oData.GetExiste(info, ref msg)) { info.UsuarioModifica = param.IdUsuario; info.FechaModifica = param.Fecha_Transac; valorRetornar = oData.ModificarBD(info, ref msg); } else //GRABA { info.UsuarioIngresa = param.IdUsuario; info.FechaIngresa = param.Fecha_Transac; valorRetornar = oData.GrabarBD(info, ref msg); } return(valorRetornar); } 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_Proyeccion_Gastos_Personales_Bus) }; } }
public Boolean GrabarBD(ro_empleado_x_Proyeccion_Gastos_Personales_Info info, ref string msg) { try { using (EntitiesRoles db = new EntitiesRoles()) { ro_empleado_x_Proyeccion_Gastos_Personales item = new ro_empleado_x_Proyeccion_Gastos_Personales(); item.IdEmpresa = info.IdEmpresa; item.IdEmpleado = info.IdEmpleado; item.IdTipoGasto = info.IdTipoGasto; item.AnioFiscal = info.AnioFiscal; item.Valor = info.Valor; item.FechaIngresa = info.FechaIngresa; item.UsuarioIngresa = info.UsuarioIngresa; item.FechaModifica = info.FechaModifica; item.UsuarioModifica = info.UsuarioModifica; db.ro_empleado_x_Proyeccion_Gastos_Personales.Add(item); db.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 GetExiste(ro_empleado_x_Proyeccion_Gastos_Personales_Info info, ref string msg) { try { Boolean valorRetornar = false; using (EntitiesRoles db = new EntitiesRoles()) { int cont = (from a in db.ro_empleado_x_Proyeccion_Gastos_Personales where a.IdEmpresa == info.IdEmpresa && a.IdEmpleado == info.IdEmpleado && a.IdTipoGasto == info.IdTipoGasto && a.AnioFiscal == info.AnioFiscal select a).Count(); if (cont > 0) { valorRetornar = true; } else { valorRetornar = false; } } return(valorRetornar); } 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 List <ro_empleado_x_Proyeccion_Gastos_Personales_Info> ConsultaSRITipoGasto() { List <ro_empleado_x_Proyeccion_Gastos_Personales_Info> Lst = new List <ro_empleado_x_Proyeccion_Gastos_Personales_Info>(); try { using (EntitiesRoles rol = new EntitiesRoles()) { var Consulta = from q in rol.ro_tipo_gastos_personales select q; foreach (var item in Consulta) { ro_empleado_x_Proyeccion_Gastos_Personales_Info info = new ro_empleado_x_Proyeccion_Gastos_Personales_Info(); info.IdTipoGasto = item.IdTipoGasto; info.nom_tipo_gasto = item.nom_tipo_gasto; Lst.Add(info); } } return(Lst); } catch (Exception ex) { string array = 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(), "", array, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }
public List <ro_empleado_x_Proyeccion_Gastos_Personales_Info> Get_List_empleado_x_Proyeccion_Gastos_Personales(int IdEmpresa, decimal IdEmpleado, int AnioFiscal) { List <ro_empleado_x_Proyeccion_Gastos_Personales_Info> lst = new List <ro_empleado_x_Proyeccion_Gastos_Personales_Info>(); try { using (EntitiesRoles rol = new EntitiesRoles()) { var Consulta = from a in rol.vwRo_empleado_x_Proyeccion_Gastos_Personales where a.IdEmpresa == IdEmpresa && a.IdEmpleado == IdEmpleado && a.AnioFiscal == AnioFiscal select a; foreach (var item in Consulta) { ro_empleado_x_Proyeccion_Gastos_Personales_Info info = new ro_empleado_x_Proyeccion_Gastos_Personales_Info(); info.IdEmpresa = item.IdEmpresa; info.IdEmpleado = item.IdEmpleado; info.IdTipoGasto = item.IdTipoGasto; info.AnioFiscal = item.AnioFiscal; info.Valor = item.Valor; info.FechaIngresa = item.FechaIngresa; info.UsuarioIngresa = item.UsuarioIngresa; info.FechaModifica = item.FechaModifica; info.UsuarioModifica = item.UsuarioModifica; info.nom_tipo_gasto = item.nom_tipo_gasto; info.Monto_max = (int)item.Monto_max; lst.Add(info); } } 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 ro_empleado_x_Proyeccion_Gastos_Personales_Info Get_Info_empleado_x_Proyeccion_Gastos_Personales(int IdEmpresa, decimal IdEmpleado, string IdTipoGasto, int AnioFiscal) { try { ro_empleado_x_Proyeccion_Gastos_Personales_Info info = new ro_empleado_x_Proyeccion_Gastos_Personales_Info(); using (EntitiesRoles rol = new EntitiesRoles()) { var Query = from a in rol.ro_empleado_x_Proyeccion_Gastos_Personales where a.IdEmpresa == IdEmpresa && a.IdEmpleado == IdEmpleado && a.IdTipoGasto == IdTipoGasto && a.AnioFiscal == AnioFiscal select a; foreach (var item in Query) { info.IdEmpresa = item.IdEmpresa; info.IdEmpleado = item.IdEmpleado; info.IdTipoGasto = item.IdTipoGasto; info.AnioFiscal = item.AnioFiscal; info.Valor = item.Valor; info.FechaIngresa = item.FechaIngresa; info.UsuarioIngresa = item.UsuarioIngresa; info.FechaModifica = item.FechaModifica; info.UsuarioModifica = item.UsuarioModifica; } } 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()); } }