Exemple #1
0
 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");
        }
Exemple #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");
     }
 }