Exemple #1
0
        public MShopClient()
        {
            InitializeComponent();

            using (MusicShopWebServiceClient service = new MusicShopWebServiceClient())
            {
                categories[] catData      = service.getAllCategories();
                users[]      usersData    = service.getAllUsers();
                products[]   productsData = service.getAllProducts();

                comboBoxCategories.Items.Clear();
                userComboBox.Items.Clear();
                productComboBox.Items.Clear();
                foreach (categories c in catData)
                {
                    comboBoxCategories.Items.Add(c.catName);
                }

                foreach (users u in usersData)
                {
                    userComboBox.Items.Add(u.usrLogin);
                }

                foreach (products p in productsData)
                {
                    productComboBox.Items.Add(p.prdName);
                }
            }
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            using (MusicShopWebServiceClient service = new MusicShopWebServiceClient())
            {
                products[] data = service.getAllProducts();

                listBoxProducts.Items.Clear();
                foreach (products p in data)
                {
                    listBoxProducts.Items.Add(p.prdId + " " + p.prdName + " " + p.prdAmount + " " + p.prdPrice);
                }
            }
        }