// GET: LMSTasks/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } LMSTask lMSTask = await db.LMSTasks.FindAsync(id); ViewBag.Matter = new SelectList(db.GetAllMattersForDropDown(), "Id", "Subject"); ViewBag.Staff = new SelectList(db.GetAllStaffForDropDown(), "StaffId", "StaffName"); ViewBag.Priority = new List <SelectListItem> { new SelectListItem { Value = "Critical", Text = "Critical" }, new SelectListItem { Value = "High", Text = "High" }, new SelectListItem { Value = "Medium", Text = "Medium" }, new SelectListItem { Value = "Low", Text = "Low" } }; if (lMSTask == null) { return(HttpNotFound()); } return(View(lMSTask)); }
public async Task <ActionResult> Create([Bind(Include = "Id,TaskType,Description,MatterNumber,NotifyDays,CreatedBy,CreatedOn,ModifiedBy,ModifiedOn,Priority,Reporter,Assignee,DueDate")] LMSTask lMSTask) { if (ModelState.IsValid) { try { var user = User.Identity.Name; lMSTask.CreatedBy = user; lMSTask.CreatedOn = DateTime.Today; db.LMSTasks.Add(lMSTask); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } catch (Exception) { ViewBag.Error = "Can't Add Task, Error Occured. Please Contact IT Department."; } } else { ViewBag.Error = "Fill in the required fields to continue"; ViewBag.Matter = new SelectList(db.GetAllMattersForDropDown(), "Id", "Subject"); ViewBag.Staff = new SelectList(db.GetAllStaffForDropDown(), "StaffId", "StaffName"); ViewBag.Priority = new List <SelectListItem> { new SelectListItem { Value = "Critical", Text = "Critical" }, new SelectListItem { Value = "High", Text = "High" }, new SelectListItem { Value = "Medium", Text = "Medium" }, new SelectListItem { Value = "Low", Text = "Low" } }; return(View(lMSTask)); } ViewBag.Matter = new SelectList(db.GetAllMattersForDropDown(), "Id", "Subject"); ViewBag.Staff = new SelectList(db.GetAllStaffForDropDown(), "StaffId", "StaffName"); ViewBag.Priority = new List <SelectListItem> { new SelectListItem { Value = "Critical", Text = "Critical" }, new SelectListItem { Value = "High", Text = "High" }, new SelectListItem { Value = "Medium", Text = "Medium" }, new SelectListItem { Value = "Low", Text = "Low" } }; return(View(lMSTask)); }
public async Task <ActionResult> DeleteConfirmed(int id) { LMSTask lMSTask = await db.LMSTasks.FindAsync(id); db.LMSTasks.Remove(lMSTask); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
// GET: LMSTasks/Details/5 public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } LMSTask lMSTask = await db.LMSTasks.FindAsync(id); if (lMSTask == null) { return(HttpNotFound()); } return(View(lMSTask)); }
static IEnumerator eRunTaskLater(int secs, LMSTask t) { yield return(new WaitForSeconds(secs)); t.Invoke(); }
public static void RunTaskLater(int Secs, LMSTask del, MonoBehaviour owner) { owner.StartCoroutine(eRunTaskLater(Secs, del)); }