// GET: AgentAdminReport public ActionResult Report() { var agentAdminReportViewModel = new AgentAdminReportViewModel { ListofAgent = _exportReport.GetAllAgentListByCategoryId(_sessionHandler.AgentAdminCategoryId), ListofReport = ReportList(), ListofOverdueTypes = _overdueTypes.GetAllActiveOverdueTypes(), ListofPriority = _priority.GetAllPrioritySelectListItem() }; return(View(agentAdminReportViewModel)); }
public ActionResult Report(AgentAdminReportViewModel reportViewModel) { if (ModelState.IsValid) { if (reportViewModel.ReportId == 1) { var reportDetailTicketStatusReport = _exportReport.GetDetailTicketStatusReport( reportViewModel.Fromdate, reportViewModel.Todate, reportViewModel.AgentId); if (reportDetailTicketStatusReport != null && reportDetailTicketStatusReport.Count > 0) { ExporttoExcel(reportDetailTicketStatusReport, "Report", "AgentDetailTicketStatusReport.xlsx"); } else { TempData["ReportMessages"] = "No Data to Export"; } } if (reportViewModel.ReportId == 2) { var reportCategoryWiseTicketStatuReport = _exportReport.GetCategoryWiseTicketStatusReport( reportViewModel.Fromdate, reportViewModel.Todate, _sessionHandler.AgentAdminCategoryId); if (reportCategoryWiseTicketStatuReport != null && reportCategoryWiseTicketStatuReport.Count > 0) { ExporttoExcel(reportCategoryWiseTicketStatuReport, "Report", "CategoryWiseTicketStatusReport.xlsx"); } else { TempData["ReportMessages"] = "No Data to Export"; } } if (reportViewModel.ReportId == 3) { var reportTicketOverduesbyCategorReport = _exportReport.GetTicketOverduesbyCategoryReport( reportViewModel.Fromdate, reportViewModel.Todate, reportViewModel.OverdueTypeId, _sessionHandler.AgentAdminCategoryId); if (reportTicketOverduesbyCategorReport != null && reportTicketOverduesbyCategorReport.Count > 0) { ExporttoExcel(reportTicketOverduesbyCategorReport, "Report", "TicketOverduesReport.xlsx"); } else { TempData["ReportMessages"] = "No Data to Export"; } } if (reportViewModel.ReportId == 4) { var reportTicketOverdueReport = _exportReport.GetTicketOverduesbyCategoryReport( reportViewModel.Fromdate, reportViewModel.Todate, reportViewModel.OverdueTypeId, _sessionHandler.AgentAdminCategoryId); if (reportTicketOverdueReport != null && reportTicketOverdueReport.Count > 0) { ExporttoExcel(reportTicketOverdueReport, "Report", "TicketOverduesReport.xlsx"); } else { TempData["ReportMessages"] = "No Data to Export"; } } if (reportViewModel.ReportId == 5) { var reportEscalationReport = _exportReport.GetEscalationbyCategoryReport( reportViewModel.Fromdate, reportViewModel.Todate, _sessionHandler.AgentAdminCategoryId); if (reportEscalationReport != null && reportEscalationReport.Count > 0) { ExporttoExcel(reportEscalationReport, "Report", "EscalationbyCategoryReport.xlsx"); } else { TempData["ReportMessages"] = "No Data to Export"; } } if (reportViewModel.ReportId == 6) { var reportDeletedReport = _exportReport.GetDeletedTicketHistoryByCategoryReport( reportViewModel.Fromdate, reportViewModel.Todate, _sessionHandler.AgentAdminCategoryId); if (reportDeletedReport != null && reportDeletedReport.Count > 0) { ExporttoExcel(reportDeletedReport, "Report", "DeletedTicketHistoryByCategoryRepor.xlsx"); } else { TempData["ReportMessages"] = "No Data to Export"; } } if (reportViewModel.ReportId == 7) { var reportPriorityReport = _exportReport.GetPriorityWiseTicketStatusReport( reportViewModel.Fromdate, reportViewModel.Todate, reportViewModel.PriorityId); if (reportPriorityReport != null && reportPriorityReport.Count > 0) { ExporttoExcel(reportPriorityReport, "Report", "PriorityWiseTicketStatusReport.xlsx"); } else { TempData["ReportMessages"] = "No Data to Export"; } } if (reportViewModel.ReportId == 8) { var reportUserReport = _exportReport.GetUsersDetailsReport( reportViewModel.AgentId ); if (reportUserReport != null && reportUserReport.Count > 0) { ExporttoExcel(reportUserReport, "Report", "UsersDetailsReport.xlsx"); } else { TempData["ReportMessages"] = "No Data to Export"; } } if (reportViewModel.ReportId == 9) { var checkinCheckOutReport = _exportReport.UserWiseCheckinCheckOutReport( reportViewModel.Fromdate, reportViewModel.Todate, reportViewModel.AgentId ); if (checkinCheckOutReport != null && checkinCheckOutReport.Count > 0) { ExporttoExcel(checkinCheckOutReport, "Report", "UserWiseCheckinCheckOutReport.xlsx"); } else { TempData["ReportMessages"] = "No Data to Export"; } } } reportViewModel.ListofAgent = _exportReport.GetAllAgentListByCategoryId(_sessionHandler.AgentAdminCategoryId); reportViewModel.ListofReport = ReportList(); reportViewModel.ListofOverdueTypes = _overdueTypes.GetAllActiveOverdueTypes(); reportViewModel.ListofPriority = _priority.GetAllPrioritySelectListItem(); return(View(reportViewModel)); }