public ActionResult Quadranti(string Reparto) { Reparto = Reparto.ToUpper(); if (string.IsNullOrEmpty(Reparto)) { RedirectToAction("Index", "Home"); } ViewData.Add("Reparto", Reparto); QuadrantiModel model = ODLHelper.GetDatiPerQuadranti(Reparto); string etichetta = Reparti.LeggiEtichetta(Reparto); ViewData.Add("Titolo", etichetta); ViewData.Add("TimeoutChangePage", ShortTimeoutChangePage); return(View(model)); }
public static QuadrantiModel GetDatiPerQuadranti(string Reparto) { ReportDS ds = new ReportDS(); using (ReportWebBusiness bWebReport = new ReportWebBusiness()) { bWebReport.FillODL_APERTI(Reparto, TipoMovimentoFase.OrdineProduzione, ds); } QuadrantiModel model = new QuadrantiModel(); model.InScadenza = (int)ds.ODL_APERTI.Where(x => x.DATAFINE_ODL_E_MULTIPLA >= DateTime.Today && x.DATAFINE_ODL_E_MULTIPLA < DateTime.Today.AddDays(+2) && x.PIANIFICATO_SN == "No").Sum(x => x.QTADATER); model.Scaduti = (int)ds.ODL_APERTI.Where(x => x.DATAFINE_ODL_E_MULTIPLA < DateTime.Today).Sum(x => x.QTADATER); model.DaPrendereInCarico = (int)ds.ODL_APERTI.Where(x => x.IsDATAPRIMOINVIO_ODLNull() && !x.IsDATAMOVFASENull() && DateTime.Today.Subtract(x.DATAMOVFASE).TotalDays > 1 && x.PIANIFICATO_SN == "No").Sum(x => x.QTADATER); return(model); }