public List <ct_distribucion_gastos_x_periodo_det_gastos_Info> get_list_para_distribucion(int IdEmpresa, int IdPeriodo) { try { List <ct_distribucion_gastos_x_periodo_det_gastos_Info> Lista = new List <ct_distribucion_gastos_x_periodo_det_gastos_Info>(); using (EntitiesContabilidad_FJ Context = new EntitiesContabilidad_FJ()) { var lst = from q in Context.vwct_distribucion_gastos_x_periodo_det_gastos_para_distribuir where q.IdEmpresa == IdEmpresa && q.IdPeriodo == IdPeriodo select q; foreach (var item in lst) { ct_distribucion_gastos_x_periodo_det_gastos_Info info = new ct_distribucion_gastos_x_periodo_det_gastos_Info(); info.IdEmpresa = item.IdEmpresa; info.IdCtaCble = item.IdCtaCble; info.pc_Cuenta = item.pc_Cuenta; info.Saldo = item.dc_Valor == null ? 0 : Convert.ToDouble(item.dc_Valor); info.Checked = true; Lista.Add(info); } } return(Lista); } catch (Exception ex) { string mensaje = ""; 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.ToString(); throw new Exception(ex.ToString()); } }