public ActionResult AddAssignment(Agent agent, Assignment assin) { AssignmentRepo assign = new AssignmentRepo(); assign.Add(assin, agent); return(Redirect("/")); }
public ActionResult CekEmail(string email = "") { bool hasil = AssignmentRepo.cekEmail(email) == null; return(Json(new { success = hasil }, JsonRequestBehavior.AllowGet)); }
public ActionResult Edit(long id) { AssignmentViewModel assignment = new AssignmentViewModel(); assignment = AssignmentRepo.ById(id); ViewBag.tanggalmulai = assignment.start_date.ToString("yyyy'-'MM'-'dd"); ViewBag.tanggalselesai = assignment.end_date.ToString("yyyy'-'MM'-'dd"); ViewBag.BiodataList = new SelectList(MonitoringRepo.ByNameBiodataforEdit(assignment.biodata_id), "id", "name"); return(PartialView("_Edit", assignment)); }
public ActionResult Hold(AssignmentViewModel model) { ResponResultViewModel result = AssignmentRepo.CreateHold(model); return(Json(new { success = result.Success, message = result.Message, entity = result.Entity }, JsonRequestBehavior.AllowGet)); }
public ActionResult Delete(AssignmentViewModel model) { ResponseResult result = AssignmentRepo.Delete(model); return(Json(new { success = result.Success, message = result.ErrorMessage, entity = result.Entity }, JsonRequestBehavior.AllowGet)); }
public ActionResult Search(DateTime search = default(DateTime)) { ViewBag.tanggalharini = DateTime.Now.ToString("yyyy'-'MM'-'dd"); List <AssignmentViewModel> Assignment = new List <AssignmentViewModel>( AssignmentRepo.Search(search) ); foreach (var item in Assignment) { item.TanggalMulai = item.start_date.ToString("dd'-'MM'-'yyyy"); item.TanggalSelesai = item.end_date.ToString("dd'-'MM'-'yyyy"); } return(PartialView("_Search", Assignment)); }
public bool AssignedHomework(AssignedHomework objModelClass) { bool isAssigned = false; try { if (HwAdded) { isAssigned = new AssignmentRepo().AddAssignment(new Assignment { HomeWorkID = objModelClass.HomeworkID, CourseID = objModelClass.CourseID, TeacherID = objModelClass.TeacherID }); } } catch { throw; } return(isAssigned); }
public List <ExtendedHomeworkPlan> GetExtendedHomeworkPlan(int id) { try { List <Assignment> assignments = new AssignmentRepo().GetAllAssignments(); List <Homework> homeworks = new HomeworkRepo().GetAllHomework(); List <HomeworkPlan> homeworkPlans = new HomeworkPlanRepo().GetHomeworkPlans() .Where(homeworkPlan => homeworkPlan.StudentID == id).ToList(); var result = from plan in homeworkPlans join homework in homeworks on plan.HomeworkID equals homework.HomeworkID select new ExtendedHomeworkPlan { StudentID = id, HomeworkID = homework.HomeworkID, Description = homework.Description, Deadline = homework.Deadline, ReqTime = homework.ReqTime, PriorityLevel = plan.PriorityLevel, isCompleted = plan.isCompleted }; if (result.Any()) { return(result.ToList()); } else { throw new PrometheusException("No Plans Found!"); //DeviseHomeworkPlanByDeadline(id); } } catch (Exception) { throw; } }
public List <AssignedHomework> GetAssignedHomework(int id) { try { List <EnrolledCourse> enrolledCourses = GetCoursesByStudentID(id); List <Assignment> assignments = new AssignmentRepo().GetAllAssignments(); List <Homework> homeworks = new HomeworkRepo().GetAllHomework(); var result = from course in enrolledCourses join assignment in assignments on course.CourseID equals assignment.CourseID join homework in homeworks on assignment.HomeWorkID equals homework.HomeworkID select new AssignedHomework { AssignmentID = assignment.AssignmentID, Description = homework.Description, Deadline = homework.Deadline, ReqTime = homework.ReqTime, LongDescription = homework.LongDescription, CourseName = course.Name, HomeworkID = homework.HomeworkID }; if (result.Any()) { return(result.ToList()); } else { throw new PrometheusException("No Assignments Found !"); } } catch (Exception) { throw; } }
public ActionResult Delete(int id) { return(PartialView("_IsDelete", AssignmentRepo.GetAssignment(id))); }
public ActionResult Hold(int id) { return(PartialView("_Hold", AssignmentRepo.GetAssignment(id))); }
public ActionResult MarkAsDone(int id) { return(PartialView("_MarkAsDone", AssignmentRepo.GetAssignment(id))); }
public ActionResult Edit(int id) { ViewBag.Biodatalist = new SelectList(BiodataRepo.All(""), "id", "name"); return(PartialView("_Edit", AssignmentRepo.GetAssignment(id))); }
// GET: Assignment public ActionResult Index() { return(View(AssignmentRepo.All(""))); }
public ActionResult Delete(long id) { return(PartialView("_Delete", AssignmentRepo.ById(id))); }
public ActionResult Hold(long id) { return(PartialView("_Hold", AssignmentRepo.ById(id))); }
public AssignmentsController() { assignmentRepo = unit.AssignmentRepo(); }
public ActionResult List(string search) { return(PartialView("_List", AssignmentRepo.All(search))); }