public ActionResult Edit(WorldGDPPriceFixed v) { if (ModelState.IsValid) { DB.Entry(v).State = EntityState.Modified; DB.SaveChanges(); TempData["msg"] = "تمت عملية التعديل بنجاح"; return(RedirectToAction("Index")); } return(PartialView(v)); }
public ActionResult Create(WorldGDPPriceFixed v) { if (ModelState.IsValid) { DB.WorldGDPPriceFixeds.Add(v); DB.SaveChanges(); TempData["msg"] = "تمت عملية الاضافة بنجاح"; return(RedirectToAction("Index")); } return(PartialView(v)); }
public ActionResult Details(int id) { WorldGDPPriceFixed ws = DB.WorldGDPPriceFixeds.FirstOrDefault(x => x.id == id); if (ws != null) { return(PartialView(ws)); } TempData["msg"] = "خطأ "; return(RedirectToAction("Index")); }
public ActionResult Delete(int id) { WorldGDPPriceFixed ws = DB.WorldGDPPriceFixeds.FirstOrDefault(x => x.id == id); if (ws != null) { DB.WorldGDPPriceFixeds.Remove(ws); DB.SaveChanges(); TempData["msg"] = "تمت عملية الحذف بنجاح"; return(RedirectToAction("Index")); } TempData["msg"] = "خطأ "; return(RedirectToAction("Index")); }
public ActionResult Edit(int id) { WorldGDPPriceFixed ws = DB.WorldGDPPriceFixeds.FirstOrDefault(x => x.id == 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")); }