public JsonResult CheckRoomClass(string roomId, string dayOfWeek, string timeFrom, string timeTo, string dayOfWeek2, string timeFrom2, string timeTo2) { AjaxResultModel Result = new AjaxResultModel(); try { if (Schedule_Detail_Service.CheckRoomClass(roomId, timeFrom, timeTo, dayOfWeek, dayOfWeek2, timeFrom2, timeTo2)) { Result.Code = 0; Result.Result = roomId; } else { Result.Code = 1; Result.Result = ""; } } catch (Exception Ex) { Result.Code = 1; Result.Result = new List <TB_USERS>(); IOHelper.WriteLog(StartUpPath, IpAddress, "InsertOrUpdateUser:", Ex.Message, Ex.ToString()); } return(Json(new JsonResult() { Data = Result })); }
public PartialViewResult _TrackingDetails(string scheduledId = "", string startDate = "", string endDate = "", string userId = "") { List <DateTime> listDate = new List <DateTime>(); List <TB_SCHEDULES> details = new List <TB_SCHEDULES>(); List <TB_USERS> listUser = new List <TB_USERS>(); List <V_TRACKING_USER_CLASS> list = new List <V_TRACKING_USER_CLASS>(); List <TB_SCHEDULE_DETAILS> listDetails = new List <TB_SCHEDULE_DETAILS>(); try { listDetails = Schedule_Detail_Service.GetByScheduleId(scheduledId); foreach (var item in listDetails) { List <DateTime> listDateTemp = new List <DateTime>(); listDateTemp = DateTimeHelper.DaysOfMonth(DateTime.Now.Year, DateTime.Now.Month, ConvertDataWithView.Convert_DayOfWeek_ToTypeDayOfWeek(item.ScheduleDetailDayOfWeek)); foreach (var date in listDateTemp) { if (listDate.Where(x => x.ToString("ddMMyyyy").Equals(date.ToString("ddMMyyyy"))).ToList().Count == 0) { listDate.Add(date); } } } //listDate = GetDateTimeToMonth(startDate, endDate); listUser = User_Service.GetAllStudies(); details = Schedules_Service.GetAll(); list = Trackings_Service.GetTrackingUser(userId, scheduledId, String.Join("", startDate.Split('/')), String.Join("", endDate.Split('/'))); } catch (Exception e) { ViewBag.Error = e.ToString(); } ViewBag.Id = scheduledId; ViewBag.User = listUser; ViewBag.Schedule = details; ViewBag.ListDate = listDate; return(PartialView(list)); }