コード例 #1
0
 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());
            }
        }
コード例 #4
0
        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;
 }