コード例 #1
0
 public ActionResult Edit(Models.Timesheet.Timesheet timesheetVm)
 {
     _tsUtil.UpdateTimesheet(timesheetVm);
     if (timesheetVm.SubmitForApproval)
     {
         _tsManager.SetState(timesheetVm.TimesheetId, TimesheetStatus.Submitted, timesheetVm.Notes);
         TempData["submitted"] = true;
         return(RedirectToAction("Details", new { id = timesheetVm.TimesheetId }));
     }
     else
     {
         TempData["saved"] = true;
         return(RedirectToAction("Edit", new { id = timesheetVm.TimesheetId }));
     }
 }
コード例 #2
0
 public ActionResult Approve(Models.Timesheet.Timesheet timesheetVm)
 {
     _tsUtil.UpdateTimesheet(timesheetVm);
     _tsManager.SetState(timesheetVm.TimesheetId, TimesheetStatus.Approved);
     return(RedirectToAction("Index"));
 }