public static Dictionary <string, object> getAirshowInfo(string airshowName) { IList <Airshow> airshows = Airshows; Dictionary <string, object> properties = new Dictionary <string, object>(); Airshow airshowSelected = null; foreach (Airshow airshow in Airshows) { if (airshow != null && airshow.Name == airshowName) { airshowSelected = airshow; } } properties.Add("Performers", airshowSelected.Performers); properties.Add("Statics", airshowSelected.Statics); properties.Add("Foods", airshowSelected.Foods); properties.Add("Directions", airshowSelected.Directions); properties.Add("Name", airshowSelected.Name); properties.Add("Description", airshowSelected.Description); properties.Add("Date", airshowSelected.Date); properties.Add("Base", airshowSelected.Base); properties.Add("Last Update", airshowSelected.LastUpdate); properties.Add("Sponsors", airshowSelected.Sponsors); properties.Add("Facebook Link", airshowSelected.FacebookLink); properties.Add("Twitter Link", airshowSelected.TwitterLink); properties.Add("Website Link", airshowSelected.WebsiteLink); properties.Add("Instagram Link", airshowSelected.InstagramLink); return(properties); }
public pgCreate() { InitializeComponent(); if (Device.RuntimePlatform == Device.Android) { backButton.IsVisible = false; } txtDate.Placeholder = "MM/DD/YYYY"; if (isNew) { newAirshow = new Airshow() { Name = "New" }; Database.Airshows.Add(newAirshow); InfoStore.Selected = "New"; isNew = false; } else { newAirshow = Database.Airshows[Database.Airshows.Count - 1]; LoadBoxData(newAirshow); InfoStore.database = new Database(); } newAirshowIndex = Database.Airshows.IndexOf(newAirshow); }
private void btnSave_Pressed(object sender, EventArgs e) { if (validateAll()) { Airshow newShow = Database.Airshows[Database.Airshows.Count - 1]; newShow.Statics = newShow.Statics ?? new List <Static>(); newShow.Statics.Add(new Static(txtName.Text.Trim(), txtDesc.Text.Trim(), txtImage.Text.Trim())); } }
private void btnSave_Pressed(object sender, EventArgs e) { if (validateAll()) { Airshow newShow = Database.Airshows[Database.Airshows.Count - 1]; newShow.Performers = newShow.Performers ?? new List <Performer>(); newShow.Performers.Add(new Performer(txtName.Text.Trim(), txtDesc.Text.Trim(), pckInAir.SelectedItem.ToString(), txtImage.Text.Trim(), txtSchedule.Text.Trim())); } }
private void savePressed(object sender, EventArgs e) { if (ValidateAll()) { Airshow newAirshow = Database.Airshows[Database.Airshows.Count - 1]; newAirshow.Directions = new List <Direction>(); newAirshow.Directions.Add(new Direction(Convert.ToBoolean(pckFull.SelectedItem.ToString()), txtName.Text.Trim(), pckType.SelectedItem.ToString(), Convert.ToDouble(txtXCoord.Text.Trim()), Convert.ToDouble(txtYCoord.Text.Trim()))); OnBackButtonPressed(); } }
private void LoadBoxData(Airshow airshow) { txtBase.Text = airshow.Base ?? ""; txtDate.Text = airshow.Date ?? ""; txtDesc.Text = airshow.Description ?? ""; txtFBLink.Text = airshow.FacebookLink ?? "None"; txtTwitterLink.Text = airshow.TwitterLink ?? "None"; txtWebsiteLink.Text = airshow.WebsiteLink ?? "None"; txtIGLink.Text = airshow.InstagramLink ?? "None"; txtName.Text = airshow.Name ?? ""; }