public ActionResult Details(Item item, string sex, string type) { using (InternetStoreContext db = new InternetStoreContext()) { if (type == "одежда") { item.ClothingType = ClothingType.Cloth; } else { item.ClothingType = ClothingType.Shoes; } if (sex == "мужское") { item.Sex = Sex.Male; } else if (sex == "женское") { item.Sex = Sex.Female; } else { item.Sex = Sex.Unisex; } db.Items.Attach(item); db.Entry(item).State = EntityState.Modified; db.SaveChanges(); } return(RedirectToAction("Index")); }
public ActionResult Edit(Purchase p) { db.Entry(p).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); }