// // GET: /TimeSheetMaster/Create public ActionResult Create() { ViewBag.PersonId = new SelectList(TimesheetRepository.GetAllPersons(), "PersonId", "PersonName"); ViewBag.SupervisorId = new SelectList(TimesheetRepository.GetAllSupervisors(), "PersonId", "PersonName"); ViewBag.CompanyId = new SelectList(TimesheetRepository.GetAllCompanies(), "CompanyId", "CompanyDescription"); return(View()); }
public ActionResult Edit(LeavePlan leaveplan) { if (ModelState.IsValid) { TimesheetRepository.AddUpdateLeavePlan(leaveplan); return(RedirectToAction("Index")); } ViewBag.LeaveCategoryId = new SelectList(TimesheetRepository.GetLeaveCategories(), "LeaveCategoryId", "LeaveCategoryDesc", leaveplan.LeaveCategoryId); ViewBag.PersonId = new SelectList(TimesheetRepository.GetAllPersons(), "PersonId", "PersonName", leaveplan.PersonId); return(View(leaveplan)); }
// // GET: /LeavePlan/Edit/5 public ActionResult Edit(int id = 0) { LeavePlan leaveplan = TimesheetRepository.GetLeavePlanById(id); if (leaveplan == null) { return(HttpNotFound()); } ViewBag.LeaveCategoryId = new SelectList(TimesheetRepository.GetLeaveCategories(), "LeaveCategoryId", "LeaveCategoryDesc", leaveplan.LeaveCategoryId); ViewBag.PersonId = new SelectList(TimesheetRepository.GetAllPersons(), "PersonId", "PersonName", leaveplan.PersonId); return(View(leaveplan)); }
public ActionResult Create(TimeSheetMaster master) { if (ModelState.IsValid) { TimeSheetMaster newMaster = master; newMaster.Save(); return(RedirectToAction("Index")); } ViewBag.PersonId = new SelectList(TimesheetRepository.GetAllPersons(), "PersonId", "PersonName"); ViewBag.ManagerId = new SelectList(TimesheetRepository.GetAllSupervisors(), "PersonId", "PersonName"); ViewBag.CompanyId = new SelectList(TimesheetRepository.GetAllCompanies(), "CompanyId", "CompanyDescription"); return(View(master)); }
// // GET: /LeavePlan/Create public ActionResult Create() { ViewBag.LeaveCategoryId = new SelectList(TimesheetRepository.GetLeaveCategories(), "LeaveCategoryId", "LeaveCategoryDesc"); ViewBag.PersonId = new SelectList(TimesheetRepository.GetAllPersons(), "PersonId", "PersonName"); return(View()); }