public ConsistenciaStockPozoVo(ConsistenciaStockPozo c) { Fecha = c.Fecha; StockInicial = c.StockInicial; Ingresos = c.Ingresos; IngresosPorConciliacion = c.IngresosPorConciliacion; Egresos = c.Egresos; EgresosPorConciliacion = c.EgresosPorConciliacion; StockFinal = c.StockFinal; StockSonda = c.StockSonda; DiferenciaDeStock = c.DiferenciaDeStock; }
/// <summary> /// Calculates subtotals for the current period. /// </summary> /// <returns></returns> private ConsistenciaStockPozo GetSubtotals() { if (ReportObjectsList == null || ReportObjectsList.Count.Equals(0)) { return(null); } var subtotales = new ConsistenciaStockPozo(); var first = ReportObjectsList[0]; var last = ReportObjectsList[ReportObjectsList.Count - 1]; subtotales.Fecha = last.Fecha; subtotales.StockInicial = first.StockInicial; subtotales.Ingresos = (from stock in ReportObjectsList select stock.Ingresos).Sum(); subtotales.IngresosPorConciliacion = (from stock in ReportObjectsList select stock.IngresosPorConciliacion).Sum(); subtotales.Egresos = (from stock in ReportObjectsList select stock.Egresos).Sum(); subtotales.EgresosPorConciliacion = (from stock in ReportObjectsList select stock.EgresosPorConciliacion).Sum(); subtotales.StockFinal = last.StockFinal; subtotales.StockSonda = last.StockSonda - first.StockSonda; subtotales.DiferenciaDeStock = (from stock in ReportObjectsList select stock.DiferenciaDeStock).Sum(); return(subtotales); }