public ActionResult GetDetails(string Email) { OfflinePaymentModel model = new OfflinePaymentModel(); long UserId = BLayer.User.GetUserId(Email); if (UserId > 0) { CLayer.Address byAddress = BLayer.Address.GetAddressOnUserId(UserId); CLayer.Address adrs = BLayer.Address.GetPrimaryOnUser(UserId); if (byAddress != null && adrs != null) { model.Name = byAddress.Firstname; model.Email = byAddress.Email; model.Mobile = adrs.Mobile; model.CityId = adrs.CityId; model.State = adrs.State; model.CountryId = adrs.CountryId; model.ZipCode = adrs.ZipCode; model.Address = adrs.AddressText; model.LoadPlaces(); return(View("_Details", model)); } else { return(View("_Details", model)); } } else { return(View("_Details", model)); } }
public ActionResult Index() { long UserId = GetUserId(); CLayer.Address byAddress = BLayer.Address.GetAddressOnUserId(UserId); CLayer.Address adrs = BLayer.Address.GetPrimaryOnUser(UserId); OfflinePaymentModel model = new OfflinePaymentModel(); if (byAddress != null && adrs != null) { model.Name = byAddress.Firstname; model.Email = byAddress.Email; model.Mobile = adrs.Mobile; model.CityId = adrs.CityId; model.City = adrs.City; model.State = adrs.State; model.CountryId = adrs.CountryId; model.ZipCode = adrs.ZipCode; model.Address = adrs.AddressText; if (model.State > 0) { List <CLayer.City> cities = null; cities = BLayer.City.GetOnState(model.State); cities.Add(new CLayer.City() { CityId = -1, Name = "Other" }); model.CityList = new SelectList(cities, "CityId", "Name"); } model.LoadPlaces(); return(View(model)); } else { return(View(model)); } }