コード例 #1
0
 public ActionResult _collectionReportList(DateTime?collectionDate, int pageNo = 1, int pageSize = 10, string customerName = "", string collector = "", string Location = "", int verified = 1, string EntryTypeList = "")
 {
     try
     {
         MainViewModel.CollectionReport collectorViewModel = new MainViewModel.CollectionReport();
         var collectorList = reportService.getCollectorReportList(collectionDate, pageNo, pageSize, customerName, collector, Location, verified, EntryTypeList);
         collectorViewModel.collectorPagedList = new StaticPagedList <MainViewModel.CollectionReport>(collectorList, pageNo, pageSize, (collectorList.Count == 0) ? 0 : collectorList.FirstOrDefault().TotalCount);
         return(PartialView(collectorViewModel));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #2
0
        public ActionResult collectionReportList()
        {
            try
            {
                MainViewModel.CollectionReport collectorViewModel = new MainViewModel.CollectionReport();
                var suscriberList = reportService.getCollectorReportList(null, 1, 10, "", "", "", 1);
                collectorViewModel.collectorPagedList = new StaticPagedList <MainViewModel.CollectionReport>(suscriberList, 1, 10, (suscriberList.Count == 0) ? 0 : suscriberList.FirstOrDefault().TotalCount);

                //foreach (var item in customerList)
                //{
                //    customerViewModel.customerViewModelList.Add(item);
                //}


                return(PartialView(collectorViewModel));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #3
0
        public FileContentResult CollectionExportToExcel(DateTime?collectionDate, int pageNo = 1, int pageSize = 0, string customerName = "", string collector = "", string Location = "", int verified = 1, string statustext = "", string EntryTypeList = "")
        {
            MainViewModel.CollectionReport collectorViewModel = new MainViewModel.CollectionReport();
            var collectorList      = reportService.getCollectorReportList(collectionDate, pageNo, pageSize, customerName, collector, Location, verified, EntryTypeList);
            var collectorExcelList = collectorList.Select(x => new ExcelViewModel.CollectorExcelViewModel()
            {
                CustomerNo     = x.CustomerNo,
                Subsno         = x.Subsno,
                CustomerName   = x.CustomerName,
                CustomerType   = x.CustomerType,
                LocationName   = x.LocationName,
                CollectionAmt  = x.CollectionAmt,
                CollectionDate = x.CollectionDate,
                CollectorName  = x.CollectorName,
                DiscountAmt    = x.DiscountAmt,
                CollectionTYpe = x.CollectionType
            }).ToList();

            string[] columns         = { "Customer No", "Subscription No.", "Customer Name", "Customer Type", "Location Name", "Collector Name", "Collection Date", "Collection Amount", "Discount Amount", "CollectionType" };
            string[] parameterSearch = { "Customer Name.:  " + customerName, "Collector.:  " + collector, "Collection Date:  " + collectionDate, "Location:  " + Location, "Status:  " + statustext, "CollectionType :" + EntryTypeList };
            byte[]   fileContent     = ExcelExportHelper.ExportExcel(collectorExcelList, parameterSearch, null, "Collector Report", columns);
            return(File(fileContent, ExcelExportHelper.ExcelContentType, "Collector  Report.xlsx"));
        }