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

            quytrinh.maQTXLSC      = txtMaQT.Text;
            quytrinh.tenQTXLSC     = txtTenQT.Text;
            quytrinh.noidungQTXLSC = 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;
            }
            DBQuyTrinhXLSC dbquytrinh = new DBQuyTrinhXLSC();

            if (isNewQT)
            {
                dbquytrinh.addnewQuyTrinh(quytrinh, false);
            }
            else
            {
                dbquytrinh.addnewQuyTrinh(quytrinh, true);
            }
            dbquytrinh.updateGridData(dataGridQuyTrinh);
        }
Пример #2
0
        public FQuyTrinhXuLySuCo()
        {
            InitializeComponent();
            DBQuyTrinhXLSC quytrinh = new DBQuyTrinhXLSC();

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

            nv.updateComboBoxTenOnly(cbNguoiViet);
        }