public List <ro_ConfRubrosAcumulado_Info> ConsultaGeneral(int IdEmpresa) { try { lista = new List <ro_ConfRubrosAcumulado_Info>(); EntitiesRoles ORol = new EntitiesRoles(); var sresult = from A in ORol.vwRo_Conf_Rubros_Acumulados_x_Empresa where A.IdEmpresa == IdEmpresa select A; foreach (var item in sresult) { ro_ConfRubrosAcumulado_Info Reg = new ro_ConfRubrosAcumulado_Info(); Reg.IdEmpresa = item.IdEmpresa; Reg.IdRubro = item.IdRubro; Reg.Descripcion = item.ru_descripcion; Reg.Configurable = item.Configurable; lista.Add(Reg); } return(lista); } 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 GrabarDB(ro_ConfRubrosAcumulado_Info ro_info, ref string mensaje) { try { using (EntitiesRoles context = new EntitiesRoles()) { EntitiesRoles EDB = new EntitiesRoles(); var address = new ro_Config_Rubros_Acumulado(); address.IdEmpresa = ro_info.IdEmpresa; address.IdRubro = ro_info.IdRubro; address.FechaInicio = Convert.ToDateTime(ro_info.FechaInicio); address.FechaFin = Convert.ToDateTime(ro_info.FechaFin); address.Configurable = ro_info.Configurable; context.ro_Config_Rubros_Acumulado.Add(address); context.SaveChanges(); mensaje = "Se ha procedido a grabar exitosamente los datos.."; } 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 ro_ConfRubrosAcumulado_Info GetConsultaPorId(int IdEmpresa, string idRubro) { try { ro_ConfRubrosAcumulado_Info info = new ro_ConfRubrosAcumulado_Info(); EntitiesRoles db = new EntitiesRoles(); var datos = (from a in db.ro_Config_Rubros_Acumulado where a.IdEmpresa == IdEmpresa && a.IdRubro == idRubro select a); foreach (var item in datos) { info.IdEmpresa = item.IdEmpresa; info.IdRubro = item.IdRubro; info.FechaInicio = item.FechaInicio; info.FechaFin = item.FechaFin; info.Configurable = item.Configurable; } 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 Boolean GrabarDB(ro_ConfRubrosAcumulado_Info prI, ref string mensaje) { try { return(oData.GrabarDB(prI, ref mensaje)); } 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("", "GrabarDB", ex.Message), ex) { EntityType = typeof(ro_ConfRubrosAcumulados_Bus) }; } }