예제 #1
0
        /// <summary>
        /// GET Hours/TimeSheet
        /// </summary>
        /// <returns>Model</returns>
        public ViewResult TimeSheet()
        {
            ModelUtility modelUtility = new ModelUtility();
            PresenterService presenterService = new PresenterService();
            DefaultTimeSheet defaultTimeSheet = presenterService.GetDefaultTimeSheet(DateTime.Now);
            ViewBag.StartHourList = modelUtility.GetSelectList(defaultTimeSheet.Hour.ToString(), defaultTimeSheet.HourList);
            ViewBag.StartMinuteList = modelUtility.GetSelectList("", defaultTimeSheet.MinuteList);
            ViewBag.StartAmPmList = modelUtility.GetSelectList("", defaultTimeSheet.AmPmList);
            ViewBag.EndHourList = modelUtility.GetSelectList("", defaultTimeSheet.HourList);
            ViewBag.EndMinuteList = modelUtility.GetSelectList("", defaultTimeSheet.MinuteList);
            ViewBag.EndAmPmList = modelUtility.GetSelectList("", defaultTimeSheet.AmPmList);

            TimeSheetModel model = new TimeSheetModel
                                       {
                                           StartHour = defaultTimeSheet.Hour,
                                           StartMinute = 1,
                                           StartAmPm = "AM",
                                           EndHour = defaultTimeSheet.Hour,
                                           EndMinute = 1,
                                           EndAmPm = "AM",
                                           StartDate = DateTime.Today,
                                           EndDate = DateTime.Today,
                                       };

            return View(model);
        }