private void buttonX2_Click(object sender, EventArgs e)
        {
            QuanHeCtrl QH = new QuanHeCtrl();

            QLKTX.Dialog.DiaLog_Them_Sua_QuanHe qh = new QLKTX.Dialog.DiaLog_Them_Sua_QuanHe();

            qh.StartPosition = FormStartPosition.Manual;
            qh.Left          = this.Location.X + groupThongTin.Location.X + groupThanNhan.Location.X + btnThemTonGiao.Location.X;
            qh.Top           = this.Location.Y + groupThongTin.Location.Y + groupThanNhan.Location.Y;

            qh.ShowDialog();

            QH.LayComboboxQuanHe(cmbQuanHeThanNhan);
            cmbQuanHeThanNhan.SelectedIndex = qh.Index;
        }
Exemple #2
0
        private void btnThem_Click(object sender, EventArgs e)
        {
            if (!boolThem)//Chua chon
            {
                btnThem.Text = "Lưu";
                QLKTX.Controller.QuanHeCtrl qh = new QuanHeCtrl();
                txtMa.Text     = qh.LayMaMax().ToString();
                txtTen.Enabled = true;

                btnSua.Enabled = false;
                btnXoa.Enabled = false;

                btnKetThuc.Text = "Bỏ qua";
                txtTen.Text     = "";
                txtTen.Focus();
                boolThem = true;
            }
            else
            {
                if (txtTen.Text == "")
                {
                    MessageBox.Show("Nhập Tên! Nhâp lại", "Luu", MessageBoxButtons.OK);
                    txtTen.Focus();
                }
                else
                {
                    //Goi ham cap nhat
                    QuanHeInfo qh = new QuanHeInfo();
                    qh.MaQuanHe  = Convert.ToInt32(txtMa.Text);
                    qh.TenQuanHe = txtTen.Text;

                    //Lưu
                    ctrl.ThemQuanHe(qh);
                    boolThem = false;
                    ctrl.DataTableToListView(listQuanHe);


                    btnThem.Text    = "Thêm";
                    btnSua.Enabled  = true;
                    btnXoa.Enabled  = true;
                    btnKetThuc.Text = "Kết thúc";
                    boolThem        = false;
                }
            }
        }
        private void frmSuaSinhVien_Load(object sender, EventArgs e)
        {
            QuocTichCtrl QT = new QuocTichCtrl();
            TonGiaoCtrl  TG = new TonGiaoCtrl();
            DanTocCtrl   DT = new DanTocCtrl();

            QuanHeCtrl     QH = new QuanHeCtrl();
            NgheNghiepCtrl NN = new NgheNghiepCtrl();

            QT.LayComboboxQuocTich(cmbQuocTich);
            TG.LayComboboxTonGiao(cmbTonGiao);
            DT.LayComboboxDanToc(cmbDanToc);

            QH.LayComboboxQuanHe(cmbQuanHeThanNhan);
            NN.LayComboboxNgheNghiep(cmbNgheNghiepThanNhan);

            ctrl.LayDSSVLenListView_Sua(listSinhVien);
        }
        private void frmThemSinhVien_Load(object sender, EventArgs e)
        {
            QuocTichCtrl QT = new QuocTichCtrl();
            TonGiaoCtrl  TG = new TonGiaoCtrl();
            DanTocCtrl   DT = new DanTocCtrl();

            QuanHeCtrl     QH = new QuanHeCtrl();
            NgheNghiepCtrl NN = new NgheNghiepCtrl();

            QT.LayComboboxQuocTich(cmbQuocTich);
            TG.LayComboboxTonGiao(cmbTonGiao);
            DT.LayComboboxDanToc(cmbDanToc);

            QH.LayComboboxQuanHe(cmbQuanHeThanNhan);
            NN.LayComboboxNgheNghiep(cmbNgheNghiepThanNhan);

            txtMaKTX.Text = SVCtrl.LayMaKTX();
        }