// GET: Follow/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TB_Follow tB_Follow = db.TB_Follow.Find(id); if (tB_Follow == null) { return(HttpNotFound()); } return(View(tB_Follow)); }
public ActionResult Create([Bind(Include = "FId,Schedule,FollowDate,LId,BId,DId")] TB_Follow Follow) { if (ModelState.IsValid) { db.TB_Follow.Add(Follow); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.BId = new SelectList(db.TB_BugSubmit, "BId", "AppName", Follow.BId); ViewBag.LId = new SelectList(db.TB_LoginOn, "LId", "LoginName", Follow.LId); ViewBag.LId = new SelectList(db.TB_LoginOn, "DId", "DLevel", Follow.LId); return(View(Follow)); }
// GET: Follow/Edit/5 public ActionResult Edit(int?id) { if (id != null) { var bid = db.TB_Schedule.FirstOrDefault(l => l.FId == id); if (bid == null) { TB_Follow tB_Follow = db.TB_Follow.Find(id); if (tB_Follow == null) { return(HttpNotFound()); } ViewBag.BId = new SelectList(db.TB_BugSubmit, "BId", "AppName", tB_Follow.BId); ViewBag.LId = new SelectList(db.TB_LoginOn, "LId", "LoginNo", tB_Follow.LId); return(View(tB_Follow)); } return(Content("<script>alert('工单正在审核中!');history.go(-1);</script>")); } return(RedirectToAction("Index", "Home")); }
public ActionResult Edit([Bind(Include = "Schedule,FollowDate,LId,BId,DId")] TB_Follow follow) { if (ModelState.IsValid) { //db.Entry(follow).State = EntityState.Modified; follow = new TB_Follow() { LId = Convert.ToInt32(Request.Params["LId"]), BId = Convert.ToInt32(Request.Params["BId"]), DId = Convert.ToInt32(Request.Params["DId"]), Schedule = Request.Params["Schedule"], FollowDate = Convert.ToDateTime(Request.Params["FollowDate"]) }; db.TB_Follow.Add(follow); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DId = new SelectList(db.TB_Difficultiy, "DId", "DLevel", follow.DId); ViewBag.LId = new SelectList(db.TB_LoginOn, "LId", "LoginNo", follow.LId); return(View()); }