Esempio n. 1
0
 public ActionResult Create(Seller newSeller)
 {
     try
     {
         newSeller.Created = DateTime.Now;
         sellerRepository.SaveOrUpdate(newSeller);
         return RedirectToAction("Index");
     }
     catch(Exception ex)
     {
         ViewData["Exception"] = ex;
         return View();
     }
 }
Esempio n. 2
0
 public ActionResult Edit(int id, Seller seller)
 {
     try
     {
         Seller updated = sellerRepository.Get(id);
         updated.Email = seller.Email;
         updated.EbayUser = seller.EbayUser;
         sellerRepository.SaveOrUpdate(updated);
         return RedirectToAction("Index");
     }
     catch (Exception ex)
     {
         ViewData["Exception"] = ex;
         return View(sellerRepository.Get(id));
     }
 }