Esempio n. 1
0
 public ActionResult Edit(Site site)
 {
     if (ModelState.IsValid)
     {
         db.Entry(site).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(site);
 }
Esempio n. 2
0
 public ActionResult Edit(Site site)
 {
     if (ModelState.IsValid)
     {
         siteRepository.UpdateSite(site);
         siteRepository.Save();
         return RedirectToAction("Index");
     }
     return View(site);
 }
Esempio n. 3
0
        public ActionResult Create(Site site)
        {
            if (ModelState.IsValid)
            {
                db.Sites.Add(site);
                db.SaveChanges();
                return RedirectToAction("Index");  
            }

            return View(site);
        }
Esempio n. 4
0
 public void UpdateSite(Site Site)
 {
     context.Entry(Site).State = EntityState.Modified;
 }
Esempio n. 5
0
 public void InsertSite(Site Site)
 {
     context.Sites.Add(Site);
 }