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

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

            ViewBag.Companies = companies;
            return(View("CompanyList"));
        }
Example #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"));
     }
 }