public ActionResult AddAddress(AddressViewModel model) { if (ModelState.IsValid) { var address = model.ToAddress(); AccountManager.CreateAddress(address); AccountManager.Save(); return RedirectToAction("Addresses", new { userId = AccountHelper.GetLoggedUserId() }); } ViewBag.Regions = GeneralHelper.SelectListForEnum<Region>(model.Region); return View(model); }
public ActionResult AddAddress() { var model = new AddressViewModel { UserId = AccountHelper.GetLoggedUserId() }; ViewBag.Regions = GeneralHelper.SelectListForEnum(typeof(Region)); return View(model); }