示例#1
0
 public ActionResult Edit(WorldGDPPriceFixed v)
 {
     if (ModelState.IsValid)
     {
         DB.Entry(v).State = EntityState.Modified;
         DB.SaveChanges();
         TempData["msg"] = "تمت عملية التعديل بنجاح";
         return(RedirectToAction("Index"));
     }
     return(PartialView(v));
 }
示例#2
0
 public ActionResult Create(WorldGDPPriceFixed v)
 {
     if (ModelState.IsValid)
     {
         DB.WorldGDPPriceFixeds.Add(v);
         DB.SaveChanges();
         TempData["msg"] = "تمت عملية الاضافة بنجاح";
         return(RedirectToAction("Index"));
     }
     return(PartialView(v));
 }
示例#3
0
        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"));
        }
示例#4
0
        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"));
        }
示例#5
0
        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"));
        }