Ejemplo n.º 1
0
        public ActionResult Makes()
        {
            IMakeRepository    repo  = RepoFactory.CreateMakeRepo();
            AdminMakeViewModel model = new AdminMakeViewModel();

            model.Makes = repo.GetAll().ToList();


            return(View(model));
        }
Ejemplo n.º 2
0
        public ActionResult Makes(string MakeInput)
        {
            IMakeRepository repo = RepoFactory.CreateMakeRepo();

            if (MakeInput != null)
            {
                var make = new Make()
                {
                    DateAdded = DateTime.Today,
                    Name      = MakeInput,
                    UserId    = System.Web.HttpContext.Current.User.Identity.GetUserId()
                };
                repo.Create(make);
            }


            AdminMakeViewModel model = new AdminMakeViewModel();

            model.Makes = repo.GetAll().ToList();

            return(View(model));
        }