コード例 #1
0
        //
        // 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());
        }
コード例 #2
0
 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));
 }
コード例 #3
0
        //
        // 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));
        }
コード例 #4
0
 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));
 }
コード例 #5
0
        //
        // GET: /LeavePlan/Create

        public ActionResult Create()
        {
            ViewBag.LeaveCategoryId = new SelectList(TimesheetRepository.GetLeaveCategories(), "LeaveCategoryId", "LeaveCategoryDesc");
            ViewBag.PersonId        = new SelectList(TimesheetRepository.GetAllPersons(), "PersonId", "PersonName");
            return(View());
        }