public ActionResult Suaxx(XUATXU xx, FormCollection col) { XUATXU nhaxx = data.XUATXUs.SingleOrDefault(n => n.MaXXu == xx.MaXXu); nhaxx.TenXXu = col["TenXX"]; UpdateModel(nhaxx); data.SubmitChanges(); return(RedirectToAction("Nhaxuatxu")); }
public ActionResult Edit([Bind(Include = "MaXX,TenXX")] XUATXU xuatxu) { if (ModelState.IsValid) { db.Entry(xuatxu).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(xuatxu)); }
public ActionResult themmoinxx(XUATXU xx, FormCollection collection) { var tennxx = collection["TenXXu"]; xx.TenXXu = tennxx; data.XUATXUs.InsertOnSubmit(xx); data.SubmitChanges(); return(RedirectToAction("Nhaxuatxu", "Admin")); }
public ActionResult Create([Bind(Include = "MaXX,TenXX")] XUATXU xuatxu) { if (ModelState.IsValid) { db.XUATXUs.Add(xuatxu); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(xuatxu)); }
// GET: /Admin/QLXuatXu/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } XUATXU xuatxu = db.XUATXUs.Find(id); if (xuatxu == null) { return(HttpNotFound()); } return(View(xuatxu)); }
public ActionResult Xacnhanxoanxx(int id) { XUATXU nhaxuatxu = data.XUATXUs.SingleOrDefault(n => n.MaXXu == id); ViewBag.MaXXu = nhaxuatxu.MaXXu; if (nhaxuatxu == null) { Response.StatusCode = 404; return(null); } data.XUATXUs.DeleteOnSubmit(nhaxuatxu); data.SubmitChanges(); return(RedirectToAction("Nhaxuatxu", "Admin")); }
public ActionResult Suaxx(int id) { if (Session["Taikhoanadmin"] == null || Session["Taikhoanadmin"].ToString() == "") { return(RedirectToAction("Login")); } XUATXU xx = data.XUATXUs.SingleOrDefault(n => n.MaXXu == id); if (xx == null) { Response.StatusCode = 404; return(null); } return(View(xx)); }