public ActionResult SignupMO(int?memberId) { if (memberId.HasValue) { MoneyOrderBillingModel billingModel = GetBillingModel(memberId); return(View(billingModel)); } else { return(View()); } }
public ActionResult SignupMO(MoneyOrderBillingModel model) { if (ModelState.IsValid) { //Attempt to register the user OrderData orderData = this.AddOrder(model); if (this._orderCreated) { //FormsService.SignIn(model.UserName, false /* createPersistentCookie */); return(RedirectToRoute(new { action = "Finish", orderId = orderData.OrderId })); } else { //ModelState.AddModelError("", AccountValidation.ErrorCodeToString(createStatus)); } } return(View(GetBillingModel(model.MemberId))); }
private OrderData AddOrder(MoneyOrderBillingModel model) { Order order = new Order(); OrderData orderData = new OrderData { MemberId = model.MemberId, EnteredDate = DateTime.Today, PaymentChoice = PaymentChoices.MoneyOrder, ApprovedDate = null, ApprovalCode = null, Processing = model.Processing, Freight = 0, Tax = 0, SubTotal = 25, // model.SubTotal, CreatedDate = DateTime.Today, }; OrderDetailData orderDetailData = new OrderDetailData() { LineId = 1, ProductId = 1, Quantity = 1, Price = 25, }; OrderBillingAddressData orderBillingAddressData = new OrderBillingAddressData { FirstName = model.FirstName, LastName = model.LastName, Email = model.Email, Phone = model.Phone, }; this._orderCreated = order.Add(orderData, orderDetailData, orderBillingAddressData, null); return(orderData); }