Ejemplo n.º 1
0
 public ActionResult MonthlyDueReport()
 {
     try
     {
         MainViewModel.MonthlyDueViewModel subscriptionViewModel = new MainViewModel.MonthlyDueViewModel();
         ViewBag.Year = reportService.YearList();
         return(PartialView(subscriptionViewModel));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 2
0
        public ActionResult _MonthlyDueReport(int?Month, int?Year, string Location, int pageNo = 1, int pageSize = 10)
        {
            try
            {
                MainViewModel.MonthlyDueViewModel MonthlyModel = new MainViewModel.MonthlyDueViewModel();
                var monthlyList = reportService.getMonthlyDueList(Month, Year, Location, pageNo, pageSize);
                MonthlyModel.monthlyDuePagedList = new StaticPagedList <MainViewModel.MonthlyDueViewModel>(monthlyList, pageNo, pageSize, (monthlyList.Count == 0) ? 0 : monthlyList.FirstOrDefault().TotalCount);



                return(PartialView(MonthlyModel));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 3
0
        public FileContentResult MonthlyDueReportExportToExcel(int?Month, int?Year, string Location, int pageNo = 1, int pageSize = 0, string Monthtext = "")
        {
            MainViewModel.MonthlyDueViewModel subscriptionViewModel = new MainViewModel.MonthlyDueViewModel();
            var monthlyList      = reportService.getMonthlyDueList(Month, Year, Location, pageNo, pageSize);
            var monthlyExcelList = monthlyList.Select(x => new ExcelViewModel.MonthlyDueExcelViewModel()
            {
                custNo       = x.Custno,
                Subsno       = x.Subsno,
                CustomerName = x.CustomerName,
                CustomerType = x.CustomerType,
                LocationName = x.LocationName,
                MonthlyDue   = x.MonthlyDue,
                PostedOn     = x.PostedOn
            }).ToList();

            string[] columns         = { "Customer No", "Subscription No.", "Customer Name", "Customer Type", "Location Name", "Monthly Due", "PostedOn" };
            string[] parameterSearch = { "Year.:  " + Year, "MonthText.:  " + Monthtext, "Location.:  " + Location };
            byte[]   fileContent     = ExcelExportHelper.ExportExcel(monthlyExcelList, parameterSearch, null, "Monthly Due Report", columns);
            return(File(fileContent, ExcelExportHelper.ExcelContentType, "Monthly Due  Report.xlsx"));
        }