public ActionResult Edit(Organization organization)
 {
     if (ModelState.IsValid)
     {
         repo.Entry(organization).State = EntityState.Modified;
         repo.SaveChanges();
         TempData["Message"] = "Organization Saved";
         return RedirectToAction("Index");
     }
     return View(organization);
 }
        public ActionResult Create(Organization organization)
        {
            if (ModelState.IsValid)
            {
                repo.Add(organization);
                repo.SaveChanges();
                TempData["Message"] = "Organization Saved";
                return RedirectToAction("Index");
            }

            return View(organization);
        }
Esempio n. 3
0
 public Organization Remove(Organization entity)
 {
     HttpContext.Current.Cache.Remove("Organizations"); // invalidate cache
     Entry(entity).State = System.Data.EntityState.Deleted;
     return entity;
 }
Esempio n. 4
0
 public DbEntityEntry<Organization> Entry(Organization entity)
 {
     HttpContext.Current.Cache.Remove("Organizations"); // invalidate cache
     return db.Entry<Organization>(entity);
 }
Esempio n. 5
0
 public Organization Add(Organization entity)
 {
     HttpContext.Current.Cache.Remove("Organizations"); // invalidate cache
     return db.Organizations.Add(entity);
 }