Ejemplo n.º 1
0
 public void SetStore()
 {
     // Skip if the user is not store enabled.
     if( TestData.Store == null )
     return;
     SetStoreCall api = new SetStoreCall(this.apiContext);
     // Build the StoreType object.
     StoreType st = new StoreType();
     st.Description = TestData.Store.Description;
     st.Logo = TestData.Store.Logo;
     st.MerchDisplay = TestData.Store.MerchDisplay;
     st.Name = TestData.Store.Name;
     // Make API call.
     api.SetStore(st);
 }
Ejemplo n.º 2
0
        private void BtnSetStore_Click(object sender, System.EventArgs e)
        {
            try
            {
                TxtStatus.Text = "";

                SetStoreCall apicall = new SetStoreCall(Context);

                StoreType store = new StoreType();

                if (TxtName.Text != String.Empty)
                    store.Name = TxtName.Text;

                if (TxtDescription.Text != String.Empty)
                    store.Description = TxtDescription.Text;

                if (TxtHeader.Text != String.Empty)
                    store.CustomHeader = TxtHeader.Text;

                if (CboLayout.SelectedIndex > 0)
                {
                    store.ItemListLayout = (StoreItemListLayoutCodeType) Enum.Parse(typeof(StoreItemListLayoutCodeType), CboLayout.SelectedItem.ToString());
                }

                if (CboSort.SelectedIndex > 0)
                {
                    store.ItemListSortOrder = (StoreItemListSortOrderCodeType) Enum.Parse(typeof(StoreItemListSortOrderCodeType), CboSort.SelectedItem.ToString());
                }

                apicall.SetStore(store);

                TxtStatus.Text = apicall.ApiResponse.Ack.ToString();

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }