Example #1
0
        private void BtnGetStore_Click(object sender, System.EventArgs e)
        {
            try
            {
                LstStoreCats.Items.Clear();
                TxtName.Text         = "";
                TxtSubscription.Text = "";
                TxtDescription.Text  = "";

                GetStoreCall apicall = new GetStoreCall(Context);

                StoreType store = apicall.GetStore();

                TxtName.Text         = store.Name;
                TxtSubscription.Text = store.SubscriptionLevel.ToString();
                TxtDescription.Text  = store.Description;

                foreach (StoreCustomCategoryType cat in store.CustomCategories)
                {
                    string[] listparams = new string[2];
                    listparams[0] = cat.CategoryID.ToString();
                    listparams[1] = cat.Name;

                    ListViewItem vi = new ListViewItem(listparams);
                    LstStoreCats.Items.Add(vi);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        public void GetStore()
        {
            GetStoreCall api = new GetStoreCall(this.apiContext);

            // Make API call.
            api.GetStore();
            StoreType store = api.ApiResponse.Store;

            TestData.Store = store;
        }