public ActionResult Create(Referree pReferree) { try { // TODO: Add insert logic here db.Referrees.Add(pReferree); db.SaveChanges(); return RedirectToAction("Index"); } catch { return View("~/Views/Shared/Error.cshtml"); } }
public ReferreeRoleViewModel(Referree referree, Position role) { _referree = referree; _role = role; }
public ActionResult Edit(string id, Referree pReferree) { try { // TODO: Add update logic here Referree _referree = null; foreach (Referree _ref in db.Referrees) { if (_ref.ReferreeName == Server.UrlDecode(id)) { _referree = _ref; } } if (_referree != null) { _referree.Role = pReferree.Role; _referree.Phone = pReferree.Phone; _referree.Email = pReferree.Email; db.SaveChanges(); } return RedirectToAction("Index"); } catch { return View("~/Views/Shared/Error.cshtml"); } }