Ejemplo n.º 1
0
 public async Task<ActionResult> EditProfile(EditProfileViewModel vm)
 {
     var user = await UserManager.FindByIdAsync(User.Identity.GetUserId());
     user.Address = vm.Address;
     user.Firstname = vm.Firstname;
     user.Sirname = vm.Sirname;
     user.Phone = vm.Phone;
     user.Delivery = vm.Delivery;
     user.Payment = vm.Payment;
     await UserManager.UpdateAsync(user);
     return RedirectToAction("Index");
 }
Ejemplo n.º 2
0
        //
        // GET: /Manage/EditProfile

        public async Task<ActionResult> EditProfile() {
            var user = await UserManager.FindByIdAsync(User.Identity.GetUserId());
            var model = new EditProfileViewModel {
                Address=user.Address,
                Phone=user.Phone,
                Firstname=user.Firstname,
                Sirname=user.Sirname,
                Delivery=user.Delivery,
                Payment=user.Payment };
            //ViewBag.Cats = new SelectList(_cRep.Categories, "ID", "CategoryName");
            ViewBag.DeliveryList = new SelectList(model.DeliveryList, "Text", "Value");
            ViewBag.PaymentList = new SelectList(model.PaymentList, "Text", "Value");
            return View(model);
        }