Example #1
0
        public ActionResult ReportServiceDay(ReportServiceDayViewModel 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 ReportServiceDay();
            model.Report.Repairs = ReportManager.ReportServiceDay(model.DateStart, model.DateEnd);


            //DateTime DateStart;
            //if (DateTime.TryParse(Request.Form["DateStart"], out DateStart))
            //{
            //    model.DateStart = DateStart.AddYears(-543);
            //    model.Report = new ReportServiceDay();
            //    model.Report.Repairs = ReportManager.ReportServiceDay(DateStart);
            //    ViewBag.ReportHeader = String.Format("รายงานสรุปความเคลื่อนไหวของฟร้อนต์ประจำวันที่ {0}", DateExtension.DateThaiFormat(model.DateStart));
            //}
            ViewBag.ReportHeader = String.Format("รายงานสรุปความเคลื่อนไหวของฟร้อนต์ประจำวันที่ {0}", DateExtension.DateThaiFormat(model.DateStart));
            return(View(model));
        }
        //รายงานคสามเคลื่อนไหวประจำวัน
        public ActionResult ReportServiceDay()
        {
            ViewBag.ReportList = "first active";

            ReportServiceDayViewModel model = new ReportServiceDayViewModel();
            model.Report = new ReportServiceDay();

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

            model.Report.Repairs = ReportManager.ReportServiceDay(start);
            ViewBag.ReportHeader = String.Format("รายงานสรุปความเคลื่อนไหวของฟร้อนต์ประจำวันที่ {0}", DateExtension.DateThaiFormat(start));
            return View(model);
        }