public ActionResult Create(VolumeOfImportsOfGoodsAndService v)
 {
     if (ModelState.IsValid)
     {
         DB.VolumeOfImportsOfGoodsAndServices.Add(v);
         DB.SaveChanges();
         TempData["msg"] = "تمت عملية الاضافة بنجاح";
         return(RedirectToAction("Index"));
     }
     return(PartialView(v));
 }
        public ActionResult Details(int id)
        {
            VolumeOfImportsOfGoodsAndService ws = DB.VolumeOfImportsOfGoodsAndServices.FirstOrDefault(x => x.ImportOfGoodsServicesID == id);

            if (ws != null)
            {
                return(PartialView(ws));
            }
            TempData["msg"] = "خطأ ";
            return(RedirectToAction("Index"));
        }
        public ActionResult Delete(int id)
        {
            VolumeOfImportsOfGoodsAndService ws = DB.VolumeOfImportsOfGoodsAndServices.FirstOrDefault(x => x.ImportOfGoodsServicesID == id);


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