public static int AssignEngineer() { string selectedDayString = DateTime.Now.ToString("MM/dd/yyyy"); if (!string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["selectedDayString"])) { selectedDayString = HttpContext.Current.Request.QueryString["selectedDayString"].ToString(); } ScheduleController controller = new ScheduleController(); DateTime selectedDay = DateTime.Parse(selectedDayString); return(controller.AssignEngineer(selectedDay)); }