Exemplo n.º 1
0
 public ActionResult Create()
 {
     using (var cm = new CompanyManager())
     {
         ViewBag.CompanyList = cm.All().ToList();
     }
     ViewBag.User = new User();
     return View("Edit");
 }
Exemplo n.º 2
0
        public ActionResult List()
        {
            List<Company> companies;

            using (var cm = new CompanyManager())
            {
                companies = cm.All().ToList();
            }

            ViewBag.Companies = companies;
            return View("CompanyList");
        }
Exemplo n.º 3
0
 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");
     }
 }