コード例 #1
0
 public ActionResult Edit(GoodsExportVolume GoodsExportVolume)
 {
     if (ModelState.IsValid)
     {
         DB.Entry(GoodsExportVolume).State = EntityState.Modified;
         DB.SaveChanges();
         TempData["msg"] = "تمت عملية التعديل بنجاح";
         return(RedirectToAction("Index"));
     }
     return(PartialView(GoodsExportVolume));
 }
コード例 #2
0
 public ActionResult Create(GoodsExportVolume GoodsExportVolume)
 {
     if (ModelState.IsValid)
     {
         DB.GoodsExportVolumes.Add(GoodsExportVolume);
         DB.SaveChanges();
         TempData["msg"] = "تمت عملية الاضافة بنجاح";
         return(RedirectToAction("Index"));
     }
     return(PartialView(GoodsExportVolume));
 }
コード例 #3
0
        public ActionResult Details(int id)
        {
            GoodsExportVolume ws = DB.GoodsExportVolumes.FirstOrDefault(x => x.ExportVolumeId == id);

            if (ws != null)
            {
                return(PartialView(ws));
            }
            TempData["msg"] = "خطأ ";
            return(RedirectToAction("Index"));
        }
コード例 #4
0
        public ActionResult Delete(int id)
        {
            GoodsExportVolume ws = DB.GoodsExportVolumes.FirstOrDefault(x => x.ExportVolumeId == id);


            if (ws != null)
            {
                DB.GoodsExportVolumes.Remove(ws);
                DB.SaveChanges();
                TempData["msg"] = "تمت عملية الحذف بنجاح";
                return(RedirectToAction("Index"));
            }
            TempData["msg"] = "خطأ ";
            return(RedirectToAction("Index"));
        }
コード例 #5
0
        public ActionResult Edit(int id)
        {
            GoodsExportVolume ws = DB.GoodsExportVolumes.FirstOrDefault(x => x.ExportVolumeId == 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"));
        }