//สรุปรายการซ่อมประจำวัน
        public ActionResult ReportDay()
        {
            ViewBag.ReportList = "first active";

            ReportDayViewModel model = new ReportDayViewModel();
            model.Report = new ReportDay();

            DateTime start = DateTime.Today;
            model.DateStart = start.AddYears(543);

            DateTime end = DateTime.Today.AddDays(1);
            model.DateEnd = Convert.ToDateTime(end.AddYears(543).ToString("MM/dd/yyyy"));


            model.Report.Repairs = ReportManager.ReportRepairDay(start);
            model.Report.Claims = ReportManager.ReportClaimDay(start);
            
            var workingstatus = WorkingStatusManager.GetAll().Where(m => m.iDefault>=5 && m.iDefault<=7);
            model.Report.WorkingStatuies = workingstatus.OrderBy(m => m.iDefault).ToList();
            model.Report.Insurances = InsuranceManager.GetAll().OrderBy(m => m.sInsuranceName).ToList();
            model.Report.TCStaffs = StaffManager.GetAll().Where(m => m.StaffPosition.sDescription == "ช่าง").OrderBy(m => m.sStaffName).ToList();
            model.Report.STCStaffs = StaffManager.GetAll().Where(m => m.StaffPosition.sDescription == "หัวหน้าช่าง").OrderBy(m => m.sStaffName).ToList();
            model.Report.QCStaffs = StaffManager.GetAll().Where(m => m.StaffPosition.sDescription == "ฝ่ายตรวจสอบคุณภาพ").OrderBy(m => m.sStaffName).ToList();

            ViewBag.ReportHeader = String.Format("รายงานบริการประจำวันที่ {0}", DateExtension.DateThaiFormat(start));
            return View(model);
        }
        public ActionResult ReportMonth(ReportMonthViewModel model, FormCollection collection)
        {
            ViewBag.ReportList = "first active";

            DateTime start = model.DateStart;
            model.DateStart = start.AddYears(-543);

            DateTime end = model.DateEnd;
            model.DateEnd = end.AddYears(-543);

            model.Report = new ReportMonth();
            model.Report.Repairs = ReportManager.ReportRepairMonth(model.DateStart, model.DateEnd);
            
            model.Insurances = InsuranceManager.GetAll().OrderBy(m => m.sInsuranceName).ToList();
            ViewBag.ReportHeader = String.Format("สรุปบริการประจำเดือน {0}", DateExtension.DateThaiFormat2(model.DateStart));
            return View(model);
        }
        //สรุปรายการซ่อมประจำเดือน
        public ActionResult ReportMonth()
        {
            ViewBag.ReportList = "first active";

            ReportMonthViewModel model = new ReportMonthViewModel();
            model.Report = new ReportMonth();

            DateTime start = DateExtension.FirstDayOfMonthFromDateTime(DateTime.Now);
            model.DateStart = Convert.ToDateTime(start.AddYears(543).ToString("MM/dd/yyyy"));

            DateTime end = DateExtension.LastDayOfMonthFromDateTime(DateTime.Now);
            model.DateEnd = Convert.ToDateTime(end.AddYears(543).ToString("MM/dd/yyyy"));

            model.Report.Repairs = ReportManager.ReportRepairMonth(start, end);
            //model.Report.Claims = ReportManager.ReportClaim(start, end);

            model.Insurances = InsuranceManager.GetAll().OrderBy(m => m.sInsuranceName).ToList();
            ViewBag.ReportHeader = String.Format("สรุปบริการประจำเดือน {0}", DateExtension.DateThaiFormat2(start));
            return View(model);
        }
Пример #4
0
        public IActionResult GetAll()
        {
            var result = _insuranceManager.GetAll();

            return(Ok(result));
        }