public ActionResult Participations() { var model = new PartitipationsReportViewModel(); model.from = DateTime.Now.AddDays(-2); model.to = DateTime.Now; if (Request.QueryString["Participations.From"] != null) { model.from = fromString(Request.QueryString["Participations.From"].ToString()); Session["Participations.From"] = model.from; } if (Request.QueryString["Participations.To"] != null) { model.to = fromString(Request.QueryString["Participations.To"].ToString()); Session["Participations.To"] = model.to; } model.ReceiptsChartData = _receiptApplication.GetCountPerDateBy(null, model.from, model.to.AddDays(1)).Select(d => new DashboardViewModel.ChartItem() { Label = d.Key, Value = d.Value }).OrderBy(d => d.Label).ToList(); model.ReceiptCount = _receiptApplication.GetCountBy(model.from, null, model.to.AddDays(1)); return(View("~/Areas/Admin/Views/Report/Participations.cshtml", model)); }
public ActionResult Index() { var model = new DashboardViewModel(); var vPowerData = _receiptApplication.GetCountPerDateBy("intimus"); model.LineChartVPowerData = vPowerData.Select(d => new DashboardViewModel.ChartItem() { Label = d.Key, Value = d.Value }) .OrderBy(d => d.Label) .ToList(); var PieVoucherDistribuido = _voucherApplication.NumberCoupons(); var PieTotalVoucher = 5000; model.PieChartData = new List <DashboardViewModel.ChartItem>() { new DashboardViewModel.ChartItem() { Label = "Voucher Distribuídos", Value = PieVoucherDistribuido }, new DashboardViewModel.ChartItem() { Label = "Quantidade de Voucher", Value = PieTotalVoucher } }; var PieReprovados = _receiptApplication.GetBy("intimus", true, false).Count(); var PiePendentes = _receiptApplication.GetBy("intimus", true, null).Count(); model.PieChartData2 = new List <DashboardViewModel.ChartItem>() { new DashboardViewModel.ChartItem() { Label = "Voucher Distribuídos:", Value = PieVoucherDistribuido }, new DashboardViewModel.ChartItem() { Label = "Reprovados", Value = PieReprovados }, new DashboardViewModel.ChartItem() { Label = "Pendente de Cuaradoria", Value = PiePendentes } }; model.PersonsChartData = _personApplication.GetCountPerDateBy(Convert.ToDateTime(vPowerData.OrderBy(k => k.Key).FirstOrDefault().Key), DateTime.Now) .Select(d => new DashboardViewModel.ChartItem() { Label = d.Key, Value = d.Value }) .OrderBy(d => d.Label) .ToList(); model.VPowerWinners = _receiptApplication.GetCountBy("intimus", true); return(View("~/Areas/Admin/Views/Dashboard/Index.cshtml", model)); }