public static void Sua(int id, nhasanxuat nsx) { var db = new PhucMobileConnectionDB(); nsx.MaNSX = id; db.Update("nhasanxuat", "MaNSX", nsx); }
public ActionResult Edit(int id, nhasanxuat nsx) { //try //{ // // TODO: Add update logic here // return RedirectToAction("Index"); //} //catch //{ // return View(); //} if (HttpContext.Request.Files.Count > 0) { var hpf = HttpContext.Request.Files[0]; if (hpf.ContentLength > 0) { string fileName = Guid.NewGuid().ToString(); string fullPathWithFileName = "~/images/home/" + fileName + ".jpg"; hpf.SaveAs(Server.MapPath(fullPathWithFileName)); nsx.LoGoURL = fileName + ".jpg"; } } QLNhaSanXuatbus.EditNhaSanXuat(id, nsx); return(RedirectToAction("Index")); }
public ActionResult DeleteConfirmed(int id) { nhasanxuat nhasanxuat = db.nhasanxuat.Find(id); db.nhasanxuat.Remove(nhasanxuat); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "manhasanxuat,tennhasanxuat,diachinhasanxuat")] nhasanxuat nhasanxuat) { if (ModelState.IsValid) { db.Entry(nhasanxuat).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(nhasanxuat)); }
public ActionResult Create([Bind(Include = "manhasanxuat,tennhasanxuat,diachinhasanxuat")] nhasanxuat nhasanxuat) { if (ModelState.IsValid) { db.nhasanxuat.Add(nhasanxuat); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(nhasanxuat)); }
// GET: Areas/Nhasanxuat/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } nhasanxuat nhasanxuat = db.nhasanxuat.Find(id); if (nhasanxuat == null) { return(HttpNotFound()); } return(View(nhasanxuat)); }
public ActionResult Create(nhasanxuat nsx) { if (HttpContext.Request.Files.Count > 0) { var hpf = HttpContext.Request.Files[0]; if (hpf.ContentLength > 0) { string fileName = Guid.NewGuid().ToString(); string fullPathWithFileName = "~/images/home/" + fileName + ".jpg"; hpf.SaveAs(Server.MapPath(fullPathWithFileName)); nsx.LoGoURL = fileName + ".jpg"; } } QLNhaSanXuatbus.ThemNhaSanXuat(nsx); return(RedirectToAction("Index")); }
public ActionResult Edit(int id, nhasanxuat nsx) { BrandBus.Sua(id, nsx); return(RedirectToAction("Index")); }
public ActionResult Create(nhasanxuat nsx) { nsx.bixoa = 0; BrandBus.Them(nsx); return(RedirectToAction("Index")); }
public static void EditNhaSanXuat(int id, nhasanxuat nsx) { var db = new BabyShopConnectionDB(); db.Update <nhasanxuat>("SET TenNhaSanXuat=@0, LoGoURL=@1, BiXoa=@2 where MaNhaSanXuat=@3", nsx.TenNhaSanXuat, nsx.LoGoURL, nsx.BiXoa, id); }
public static void ThemNhaSanXuat(nhasanxuat nsx) { var db = new BabyShopConnectionDB(); db.Insert(nsx); }
public static void Them(nhasanxuat nsx) { var db = new PhucMobileConnectionDB(); db.Insert(nsx); }