private async void editWork(clsAllWork prWork)
 {
     if (prWork != null)
     {
         _navigatingForward = true;
         await Navigation.PushAsync(new pgWork(prWork));
     }
 }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
        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);
            }
        }
Exemplo n.º 5
0
        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;
            }
        }
Exemplo n.º 6
0
 public pgWork(clsAllWork prWork)
 {
     addWorkSpecificContent(prWork);
     initialiseComponent();
     updatePage(prWork);
 }
Exemplo n.º 7
0
 internal async static Task <string> UpdateWorkAsync(clsAllWork prWork)
 {
     return(await InsertOrUpdateAsync(prWork, "http://10.0.2.2:60064/api/gallery/PutArtWork", "PUT"));
 }
Exemplo n.º 8
0
 public void UpdateControl(clsAllWork prWork)
 {
     txtWeight.Text   = prWork.Weight.ToString();
     txtMaterial.Text = prWork.Material.EmptyIfNull();
 }
Exemplo n.º 9
0
 public void PushData(clsAllWork prWork)
 {
     prWork.Weight   = float.Parse(txtWeight.Text);
     prWork.Material = txtMaterial.Text;
 }
Exemplo n.º 10
0
 public void UpdateControl(clsAllWork prWork)
 {
     txtWidth.Text  = prWork.Width.ToString();
     txtHeight.Text = prWork.Height.ToString();
     txtType.Text   = prWork.Type.EmptyIfNull();
 }
Exemplo n.º 11
0
 public void PushData(clsAllWork prWork)
 {
     prWork.Width  = float.Parse(txtWidth.Text);
     prWork.Height = float.Parse(txtHeight.Text);
     prWork.Type   = txtType.Text;
 }