public ActionResult Create(Seller newSeller) { try { newSeller.Created = DateTime.Now; sellerRepository.SaveOrUpdate(newSeller); return RedirectToAction("Index"); } catch(Exception ex) { ViewData["Exception"] = ex; return View(); } }
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)); } }