Esempio n. 1
0
        private void btnUpdateBrand_Click(object sender, EventArgs e)
        {
            clsBrand brand1 = new clsBrand();

            brand1.Name = txtBrandName.Text;
            brand1.ID   = id;
            clsBrandCollection brand = new clsBrandCollection();
            int i = brand.editBrand(brand1);

            if (i != 0)
            {
                MessageBox.Show("Data Updated.");
                txtBrandName.Clear();
                GetBrands();
                BrandsName();
                btnUpdateBrand.Hide();
                btnDeleteBrand.Hide();
                btnAddBrand.Show();
                txtBrandName.Clear();
            }
            else
            {
                MessageBox.Show("Failed to Update Data.");
            }
        }
Esempio n. 2
0
        private void btnAddBrand_Click(object sender, EventArgs e)
        {
            clsBrand brand1 = new clsBrand();

            brand1.Name = txtBrandName.Text;
            clsBrandCollection brand = new clsBrandCollection();
            int i = brand.setBrand(brand1);

            if (i != 0)
            {
                MessageBox.Show("Data Saved");
                txtBrandName.Clear();
                GetBrands();
                BrandsName();
            }
            else
            {
                MessageBox.Show("Failed to Inert Data.");
            }
        }