private async void editWork(clsAllWork prWork) { if (prWork != null) { _navigatingForward = true; await Navigation.PushAsync(new pgWork(prWork)); } }
private void updatePage(clsAllWork prWork) { _Work = prWork; txtName.Text = _Work.Name.EmptyIfNull(); txtDate.Text = _Work.Date.ToString("d"); txtValue.Text = _Work.Value.ToString(); txtName.IsEnabled = string.IsNullOrEmpty(_Work.Name); _artWorkCtrl.UpdateControl(prWork); }
internal async static Task <string> DeleteArtworkAsync(clsAllWork prWork) { using (HttpClient lcHttpClient = new HttpClient()) { HttpResponseMessage lcRespMessage = await lcHttpClient.DeleteAsync ($"http://10.0.2.2:60064/api/gallery/DeleteArtWork?WorkName={prWork.Name}&ArtistName={prWork.ArtistName}"); return(await lcRespMessage.Content.ReadAsStringAsync()); } }
private async void BtnAdd_Clicked(object sender, EventArgs e) { string lcChoiceString = await DisplayActionSheet("Select artwork type:", "Cancel", null, clsAllWork.Choices.Keys.ToArray <string>()); if (clsAllWork.Choices.TryGetValue(lcChoiceString, out char lcChoiceChar)) { clsAllWork lcWork = clsAllWork.NewWork(lcChoiceChar); lcWork.ArtistName = _Artist.Name; editWork(lcWork); } }
private void addWorkSpecificContent(clsAllWork prWork) { switch (char.ToUpper(prWork.WorkType)) { case 'P': _artWorkCtrl = new ctrPaintPhoto(); Title = "edit painting"; break; case 'H': _artWorkCtrl = new ctrPaintPhoto(); Title = "edit photograph"; break; case 'S': _artWorkCtrl = new ctrSculpture(); Title = "edit sculpture"; break; } }
public pgWork(clsAllWork prWork) { addWorkSpecificContent(prWork); initialiseComponent(); updatePage(prWork); }
internal async static Task <string> UpdateWorkAsync(clsAllWork prWork) { return(await InsertOrUpdateAsync(prWork, "http://10.0.2.2:60064/api/gallery/PutArtWork", "PUT")); }
public void UpdateControl(clsAllWork prWork) { txtWeight.Text = prWork.Weight.ToString(); txtMaterial.Text = prWork.Material.EmptyIfNull(); }
public void PushData(clsAllWork prWork) { prWork.Weight = float.Parse(txtWeight.Text); prWork.Material = txtMaterial.Text; }
public void UpdateControl(clsAllWork prWork) { txtWidth.Text = prWork.Width.ToString(); txtHeight.Text = prWork.Height.ToString(); txtType.Text = prWork.Type.EmptyIfNull(); }
public void PushData(clsAllWork prWork) { prWork.Width = float.Parse(txtWidth.Text); prWork.Height = float.Parse(txtHeight.Text); prWork.Type = txtType.Text; }