public ActionResult SberbankInfo(decimal orderID) { if (CommonConst.IsMobile) { var order = OrderService.GetByPKAndUserID(orderID, AuthService.CurrentUser.UserID); if (order != null) { CartService.SetPaymentType(PaymentTypes.SberBank, orderID); } return(BaseView(new PagePart(MHtmls.LongList( MHtmls.Title("Сбербанк"), "Информация о заказ отправлена вам на почту").ToString()))); } var user = UserService.GetByPK(User.UserID); var userAddress = user .UserAddresses.FirstOrDefault(); if (userAddress == null) { userAddress = new UserAddress(); } userAddress.ForSberbank = true; var model = new SberbankInfoVM { OrderID = orderID, UserAddress = userAddress, Manager = GetSiteManager(orderID) }; model.Contacts = new ContactsVM(); Services.Profile.ProfileService.InitPhones(user, model.Contacts); return(View(model)); }
public ActionResult SberbankInfo(SberbankInfoVM model) { if (FluentValidate(model)) { ProfileService.UpdateAddressAndPhones(model.UserAddress, model.Contacts); var order = OrderService.GetByPKAndUserID(model.OrderID, AuthService.CurrentUser.UserID); CartService.SetPaymentType(PaymentTypes.SberBank, order.OrderID); return(RedirectToAction(() => Receipt(order.OrderID))); } return(RedirectToAction(() => SberbankInfo(model.OrderID))); }