/// <summary>
        /// CONTROLLER: PaymentController
        /// </summary>

        public bool PostSubmitPayment(PaymentViewModel model)
        {
            //int userID = userService.Get(CurrentUserLoginName).ID;

            //return orderService.Add(new BusinessLayer.Models.OrderModel()
            //{
            //    FirstName = model.FirstName,
            //    LastName = model.LastName,
            //    Address = model.Address,
            //    City = model.City,
            //    State = model.State,
            //    PostalCode = model.PostalCode,
            //    Country = model.Country,
            //    Phone = model.Phone,
            //    Email = model.Email
            //}, userID);
            return(ambrella.SubmitPayment(model));
        }
示例#2
0
        public ActionResult SubmitPayment(PaymentViewModel model)
        {
            //if (ModelState.IsValid)
            //{
            //    int userID = userService.Get(CurrentUserLoginName).ID;

            //    orderService.Add(new BusinessLayer.Models.OrderModel()
            //    {
            //        FirstName = model.FirstName,
            //        LastName = model.LastName,
            //        Address = model.Address,
            //        City = model.City,
            //        State = model.State,
            //        PostalCode = model.PostalCode,
            //        Country = model.Country,
            //        Phone = model.Phone,
            //        Email = model.Email
            //    }, userID);

            //    return RedirectToAction("Index", "Store");
            //}
            //else
            //{
            //    ModelState.AddModelError("", "Fill required fields.");
            //}

            //return View("Index", model);

            if (ModelState.IsValid)
            {
                ambrella.SubmitPayment(model);
                return(RedirectToAction("Index", "Store"));
            }
            else
            {
                ModelState.AddModelError("", "Fill required fields.");
            }

            return(View("Index", model));
        }