public async Task <GroupBasedReportViewModel> FilloutGroupReport(GroupBasedReportViewModel model) { FilloutBaseReport(model); var cults = applicationContext.Occasions.OfType <Cult>() .Where(o => o.Date > DateTime.Today.AddMonths(-1)) .Where(c => c.CultType.ToString() == model.ReportType.ToString()); //ATIVIDADES PARA EVENTOS model.ExternalCults = await cults.CountAsync(c => c.Internal == false); model.CellsNumber = await applicationContext.Occasions.OfType <Cell>().CountAsync(); model.Baptized = await applicationContext.Occasions.OfType <Baptism>() .Where(b => b.Date > DateTime.Today.AddMonths(-1)) .Include(b => b.Baptizeds) .ThenInclude(oc => oc.Member) .CountAsync(); model.Reunions = await applicationContext.Occasions.OfType <Reunion>() .Where(r => r.Date > DateTime.Today.AddMonths(-1)) .Where(r => r.ReunionType.Equals(ReunionType.LIDERANÇA)) .CountAsync(); model.MeetingsWithTheCoordination = await applicationContext.Occasions.OfType <Reunion>() .Where(b => b.Date > DateTime.Today.AddMonths(-1)) .Where(r => r.ReunionType.Equals(ReunionType.PEDAGÓGICA)) .CountAsync(); return(model); }
public async Task <ViewResult> Details(int?id) { var report = await repository.GetReport(id.Value); if (report == null) { Response.StatusCode = 404; return(View("EventNotFound", id.Value)); } switch (report.ReportType) { case ReportType.CRIANÇAS: var childrenViewModel = new GroupBasedReportDetailsViewModel((GroupBasedReport)report); return(View("GroupBasedReportDetails", childrenViewModel)); case ReportType.MULHERES: var womenViewModel = new GroupBasedReportDetailsViewModel((GroupBasedReport)report); return(View("GroupBasedReportDetails", womenViewModel)); case ReportType.HOMENS: var menViewModel = new GroupBasedReportDetailsViewModel((GroupBasedReport)report); return(View("GroupBasedReportDetails", menViewModel)); case ReportType.BIBLÍCO: var childrenViewModel2 = new GroupBasedReportViewModel((GroupBasedReport)report); return(View("GroupBasedReport", childrenViewModel2)); case ReportType.CÉLULA: var childrenViewModel23 = new GroupBasedReportViewModel((GroupBasedReport)report); return(View("GroupBasedReport", childrenViewModel23)); default: return(View()); } }
public GroupBasedReport(GroupBasedReportViewModel model) { //ATIVIDADES BÁSICAS DE RELATÓRIO ReportType = model.ReportType; Date = model.Date; PreacherId = model.PreacherId; CoordinatorId = model.CoordinatorId; Reunions = model.Reunions; Convertions = model.Convertions; //ATIVIDADES BÁSICAS PARA EVENTOS Reunions = model.Reunions; Convertions = model.Convertions; ExternalCults = model.ExternalCults; CellsNumber = model.CellsNumber; MeetingsWithTheCoordination = model.MeetingsWithTheCoordination; Baptized = model.Baptized; //MOVIMENTO FINANCEIRO PreviousMonth = model.PreviousMonth; Income = model.Income; Expense = model.Expense; Tenth = model.Tenth; Balance = model.Balance; }
public async Task <ViewResult> CreateWomenReport() { var model = new GroupBasedReportViewModel(ReportType.MULHERES); model = await reportBuilder.FilloutGroupReport(model); return(View("CreateWomenReport", model)); }
public ViewResult Create() { var childrenViewModel = new GroupBasedReportViewModel(ReportType.CRIANÇAS); var menViewModel = new GroupBasedReportViewModel(ReportType.HOMENS); var womenViewModel = new GroupBasedReportViewModel(ReportType.MULHERES); var youngViewModel = new YoungBasedReportViewModel(); var biblicalViewModel = new BiblicalBasedReportViewModel(); return(View("Create")); }
public async Task <IActionResult> CreateCellBasedReport(GroupBasedReportViewModel model) { if (ModelState.IsValid) { var groupBasedReport = new GroupBasedReport(model); await repository.Add(groupBasedReport); return(RedirectToAction("list", "report")); } return(View()); }