public ActionResult Edit(VolumeOfExportsOfGoodsAndService v) { if (ModelState.IsValid) { DB.Entry(v).State = EntityState.Modified; DB.SaveChanges(); TempData["msg"] = "تمت عملية التعديل بنجاح"; return(RedirectToAction("Index")); } return(PartialView(v)); }
public ActionResult Create(VolumeOfExportsOfGoodsAndService v) { if (ModelState.IsValid) { DB.VolumeOfExportsOfGoodsAndServices.Add(v); DB.SaveChanges(); TempData["msg"] = "تمت عملية الاضافة بنجاح"; return(RedirectToAction("Index")); } return(PartialView(v)); }
public ActionResult Details(int id) { VolumeOfExportsOfGoodsAndService ws = DB.VolumeOfExportsOfGoodsAndServices.FirstOrDefault(x => x.ExportOfGoodsServicesID == id); if (ws != null) { return(PartialView(ws)); } TempData["msg"] = "خطأ "; return(RedirectToAction("Index")); }
public ActionResult Delete(int id) { VolumeOfExportsOfGoodsAndService ws = DB.VolumeOfExportsOfGoodsAndServices.FirstOrDefault(x => x.ExportOfGoodsServicesID == id); if (ws != null) { DB.VolumeOfExportsOfGoodsAndServices.Remove(ws); DB.SaveChanges(); TempData["msg"] = "تمت عملية الحذف بنجاح"; return(RedirectToAction("Index")); } TempData["msg"] = "خطأ "; return(RedirectToAction("Index")); }
public ActionResult Edit(int id) { VolumeOfExportsOfGoodsAndService ws = DB.VolumeOfExportsOfGoodsAndServices.FirstOrDefault(x => x.ExportOfGoodsServicesID == id); if (ws != null) { ViewBag.AllYear = new SelectList(DB.Years.Select(e => new { e.YearId, e.YearN }), "YearId", "YearN"); ViewBag.AllCountry = new SelectList(DB.Countries.Select(e => new { e.CountryId, e.CountryArName }), "CountryId", "CountryArName"); ViewBag.AllSubject = new SelectList(DB.subjects.Select(e => new { e.SubjectId, e.subject1 }), "SubjectId", "subject1"); ViewBag.AllUnity = new SelectList(DB.Unities.Select(e => new { e.UnityID, e.Unity1 }), "UnityID", "Unity1"); return(PartialView(ws)); } TempData["msg"] = "خطأ "; return(RedirectToAction("Index")); }