public ActionResult Edit(Country_CreditRatingAgency Country_CreditRatingAgency) { if (ModelState.IsValid) { DB.Entry(Country_CreditRatingAgency).State = EntityState.Modified; DB.SaveChanges(); TempData["msg"] = "تمت عملية التعديل بنجاح"; return(RedirectToAction("Index")); } return(PartialView(Country_CreditRatingAgency)); }
public ActionResult Create(Country_CreditRatingAgency Country_CreditRatingAgency) { if (ModelState.IsValid) { DB.Country_CreditRatingAgency.Add(Country_CreditRatingAgency); DB.SaveChanges(); TempData["msg"] = "تمت عملية الاضافة بنجاح"; return(RedirectToAction("Index")); } return(PartialView(Country_CreditRatingAgency)); }
public ActionResult Details(int id, int AgencyId) { Country_CreditRatingAgency ws = DB.Country_CreditRatingAgency.FirstOrDefault(x => x.CountryId == id && x.AgencyId == AgencyId); if (ws != null) { return(PartialView(ws)); } TempData["msg"] = "خطأ "; return(RedirectToAction("Index")); }
public ActionResult Edit(int id, int AgencyId) { Country_CreditRatingAgency ws = DB.Country_CreditRatingAgency.FirstOrDefault(x => x.CountryId == id && x.AgencyId == AgencyId); if (ws != null) { ViewBag.AllCountry = new SelectList(DB.Countries.Select(e => new { e.CountryId, e.CountryArName }), "CountryId", "CountryArName"); ViewBag.AllAgency = new SelectList(DB.CridetRatingAgencies.Select(e => new { e.AgencyId, e.AgencyArName }), "AgencyId", "AgencyArName"); return(PartialView(ws)); } TempData["msg"] = "خطأ "; return(RedirectToAction("Index")); }
public ActionResult Delete(int id, int AgencyId) { Country_CreditRatingAgency ws = DB.Country_CreditRatingAgency.FirstOrDefault(x => x.CountryId == id && x.AgencyId == AgencyId); if (ws != null) { DB.Country_CreditRatingAgency.Remove(ws); DB.SaveChanges(); TempData["msg"] = "تمت عملية الحذف بنجاح"; return(RedirectToAction("Index")); } TempData["msg"] = "خطأ "; return(RedirectToAction("Index")); }