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