Пример #1
0
        private void BtnDelete_Click(object sender, EventArgs e)
        {
            var result = MessageBox.Show(@"Delete?", @"Delete", MessageBoxButtons.YesNo);

            if (result == DialogResult.Yes)
            {
                brand.DeleteBrand(brandid);
                FillGrid();
            }
        }
        protected void BtbDelete_Click(object sender, EventArgs e)
        {
            Brand brand = new Brand();
            int   id    = Convert.ToInt32(hiddenField1.Value);

            if (brand.DeleteBrand(id))
            {
                StatusLbl.Text = "delete has done successfully";
                FillGridView();
                txtName.Text        = "";
                StatusLbl.ForeColor = System.Drawing.Color.Green;
            }
            else
            {
                StatusLbl.Text      = "failed to delete customer ";
                StatusLbl.ForeColor = System.Drawing.Color.Red;
            }
        }