public async void UploadFile_ClickedAsync(object sender, EventArgs e) { ApiServices apiServices = new ApiServices(); if (initialed) { // businessPage.CompanyImage = mediaFile; } try { BusinessPage accesstoken = await apiServices.UploadPageAsync(ApplicationSettings.CompanyName, Description.Text, LatitudeLabel.Text, LongitudeLabel.Text); initialed = accesstoken.UploadSuccess; } catch (Exception ex) { Console.WriteLine("caught exception"); Console.WriteLine(ex.ToString()); throw; } if (initialed) { await DisplayAlert("Upload Success", "Page Successful Uploaded", "OK"); } }
public static BusinessPageAutocompleteModel ToAutocompleteModel(this BusinessPage businessPage, IMediaService mediaService) { var model = new BusinessPageAutocompleteModel() { Name = businessPage.Name, SeName = businessPage.GetPermalink().Slug, Id = businessPage.Id }; return(model); }
public NewItemPage() { InitializeComponent(); Item = new BusinessPage { CompanyName = "Item name", Description = "This is an item description." }; BindingContext = this; }
public ItemDetailPage() { InitializeComponent(); var item = new BusinessPage { CompanyName = "Item 1", Description = "This is an item description." }; viewModel = new BusinessDetailViewModel(item); BindingContext = viewModel; }
public static BusinessPageModel ToModel(this BusinessPage businessPage) { var model = new BusinessPageModel() { Id = businessPage.Id, Name = businessPage.Name, Address1 = businessPage.Address1, Address2 = businessPage.Address2, City = businessPage.City, ZipPostalCode = businessPage.ZipPostalCode, CountryId = businessPage.CountryId, Phone = businessPage.Phone, Email = businessPage.Email, Website = businessPage.Website, StartDate = businessPage.StartDate, EndDate = businessPage.EndDate, Description = businessPage.Description, MetaKeywords = businessPage.MetaKeywords, MetaDescription = businessPage.MetaDescription, }; return(model); }
internal async Task <BusinessPage> UploadPageAsync(string companyName, string description, string storeLatitude, string storeLongitude) { var client = new HttpClient(); BusinessPage businessPage = new BusinessPage { Description = description, StoreLatitude = storeLatitude, StoreLongitude = storeLongitude, CompanyName = companyName }; var json = JsonConvert.SerializeObject(businessPage); HttpContent httpContent = new StringContent(json); httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json"); try { HttpResponseMessage response = await client.PostAsync(Constants.LocalServer + "api/BusinessPages", httpContent); if (response.IsSuccessStatusCode) { string content = await response.Content.ReadAsStringAsync(); businessPage = JsonConvert.DeserializeObject <BusinessPage>(content); businessPage.UploadSuccess = true; } } catch (Exception e) { Debug.WriteLine("\tERROR {0}", e.Message); throw; } return(businessPage); }
public BusinessDetailViewModel(BusinessPage item = null) { CompanyName = item?.CompanyName; Item = item; }
public void VerifyUserCanNavigateToBusinessPage() { BusinessPage = InsightsPage.ClickLink <BusinessPage>(LinkText.Business); Assert.That(BusinessPage.IsBusinessPageOpened(), Is.True); Assert.That(BusinessPage.IsBusinessPageTitleCorrect(), Is.True); }