public ActionResult DeleteConfirmed(int id)
        {
            AdsResource adsresource = db.AdsResources.Find(id);

            db.AdsResources.Remove(adsresource);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        //
        // GET: /CRUD/AdResource/Details/5

        public ActionResult Details(int id = 0)
        {
            AdsResource adsresource = db.AdsResources.Find(id);

            if (adsresource == null)
            {
                return(HttpNotFound());
            }
            return(View(adsresource));
        }
 public ActionResult Edit(AdsResource adsresource)
 {
     if (ModelState.IsValid)
     {
         db.Entry(adsresource).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AdID = new SelectList(db.Ads, "ID", "TitleEN", adsresource.AdID);
     return(View(adsresource));
 }
        //
        // GET: /CRUD/AdResource/Edit/5

        public ActionResult Edit(int id = 0)
        {
            AdsResource adsresource = db.AdsResources.Find(id);

            if (adsresource == null)
            {
                return(HttpNotFound());
            }
            ViewBag.AdID = new SelectList(db.Ads, "ID", "TitleEN", adsresource.AdID);
            return(View(adsresource));
        }
        public ActionResult Create(AdsResource adsresource)
        {
            if (ModelState.IsValid)
            {
                db.AdsResources.Add(adsresource);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.AdID = new SelectList(db.Ads, "ID", "TitleEN", adsresource.AdID);
            return(View(adsresource));
        }