public AddressesViewModel() { billing = new Billing(); getDetailById = new GetDetailById(); _BillingDetailService = new GetBillingDetailbyId(); AddressDetails(); }
public AccountDetailsVM() { clsUpdateAccount = new clsUpdateAccountDetail(); accountDetailsService = new UpdateADetailsService(); _BillingDetailService = new GetBillingDetailbyId(); getDetailById = new GetDetailById(); _ = getdata(); }
private async void AddressDetails() { string id = await Utilty.GetSecureStorageValueFor(Utilty.UserId); getDetailById = await _BillingDetailService.GetDetailAsync(id); BillingAddress = getDetailById.billing.address_1 + getDetailById.billing.address_2 + "," + getDetailById.billing.city + "," + getDetailById.billing.state + "," + getDetailById.billing.country; ShippingAddress = getDetailById.shipping.address_1 + getDetailById.shipping.address_2 + "," + getDetailById.shipping.city + "," + getDetailById.shipping.state + "," + getDetailById.shipping.country; }
public SummaryViewModel(INavigation navigation, PaymentGetway _paymentGetway) { this.methods = _paymentGetway; Itemlst = new List <LineItems>(); _BillingDetailService = new GetBillingDetailbyId(); placeOrderApi = new PlaceOrderApi(); getDetailById = new GetDetailById(); _loginService = new LoginService(); order = new OrderDetailModel(); this.navigation = navigation; _connection = Xamarin.Forms.DependencyService.Get <ISQLiteDb>().GetConnection(); _ = getallcaetitem(); }
internal async Task <GetDetailById> GetDetailAsync(string userId) { GetDetailById getDetailById = new GetDetailById(); var Httpclient = new HttpClient(); var url = Constants.BaseApiAddress + "/wp-json/wc/v3/customers/" + userId + Constants.Consumer_Key; var uri = new Uri(string.Format(url, string.Empty)); HttpResponseMessage response = null; response = await Httpclient.GetAsync(uri); if (response.IsSuccessStatusCode) { //using (var client = new HttpClient()) //{ // var result = await client.GetStringAsync(uri); // //clsUserDataById userDataById = JsonConvert.DeserializeObject<clsUserDataById>(result.ToString()); //} var responseContent1 = await response.Content.ReadAsStringAsync(); dynamic resObj = JsonConvert.DeserializeObject <dynamic>(responseContent1); string abc = resObj.username; string asd = resObj.billing.email; // var a = JsonConvert.DeserializeObject<clsUserDataById>(resObj); getDetailById.first_name = resObj.first_name; getDetailById.last_name = resObj.last_name; getDetailById.username = resObj.username; getDetailById.email = resObj.email; getDetailById.billing = new Billing { first_name = resObj.billing.first_name, last_name = resObj.billing.last_name, company = resObj.billing.company, address_1 = resObj.billing.address_1, address_2 = resObj.billing.address_2, city = resObj.billing.city, postcode = resObj.billing.postcode, country = resObj.billing.country, state = resObj.billing.state, email = resObj.billing.email, phone = resObj.billing.phone, }; getDetailById.shipping = new Shipping { first_name = resObj.billing.first_name, last_name = resObj.billing.last_name, company = resObj.billing.company, address_1 = resObj.billing.address_1, address_2 = resObj.billing.address_2, city = resObj.billing.city, postcode = resObj.billing.postcode, country = resObj.billing.country, state = resObj.billing.state, }; // JArray loi = (JArray)jObject1.GetValue("billing"); //var getresponse = loi.ToObject<List<Billing>>(); } return(getDetailById); }