예제 #1
0
        // GET: Request/Create
        public ActionResult Create()
        {
            var           UserID        = User.Identity.GetUserId();
            List <string> AllCategories = new List <string>();

            foreach (Categories category in db.Categories)
            {
                AllCategories.Add(category.Title);
            }
            ViewBag.ACategories = AllCategories;
            ViewBag.UserId      = UserID;
            CategoriesList cats = new Models.CategoriesList();

            cats.AllCategories = new SelectList(db.Categories, "Title", "Title");
            return(View());
        }
예제 #2
0
 // GET: Request/Create
 public ActionResult Create()
 {
     var UserID = User.Identity.GetUserId();
     List<string> AllCategories = new List<string>();
     foreach(Categories category in db.Categories)
     {
         AllCategories.Add(category.Title);
     }
     ViewBag.ACategories = AllCategories;
     ViewBag.UserId = UserID;
     CategoriesList cats = new Models.CategoriesList();
     cats.AllCategories = new SelectList(db.Categories, "Title", "Title");
     return View();
 }