Пример #1
0
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            BUSDoiTac b = new BUSDoiTac();
            DTOKhuVuc d = new DTOKhuVuc();

            d.MaKhuVuc  = textEdit1.Text;
            d.TenKhuVuc = textEdit2.Text;
            d.GhiChu    = textEdit3.Text;
            d.ConQuanLy = checkEdit1.Checked;

            if (isAddForm)
            {
                if (b.insertKhuVuc(d))
                {
                    MessageBox.Show("Thao tác thành công");
                }
                else
                {
                    MessageBox.Show("Thao tác không thành công");
                }
            }
            else
            {
                b.updateKhuVuc(d);
                MessageBox.Show("Thao tác hóa thành công");
            }
        }