Exemplo n.º 1
0
        public virtual IActionResult ReportContractUnfinish()
        {
            var model = new ReportContractUnfinishSearchModel();

            model.ConstructionIds = ConstructionNameddl();
            model.time            = DateTime.Now;
            return(View(model));
        }
Exemplo n.º 2
0
        public virtual IActionResult _ReportContractUnfinish(ReportContractUnfinishSearchModel searchModel)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageConstruction))
            {
                return(AccessDeniedKendoGridJson());
            }

            var query = _reportService.GetReportContractUnfinishes(
                ConstructionIds: searchModel.SelectedConstructionIds,
                time: searchModel.time);

            return(PartialView(query));
        }
Exemplo n.º 3
0
 public virtual IActionResult ExportReportContractUnfinish(ReportContractUnfinishSearchModel searchModel)
 {
     if (!string.IsNullOrEmpty(searchModel.stringConstructionIds))
     {
         var lstConstruction = searchModel.stringConstructionIds.Split(',').ToList();
         searchModel.SelectedConstructionIds = lstConstruction.Select(c => (int)c.ToNumber()).ToList();
     }
     try
     {
         var    report = _reportService.GetReportContractUnfinishes(ConstructionIds: searchModel.SelectedConstructionIds, time: searchModel.time);
         byte[] bytes;
         using (var stream = new MemoryStream())
         {
             _exportManager.ExportContractUnfinish(report, stream, Convert.ToDateTime(searchModel.time));
             bytes = stream.ToArray();
         }
         return(File(bytes, MimeTypes.TextXlsx, "BaoCaoSLDoDang.xlsx"));
     }
     catch (Exception exc)
     {
         ErrorNotification(exc);
         return(RedirectToAction("List"));
     }
 }