Ejemplo n.º 1
0
        public ActionResult OnlinePayment(OnlinePaymentModel model)
        {
            bool TheError = false;

            if (ModelState.IsValid)
            {
                Connection.Connection con = new Connection.Connection();
                if (User.Identity.GetUserId() == null)
                {
                    TheError = con.AddUserAndPayment(model);
                }
                else
                {
                    TheError = con.UpdateUserAndPayment(model, User.Identity.GetUserId());
                }
            }
            if (TheError == false)
            {
                ViewBag.Message = "";
                return(RedirectToAction("OnlinePayment2", "Home", model));
            }
            else
            {
                ViewBag.Message = "خطا در ثبت اطلاعات";
                Connection.Connection con = new Connection.Connection();
                model.Countries = con.GetListOfCountries();
                model.States    = con.GetListOfStates(model.SelectedCountry);
                model.Cities    = con.GetListOfCities(model.SelectedState);
                return(View(model));
            }
        }