public ActionResult Create() { using (var cm = new CompanyManager()) { ViewBag.CompanyList = cm.All().ToList(); } ViewBag.User = new User(); return View("Edit"); }
public ActionResult List() { List<Company> companies; using (var cm = new CompanyManager()) { companies = cm.All().ToList(); } ViewBag.Companies = companies; return View("CompanyList"); }
public ActionResult Edit(int id) { using (var cm = new CompanyManager()) { ViewBag.CompanyList = cm.All().OrderBy(c => c.Name).ToList(); } using (var um = new UserManager()) { var user = um.Single(id); ViewBag.User = user; return View("Edit"); } }