Пример #1
0
        private void btnQLLHP_Click(object sender, EventArgs e)
        {
            flowLayoutPanel1.Controls.Clear();
            //frmBanHang frm = new frmBanHang();
            frmQLLHP frm = new frmQLLHP();

            frm.TopLevel = false;
            flowLayoutPanel1.Controls.Add(frm);
            // frm.Dock = DockStyle.Fill;
            frm.Size = new System.Drawing.Size(flowLayoutPanel1.Size.Width, flowLayoutPanel1.Size.Height);
            frm.Show();
        }
Пример #2
0
        private void btnXoa_Click(object sender, EventArgs e)
        {
            string ma = txtMaLHP.Text;

            busLopHocPhan.DeleteLopHocPhan(ma);
            MessageBox.Show("xoa thanh cong");
            this.Hide();
            Form nk = new frmQLLHP();

            nk.Show();
            //  dgvLHP.DataSource = busLopHocPhan.getLopHocPhan();
            // label14.DataBindings.Add("Text", busLopHocPhan.soluong(), "a", true);
        }
Пример #3
0
 private void btnSua_Click(object sender, EventArgs e)
 {
     try
     {
         string        ma  = txtMaLHP.Text;
         string        ph  = txtPhongHoc.Text;
         string        sv  = txtTongSV.Text;
         int           bd  = int.Parse(cboTietBatDau.Text);
         int           kt  = int.Parse(cboTietKetThuc.Text);
         string        th  = cboThu.Text;
         string        hp  = cboTenHocPhan.Text;
         string        gv  = cboTenGV.Text;
         string        hk  = cboTenHK.Text;
         tblLopHocPhan lhp = new tblLopHocPhan(ma, ph, sv, bd, kt, th, hp, gv, hk);
         busLopHocPhan.InsertLopHocPhan(lhp);
         MessageBox.Show("them thanh cong");
         this.Hide();
         Form nk = new frmQLLHP();
         nk.Show();
     }
     catch
     {
         string        ma  = txtMaLHP.Text;
         string        ph  = txtPhongHoc.Text;
         string        sv  = txtTongSV.Text;
         int           bd  = int.Parse(cboTietBatDau.Text);
         int           kt  = int.Parse(cboTietKetThuc.Text);
         string        th  = cboThu.Text;
         string        hp  = cboTenHocPhan.Text;
         string        gv  = cboTenGV.Text;
         string        hk  = cboTenHK.Text;
         tblLopHocPhan lhp = new tblLopHocPhan(ma, ph, sv, bd, kt, th, hp, gv, hk);
         busLopHocPhan.UpdateLopHocPhan(lhp);
         MessageBox.Show("sua thanh cong");
         dgvLHP.DataSource = busLopHocPhan.getLopHocPhan();
         // dgvLHP.DataSource = busLopHocPhan.getLopHocPhan();
     }
 }