public ActionResult UserAddress(UserAddressModel model) { LoadCountries(); if (_mu != null) _ua = new UserAccount(Convert.ToInt32(_mu.ProviderUserKey)); _uad = new UserAccountDetail(); _uad.GetUserAccountDeailForUser(_ua.UserAccountID); var uadress = new UserAddress(); uadress.GetUserAddress(_ua.UserAccountID); TryUpdateModel(model); if (ModelState.IsValid) { uadress.AddressLine1 = model.AddressLine1; uadress.AddressLine2 = model.AddressLine2; uadress.AddressLine3 = model.AddressLine3; uadress.City = model.City; uadress.CountryISO = model.Country; uadress.FirstName = model.FirstName; uadress.LastName = model.LastName; uadress.PostalCode = model.PostalCode; uadress.Region = model.RegionState; uadress.UserAccountID = _ua.UserAccountID; // uadress.Choice1 = "||" + Request.Form["sex"] + "|" + Request.Form["size"]; if (uadress.UserAddressID == 0) uadress.AddressStatus = 'U'; ViewBag.ProfileUpdated = uadress.Set(); Response.Redirect("/account/home"); } return View(model); }
public ActionResult UserAddress(UserAddressModel model) { LoadCountries(); mu = Membership.GetUser(); ua = new UserAccount(Convert.ToInt32(mu.ProviderUserKey)); uad = new UserAccountDetail(); uad.GetUserAccountDeailForUser(ua.UserAccountID); BootBaronLib.AppSpec.DasKlub.BOL.UserAddress uadress = new UserAddress(); uadress.GetUserAddress(ua.UserAccountID); TryUpdateModel(model); if (ModelState.IsValid) { uadress.AddressLine1 = model.AddressLine1; uadress.AddressLine2 = model.AddressLine2; uadress.AddressLine3 = model.AddressLine3; uadress.City = model.City; uadress.CountryISO = model.Country; uadress.FirstName = model.FirstName; uadress.LastName = model.LastName; uadress.PostalCode = model.PostalCode; uadress.Region = model.RegionState; uadress.UserAccountID = ua.UserAccountID; if (uadress.UserAddressID == 0) uadress.AddressStatus = 'U'; ViewBag.ProfileUpdated = uadress.Set(); } //if (BootBaronLib.AppSpec.DasKlub.BOL.UserAddress.IsBlank(ua.UserAccountID)) //{ // newUAdd.UserAccountID = ua.UserAccountID; // newUAdd.CreatedByUserID = ua.UserAccountID; // if (Request.Form["no_button"] != null && // Request.Form["no_button"] == "no") // { // newUAdd.AddressStatus = 'N'; // } // else // { // newUAdd.AddressStatus = 'U'; // } // if (!string.IsNullOrEmpty(newUAdd.PostalCode) && (string.IsNullOrEmpty(newUAdd.City) || string.IsNullOrEmpty(newUAdd.Region))) // { // // for those those who think the system can figure them out // SiteEnums.CountryCodeISO coiso = GeoData.GetCountryISOForCountryCode(newUAdd.CountryISO); // SiteStructs.CityRegion cr = GeoData.GetCityRegionForPostalCodeCountry(newUAdd.PostalCode, coiso); // newUAdd.Region = cr.Region; // newUAdd.City = cr.CityName; // } // newUAdd.Create(); //} ////Response.Redirect("/" + ua.UserName); //Response.Redirect("~/thanks.htm"); //uad = new UserAccountDetail(); //uad.GetUserAccountDeailForUser(ua.UserAccountID); return View(model); }
public ActionResult GiveAway(UserAddressModel model) { LoadCountries(); var uadress = new UserAddress(); TryUpdateModel(model); if (ModelState.IsValid) { uadress.AddressLine1 = model.AddressLine1; uadress.AddressLine2 = model.AddressLine2; uadress.AddressLine3 = model.AddressLine3; uadress.City = model.City; uadress.CountryISO = model.Country; uadress.FirstName = model.FirstName; uadress.LastName = model.LastName; uadress.PostalCode = model.PostalCode; uadress.Region = model.RegionState; if (uadress.UserAddressID == 0) uadress.AddressStatus = 'U'; uadress.Set(); ViewBag.IsSuccess = true; return View(model); } return View(model); }