Пример #1
0
 public IActionResult Create(Asset asset)
 {
     try
     {
         AssetsManager.Add(asset);  // call the method to add the info to the database
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Пример #2
0
 //[ValidateAntiForgeryToken]
 public IActionResult Create(Asset asset)
 {
     try
     {
         AssetsManager.Add(asset);
         return(RedirectToAction("Index", "Home"));
     }
     catch
     {
         return(View());
     }
 }
Пример #3
0
 public IActionResult Create(Asset asset)
 {
     // if new asset is successfully added to db, redirect to main page. if not, reload current view
     try
     {
         AssetsManager.Add(asset);
         return(RedirectToAction("Search"));
     }
     catch
     {
         return(View());
     }
 }