public ActionResult EditApplyTable(Tb_ApplyTable tb_applytable) { //对于不能由用户填写的字段手动赋值 tb_applytable.RecordTime = DateTime.Now; tb_applytable.IsPass = 0; tb_applytable.UserID = int.Parse(TakeCookie.GetCookie("userId")); //判断模型状态是否验证通过 if (ModelState.IsValid) { db.Entry(tb_applytable).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("ApplySuccess"); } return RedirectToAction("ApplySuccess", "SoftDown"); }
public ActionResult ApplyTable(Tb_ApplyTable ApplyTable) { ApplyTable.RecordTime = DateTime.Today; ApplyTable.UserID = int.Parse(TakeCookie.GetCookie("userId")); ApplyTable.IsPass = 0; //ModelState.IsValid用于 if (ModelState.IsValid) { if (mHelp.Add<Tb_ApplyTable>(ApplyTable) > 0) { Session["ApplyID"] = ApplyTable.ApplyID; return RedirectToAction("SoftList", new { id = ApplyTable.ApplyID }); } else { return View(); } } return View("index"); }