public ActionResult DeleteConfirmed(string id) { GoldKrt goldKrt = db.GoldKrts.Find(id); db.GoldKrts.Remove(goldKrt); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "GoldTypeId,GoldCrt,GoldThumbnail")] GoldKrt goldKrt) { if (ModelState.IsValid) { db.Entry(goldKrt).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(goldKrt)); }
public ActionResult Create([Bind(Include = "GoldTypeId,GoldCrt,GoldThumbnail")] GoldKrt goldKrt) { goldKrt.GoldTypeId = "gold" + Guid.NewGuid().ToString().GetHashCode().ToString("x"); if (ModelState.IsValid) { db.GoldKrts.Add(goldKrt); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(goldKrt)); }
// GET: Admin/GoldKrts/Delete/5 public ActionResult Delete(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } GoldKrt goldKrt = db.GoldKrts.Find(id); if (goldKrt == null) { return(HttpNotFound()); } return(View(goldKrt)); }