public ActionResult GetListExpertsByCoursesId(Guid?coursesId) { ViewBag.coursesId = coursesId; var list = new ExpertsDetailtBCL().GetJoin().Where(x => x.CoId.Equals(coursesId)).ToList(); return(PartialView(list)); }
// GET: ExpertsDetailt/Edit/5 public ActionResult Edit(Guid id, int IsOption = 0) { var ob = new ExpertsDetailtBCL().GetByExId(id); ob.CoursesJoin = new CoursesBCL().GetByCoId((Guid)ob.CoId); ob.ExpertsJoin = new ExpertsBCL().GetByExpertId((Guid)ob.ExpertId); ViewBag.IsOption = IsOption; return(View(ob)); }
public List <SchedulersObjects> GetScheduler(Guid ID_Expert) { List <SchedulersObjects> lst = new List <SchedulersObjects>(); var listExpertDetail = new ExpertsDetailtBCL().GetJoin().Where(q => q.ExpertId == ID_Expert); var listSchedeler = new SchedulersBCL().GetJoin(); foreach (var expd in listExpertDetail) { lst.AddRange(listSchedeler.Where(q => q.CoursesJoin.Status == false && q.CoId == expd.CoursesJoin.CoId)); } return(lst); }
public ActionResult Index(FormCollection f) { var result = new List <ExpertsDetailtObjects>(); Guid ID_Expert = new Guid(); Guid ID_Course = new Guid(); if (Guid.TryParse(f["Course"].ToString(), out ID_Course)) { ViewBag.Course = ID_Course; result = new ExpertsDetailtBCL().GetByCoId(ID_Course); } else { result = new ExpertsDetailtBCL().GetJoin(); } if (Guid.TryParse(f["Expert"].ToString(), out ID_Expert)) { ViewBag.Expert = ID_Expert; result = result.Where(q => q.ExpertId == ID_Expert).ToList(); } return(View(result)); }
// GET: Weekday public ActionResult Index() { var list = new CoursesBCL().GetAll().Where(x => x.Status == false); var user = new Models.Login().GetAccount(); if (user == null) { return(RedirectToAction("Index", "Login")); } if (user.RoleId.Equals(new Guid("ADAE8847-5B4D-43FC-A761-038B315D7651"))) { var listExpertsDetailt = new ExpertsDetailtBCL().GetAll() .Where(x => x.ExpertId.GetValueOrDefault().Equals(user.UserId)) .ToList(); var listJoin = from item in list join r in listExpertsDetailt on item.CoId equals r.CoId select item; return(View(listJoin)); } return(View(list)); }
public PartialViewResult search(Guid?id_gv = null, Guid?id_lop = null, bool status = false, DateTime?start = null, DateTime?end = null) { var data = new ExpertsDetailtBCL().GetJoin().Where(q => q.CoursesJoin.Status == status); if (id_gv.HasValue) { data = data.Where(q => q.ExpertsJoin.ExpertId == id_gv); } if (id_lop.HasValue) { data = data.Where(q => q.CoursesJoin.CoId == id_lop); } if (start.HasValue) { data = data.Where(q => q.CoursesJoin.StartDate >= start.Value); } if (end.HasValue) { data = data.Where(q => q.CoursesJoin.EndDate <= end.Value); } data = data.OrderBy(w => w.ExpertsJoin.Status); return(PartialView("pv_ChiTietGiaoVien", data)); }
// GET: Weekday/Create] public ActionResult anlyzeUser_byTime(DateTime?start, DateTime?end, bool?Status) { var user = new Models.Login().GetAccount(); if (start == null || end == null) { if (user.RoleId.Equals(new Guid("ADAE8847-5B4D-43FC-A761-038B315D7651"))) { if (Status == false) { ViewBag.test = false; var data = new CoursesBCL().GetAll().Where(x => x.Status == false).ToList(); var listExpertsDetailt = new ExpertsDetailtBCL().GetAll() .Where(x => x.ExpertId.GetValueOrDefault().Equals(user.UserId)) .ToList(); var listJoin = from item in data join r in listExpertsDetailt on item.CoId equals r.CoId select item; return(View("Index", listJoin)); } else { ViewBag.test = true; var data = new CoursesBCL().GetAll().Where(x => x.Status == true).ToList(); var listExpertsDetailt = new ExpertsDetailtBCL().GetAll() .Where(x => x.ExpertId.GetValueOrDefault().Equals(user.UserId)) .ToList(); var listJoin = from item in data join r in listExpertsDetailt on item.CoId equals r.CoId select item; return(View("Index", listJoin)); } } else { if (Status == false) { ViewBag.test = false; var data = new CoursesBCL().GetAll().Where(x => x.Status == false).ToList(); return(View("Index", data)); } else { ViewBag.test = true; return(View("Index", new CoursesBCL().GetAll().Where(x => x.Status == true))); } } } else { if (Status == false) { return(View("Index", new CoursesBCL().GetAll().Where(x => x.Status == false && x.StartDate >= start && x.EndDate <= end))); } else { ViewBag.test = true; return(View("Index", new CoursesBCL().GetAll().Where(x => x.Status == true && x.StartDate >= start && x.EndDate <= end))); } } }