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

            return View(servicer);
        }
Esempio n. 3
0
 public Servicer Remove(Servicer entity)
 {
     HttpContext.Current.Cache.Remove("Servicers"); // invalidate cache
     Entry(entity).State = System.Data.EntityState.Deleted;
     return entity;
 }
Esempio n. 4
0
 public DbEntityEntry<Servicer> Entry(Servicer entity)
 {
     HttpContext.Current.Cache.Remove("Servicers"); // invalidate cache
     return db.Entry<Servicer>(entity);
 }
Esempio n. 5
0
 public Servicer Add(Servicer entity)
 {
     HttpContext.Current.Cache.Remove("Servicers"); // invalidate cache
     return db.Servicers.Add(entity);
 }
 private void VerifyServicerFilter(ICurrentUser currentUser, Servicer servicer, bool expectedResult)
 {
     var filter = DataContextExtensions.GetServicerFilterForCurrentUser(currentUser);
     var actualResult = filter(servicer);
     Assert.AreEqual(expectedResult, actualResult);
 }