public ActionResult WorklistEdit([Bind(Include = "TaskId, TaskName, Duration")] Task task) { if (ModelState.IsValid) { task.UserName = internUrl; _db.Entry(task).State = EntityState.Modified; _db.SaveChanges(); return(RedirectToAction("AdminIndex", new { year = yearUrl, month = monthUrl, internName = internUrl })); } return(View(task)); }
public ActionResult Create([Bind(Include = "SigninId, WorkDate, ArrivedTime, LeaveTime, UserName")] Signin signin) { if (ModelState.IsValid) { signin.UserName = System.Web.HttpContext.Current.User.Identity.Name; _db.Signin.Add(signin); _db.SaveChanges(); return(RedirectToAction("Index")); } return(View(signin)); }
public ActionResult Create([Bind(Include = "TaskName, Duration, UserName")] Task task) { if (ModelState.IsValid) { task.UserName = System.Web.HttpContext.Current.User.Identity.Name; task.Date = DateTime.Now.Date; _db.Task.Add(task); _db.SaveChanges(); return(RedirectToAction("Index", "WorkList")); } return(View(task)); }