Пример #1
0
        private void updateDB(bool isNewQT)
        {
            QuyTrinhBT quytrinh = new QuyTrinhBT();

            quytrinh.maQTBT       = txtMaQT.Text;
            quytrinh.tenQTBT      = txtTenQT.Text;
            quytrinh.noidungQT    = rtbNoidung.Text;
            quytrinh.tennguoiviet = cbNguoiViet.GetItemText(cbNguoiViet.SelectedItem);

            if ((txtMaQT.Text == "") || (txtTenQT.Text == "") || (cbNguoiViet.Text == ""))
            {
                MessageBox.Show(this, "Vui Long Dien Ma, TenQT Va Ten Nguoi Viet", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            DBQuyTrinhBT dbquytrinh = new DBQuyTrinhBT();

            if (isNewQT)
            {
                dbquytrinh.addnewQuyTrinh(quytrinh, false);
            }
            else
            {
                dbquytrinh.addnewQuyTrinh(quytrinh, true);
            }
            dbquytrinh.updateGridData(dataGridQuyTrinh);
        }
Пример #2
0
        private void btnXoa_Click(object sender, EventArgs e)
        {
            DBQuyTrinhBT dbquytrinh = new DBQuyTrinhBT();

            dbquytrinh.removeQuyTrinh(txtMaQT.Text);
            dbquytrinh.updateGridData(dataGridQuyTrinh);
            resetTxt();
        }
Пример #3
0
        public FQuyTrinhBaoTri()
        {
            InitializeComponent();
            DBQuyTrinhBT quytrinh = new DBQuyTrinhBT();

            quytrinh.updateGridData(dataGridQuyTrinh);
            DBNhanVien nv = new DBNhanVien();

            nv.updateComboBoxTenOnly(cbNguoiViet);
        }