Example #1
0
        public PartialViewResult FilterCCF(RptCCFModel model)
        {
            model.RptCCFItem = GetCCFData(model.SearchView);
            var input = Mapper.Map <RptCCFInput>(model.SearchView);

            return(PartialView("_ListCcf", model));
        }
Example #2
0
        public void ExportCCF(RptCCFModel model)
        {
            string pathFile = "";

            var input = Mapper.Map <RptCCFInput>(model.SearchViewExport);

            pathFile = CreateXlsRptCCF(input);

            var newFile = new FileInfo(pathFile);

            var fileName = Path.GetFileName(pathFile);

            string attachment = string.Format("attachment; filename={0}", fileName);

            Response.Clear();
            Response.AddHeader("content-disposition", attachment);
            Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
            Response.WriteFile(newFile.FullName);
            Response.Flush();
            newFile.Delete();
            Response.End();
        }
Example #3
0
        public ActionResult Index()
        {
            var model = new RptCCFModel();
            var input = Mapper.Map <RptCCFInput>(model.SearchView);
            var data  = _rptCcfBLL.GetRptCcf(input);

            model.MainMenu     = _mainMenu;
            model.TitleForm    = "CCF Report";
            model.TitleExport  = "ExportCCF";
            model.CurrentLogin = CurrentUser;
            var settingData = _settingBLL.GetSetting();

            model.RptCCFItem = Mapper.Map <List <RptCCFItem> >(data);

            var listCategory    = _rptComplaintBLL.GetComplaints().Select(x => new { x.MstComplaintCategoryId, x.CategoryName }).Distinct().OrderBy(x => x.MstComplaintCategoryId).ToList();
            var listCoordinator = _rptCcfBLL.GetRptCcfData().Select(x => new { x.CoordinatorName }).Distinct().OrderBy(x => x.CoordinatorName).ToList();
            var listLocation    = _rptCcfBLL.GetRptCcfData().Select(x => new { x.LocationCity }).Distinct().OrderBy(x => x.LocationCity).ToList();

            model.SearchView.Categorylist    = new SelectList(listCategory, "MstComplaintCategoryId", "CategoryName");
            model.SearchView.Coordinatorlist = new SelectList(listCoordinator, "CoordinatorName", "CoordinatorName");
            model.SearchView.Locationlist    = new SelectList(listLocation, "LocationCity", "LocationCity");

            return(View(model));
        }