Exemple #1
0
        // GET: Profile/Create
        public ActionResult Create()
        {
            var profile = new ProfileCreateEditViewModel {
                Categories = CategoryService.Lookup()
            };

            return(View(profile));
        }
Exemple #2
0
 public ActionResult Edit(ProfileCreateEditViewModel model)
 {
     if (!ModelState.IsValid)
     {
         model.Categories = CategoryService.Lookup();
         return(View(model));
     }
     try
     {
         // TODO: Add update logic here
         ProfileService.Update(Mapper.Map <ProfileServiceModel>(model));
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }