Esempio n. 1
0
 public IActionResult Create(User user)
 {
     if (ModelState.IsValid)
     {
         userManager.Insert(user);
         cacheNinja.ClearCache("User_GetAll");
     }
     else
     {
         ViewBag.Message = "Something went wrong!";
     }
     return(RedirectToAction("Index"));
 }
Esempio n. 2
0
 public IActionResult Add(Workpoint workpoints, Hub hubs)
 {
     if (workpoints.Type == 1)
     {
         deviceManager.WorkpointInsert(workpoints);
     }
     else
     if (hubs.Type == 2)
     {
         deviceManager.HubInsert(hubs);
     }
     cacheNinja.ClearCache("Workpoint_GetAll");
     cacheNinja.ClearCache("Hub_GetAll");
     return(RedirectToAction("Index"));
 }
Esempio n. 3
0
        public IActionResult Edit(Book book)
        {
            BookManager manager = new BookManager();

            manager.Update(book);

            CacheNinja ninja = new CacheNinja();

            ninja.ClearCache("Book_GetAll");
            return(RedirectToAction("Index"));
        }
Esempio n. 4
0
        public IActionResult Add(Book book)
        {
            BookManager bookManager = new BookManager();

            bookManager.Insert(book);

            CacheNinja ninja = new CacheNinja();

            ninja.ClearCache("Book_GetAll");
            return(RedirectToAction("Index"));
        }