public JsonResult AddTrackingSchedules(string dateTracking, string note, List <string> listUserId, string schedulesId, string type) { AjaxResultModel Result = new AjaxResultModel(); try { //bool check = true; if (Trackings_Service.AddTrackingSchedules(dateTracking, note, listUserId, schedulesId, type)) { Result.Code = 0; Result.Result = "Thành công"; } else { Result.Code = 1; Result.Result = "Thao tác không thành công"; } } catch (Exception Ex) { Result.Code = 1; Result.Result = "Thao tác không thành công"; IOHelper.WriteLog(StartUpPath, IpAddress, "InsertOrUpdateUser:", Ex.Message, Ex.ToString()); } return(Json(new JsonResult() { Data = Result })); }
public ActionResult TrackingDetails(string scheduledId = "", string startDate = "", string endDate = "", string userId = "") { string url = Request.RawUrl; string query = Request.Url.Query; scheduledId = Request.QueryString["scheduledId"]; List <DateTime> listDate = new List <DateTime>(); List <TB_USERS> listUser = new List <TB_USERS>(); List <TB_SCHEDULES> listSchedule = new List <TB_SCHEDULES>(); List <V_TRACKING_USER_CLASS> list = new List <V_TRACKING_USER_CLASS>(); try { listDate = GetDateTimeToMonth(startDate, endDate); listSchedule = Schedules_Service.GetAll(); list = Trackings_Service.GetTrackingUser(userId, scheduledId, startDate, endDate); listUser = User_Service.GetAllStudies(); } catch (Exception e) { ViewBag.Error = e.ToString(); } ViewBag.ListDate = listDate.OrderByDescending(x => x).ToList(); ViewBag.Schedule = listSchedule; ViewBag.User = listUser; ViewBag.Url = url; return(View(list)); }
public PartialViewResult _Tracking(string scheduleId = "", string startDate = "", string endDate = "", int pageNumber = 1, int pageSize = 10) { int count = 0; ViewBag.pageNumber = pageNumber; ViewBag.pageSize = pageSize; ViewBag.maxNumber = 0; List <V_TRACKING_USER_CLASS> list = new List <V_TRACKING_USER_CLASS>(); List <TB_USERS> listUser = new List <TB_USERS>(); List <TB_SCHEDULES> listSchedules = new List <TB_SCHEDULES>(); List <DateTime> listDate = new List <DateTime>(); List <V_TRACKING_SCHEDULE> a = new List <V_TRACKING_SCHEDULE>(); try { a = Trackings_Service.GetTotalTrackingBy(scheduleId, startDate, endDate); listDate = GetDateTimeToMonth(startDate, endDate); listUser = User_Service.GetAllStudies(); listSchedules = Schedules_Service.GetAll(); } catch (Exception e) { ViewBag.Error = e.ToString(); } ViewBag.ListDate = listDate; ViewBag.maxNumber = Math.Ceiling((double)count / pageSize); ViewBag.User = listUser; ViewBag.Schedule = listSchedules; return(PartialView(a)); }
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)); }