Esempio n. 1
0
 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));
 }
Esempio n. 2
0
 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));
 }
Esempio n. 3
0
        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"));
        }
Esempio n. 4
0
        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"));
        }
Esempio n. 5
0
        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"));
        }