public ActionResult DeleteConfirmed(int id) { OutgoingClothes outgoingClothes = db.OutgoingClothes.Find(id); db.OutgoingClothes.Remove(outgoingClothes); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ClothesID,ClothingType,ClothingAmount,Size")] OutgoingClothes outgoingClothes) { if (ModelState.IsValid) { db.Entry(outgoingClothes).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(outgoingClothes)); }
public ActionResult Create([Bind(Include = "ClothesID,ClothingType,ClothingAmount,Size")] OutgoingClothes outgoingClothes) { if (ModelState.IsValid) { db.OutgoingClothes.Add(outgoingClothes); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(outgoingClothes)); }
// GET: OutgoingClothes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } OutgoingClothes outgoingClothes = db.OutgoingClothes.Find(id); if (outgoingClothes == null) { return(HttpNotFound()); } return(View(outgoingClothes)); }
public ActionResult OutGoing([Bind(Include = "ClothesID,ClothingType,ClothingAmount,Size")] Clothes clothes, OutgoingClothes outclothes) { var query = (from c in db.Clothes where c.ClothesID == clothes.ClothesID select new { c.ClothingAmount }).Single(); double check = query.ClothingAmount; if (ModelState.IsValid) { db.OutgoingClothes.Add(outclothes); clothes.ClothingAmount = check - clothes.ClothingAmount; db.Entry(clothes).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(clothes)); }