예제 #1
0
        public async Task <JToken> cdcallClubsPOST(cdUpdateClub regacccount)
        {
            cdCallAPI mycallAPI = new cdCallAPI();
            var       response  = await mycallAPI.cdCallPostAPI(App.cdClubAPIPutPost, regacccount, App.cdClubKey);

            return(response);
        }
예제 #2
0
        async void cdSubmit(object sender, System.EventArgs e)
        {
            try
            {
                cdReadError  myerror       = new cdReadError();
                cdUpdateClub updateAddress = new cdUpdateClub();
                updateAddress.ClubID       = assignedClubs[counter].ClubID;
                updateAddress.ColumnName   = "AddressLine1";
                updateAddress.ColumnValue  = CubAddress.Text;
                updateAddress.ColumnName2  = "City";
                updateAddress.ColumnValue2 = City.Text;
                updateAddress.ColumnName3  = "cdState";
                updateAddress.ColumnValue3 = myState.Text;
                updateAddress.ColumnName4  = "PostalCode";
                updateAddress.ColumnValue4 = PostalCode.Text;

                System.Diagnostics.Debug.WriteLine(" Before calling Post API ");
                cdCallAPI mycallAPI  = new cdCallAPI();
                var       jsresponse = await mycallAPI.cdcallClubsPOST(updateAddress);

                System.Diagnostics.Debug.WriteLine(" After calling Post API ");
                if (jsresponse.ToString().Contains("ValidationException"))
                {
                    System.Diagnostics.Debug.WriteLine(" Post API Call failed " + jsresponse);
                    myerror           = JsonConvert.DeserializeObject <cdReadError>(jsresponse.ToString());
                    updateStatus.Text = "Update Failed. " + myerror.message;
                }
                else
                {
                    System.Diagnostics.Debug.WriteLine(" Post API Call Successful");
                    updateStatus.Text = "Update Successful";
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("End of Array " + ex);
                await DisplayAlert("Action", "Unable to update data. Please try later.", "OK");
            }
        }