public ActionResult RemoveLine(Guid id, string date, FormCollection form) { Models.TimeBlock timeBlock = new Models.TimeBlock(id); if (timeBlock.UserId != User.Identity.Name) return View(); timeBlock.Delete(); return RedirectToAction("TimesheetList", new { date = date }); }
public ActionResult AddLine(string date, FormCollection form) { Models.TimeBlock timeBlock = new Models.TimeBlock(); timeBlock.TimeBlockId = Guid.NewGuid(); timeBlock.UserId = User.Identity.Name; timeBlock.JobId = form["workPackage"]; timeBlock.Date = ParseDate(date) ?? DateTime.Now.Date; timeBlock.Time = Decimal.Parse(form["hours"]); timeBlock.Comment = form["Comment"]; timeBlock.Save(); return RedirectToAction("TimesheetList", new { date = date }); }