internal ReporteDiarioInventarioAlCierreDatos GenerarReporteDiarioInventarioAlCierre(int organizacionID, DateTime fecha) { try { Logger.Info(); Dictionary<string, object> parameters = AuxReporteDiarioInventarioAlCierre.ObtenerParametrosReporte( organizacionID, fecha); DataSet ds = Retrieve("ReporteDiarioInventarioAlCierre", parameters); ReporteDiarioInventarioAlCierreDatos result = null; if (ValidateDataSet(ds)) { result = MapReporteDiarioInventarioAlCierre.ObtenerDatosReporte(ds); } return result; } catch (SqlException ex) { Logger.Error(ex); throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex); } catch (DataException ex) { Logger.Error(ex); throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex); } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
private List <ReporteDiarioInventarioAlCierreInfo> GenerarReporte(ReporteDiarioInventarioAlCierreDatos datosReporte) { var resultado = new List <ReporteDiarioInventarioAlCierreInfo>(); datosReporte.ListaReporteInventario.ForEach(Dato => { var reporteDiarioinventariocierreInfo = new ReporteDiarioInventarioAlCierreInfo { Ingrediente = Dato.Ingrediente, TMExisAlmacenPA = Dato.TMExisAlmacenPA, TMExisAlmacenMP = Dato.TMExisAlmacenMP, TMInvTotalPAyMA = Dato.TMInvTotalPAyMA, TMConsumoDia = Dato.TMConsumoDia, DiasCobertura = Dato.DiasCobertura, CapacidadAlamacenajeDias = Dato.CapacidadAlamacenajeDias, DiasCoberturaFaltante = Dato.DiasCoberturaFaltante, MinimoDiasReorden = Dato.MinimoDiasReorden, TMCapacidadAlmacenaje = Dato.TMCapacidadAlmacenaje, EstatusReorden = Dato.EstatusReorden }; resultado.Add(Dato); }); return(resultado); }
public List <ReporteDiarioInventarioAlCierreInfo> GenerarReporte(int organizacionID, DateTime fecha) { List <ReporteDiarioInventarioAlCierreInfo> lista = null; try { Logger.Info(); var reportediarioinventariocierreDAL = new ReporteDiarioInventarioAlCierreDAL(); ReporteDiarioInventarioAlCierreDatos datosReporte = reportediarioinventariocierreDAL.GenerarReporteDiarioInventarioAlCierre(organizacionID, fecha); if (datosReporte != null) { lista = GenerarReporte(datosReporte); } } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } return(lista); }
public static ReporteDiarioInventarioAlCierreDatos ObtenerDatosReporte(DataSet ds) { ReporteDiarioInventarioAlCierreDatos resultado; try { Logger.Info(); DataTable oTable = ds.Tables[0]; resultado = new ReporteDiarioInventarioAlCierreDatos { ListaReporteInventario = (from movs in oTable.AsEnumerable() select new ReporteDiarioInventarioAlCierreInfo { ProductoId = movs.Field <int>("ProductoID"), Ingrediente = movs.Field <string>("Ingrediente"), TMExisAlmacenPA = movs.Field <decimal>("TMExisAlmacenPA"), TMExisAlmacenMP = movs.Field <decimal>("TMExisAlmacenMP"), TMInvTotalPAyMA = movs.Field <decimal>("TMInvTotalPAyMA"), TMConsumoDia = movs.Field <decimal>("TMConsumoDia"), DiasCobertura = movs.Field <decimal>("DiasCobertura"), CapacidadAlamacenajeDias = movs.Field <decimal>("CapacidadAlmacenajeDias"), DiasCoberturaFaltante = movs.Field <decimal>("DiasCoberturaFaltante"), MinimoDiasReorden = movs.Field <decimal>("MinimoDiasReorden"), TMCapacidadAlmacenaje = movs.Field <decimal>("TMCapacidadAlmacenaje"), EstatusReorden = movs.Field <string>("EstatusReorden") }).ToList() }; return(resultado); } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }