Ejemplo n.º 1
0
 private void load_cboLop()
 {
     cboLop.Properties.DataSource    = LOP_BUS.LayLopTheoNamHoc(NAMHOC_BUS.LayNamHocHienTai().MANAMHOC);
     cboLop.Properties.DisplayMember = "TENLOP";
     cboLop.Properties.ValueMember   = "MALOP";
     cboLop.EditValue = null;
 }
Ejemplo n.º 2
0
        private void btnHoanTat_Click(object sender, EventArgs e)
        {
            string maLop  = txtMaLop.Text;
            string tenLop = txtTenLop.Text;
            string maKhoi = cboKhoiLop.EditValue.ToString();

            try
            {
                if (btnHoanTat.Text == "Lưu")
                {
                    LOP_BUS.Insert(maLop, tenLop, maKhoi);
                    load_DSLop();
                    bindingNavigatorLop.BindingSource.MoveLast();
                }
                else
                {
                    LOP_BUS.Update(maLop, tenLop, maKhoi);
                    load_DSLop();
                }
                btnHoanTat.Visible = false;
                btnHuyBo.Visible   = false;
                txtTenLop.ReadOnly = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            bindingNavigatorAddNewItem.Enabled = true;
        }
Ejemplo n.º 3
0
 private void bindingNavigatorDelete_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Bạn có chắc chắn xóa lớp này không?", "DELETE", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         string maLop = txtMaLop.Text;
         LOP_BUS.Delete(maLop);
         load_DSLop();
     }
 }
Ejemplo n.º 4
0
 private void txtTimKiem_TextChanged(object sender, EventArgs e)
 {
     if (rbtnMaLop.Checked == true)
     {
         bindingSourceLop.DataSource = LOP_BUS.timLopTheoMaLop(txtTimKiem.Text);
     }
     else
     {
         bindingSourceLop.DataSource = LOP_BUS.timLopTheoTen(txtTimKiem.Text);
     }
 }
 private void load_cboLop()
 {
     if (cboKhoiLop.Text != "")
     {
         string maKhoi = cboKhoiLop.EditValue.ToString();
         cboLop.Properties.DataSource    = LOP_BUS.LayLopTheoKhoi(maKhoi);
         cboLop.Properties.DisplayMember = "TENLOP";
         cboLop.Properties.ValueMember   = "MALOP";
     }
     else
     {
         cboLop.Properties.DataSource = null;
     }
 }
 private void load_cboLop()
 {
     if (cboNamHoc.Text != "")
     {
         cboLop.Properties.DataSource    = LOP_BUS.LayLopTheoNamHoc(cboNamHoc.EditValue.ToString());
         cboLop.Properties.DisplayMember = "TENLOP";
         cboLop.Properties.ValueMember   = "MALOP";
         cboLop.EditValue = null;
     }
     else
     {
         cboLop.Properties.DataSource = null;
     }
 }
Ejemplo n.º 7
0
        private void bindingNavigatorAdd_Click(object sender, EventArgs e)
        {
            dockPanelChucNang.Visibility  = DevExpress.XtraBars.Docking.DockVisibility.Visible;
            navPanelChucNang.SelectedPage = navNhapLieu;

            bindingNavigatorAddNewItem.Enabled = false;
            btnHoanTat.Visible   = true;
            btnHuyBo.Visible     = true;
            btnHoanTat.Text      = "Lưu";
            txtMaLop.Text        = LOP_BUS.autoMaLop();
            txtTenLop.Text       = "";
            cboKhoiLop.EditValue = null;
            txtTenLop.ReadOnly   = false;
            cboKhoiLop.ReadOnly  = false;
            txtTenLop.Focus();
        }
Ejemplo n.º 8
0
 private void load_cboLop()
 {
     cboLop.DataSource    = LOP_BUS.LayTatCaLop();
     cboLop.DisplayMember = "TENLOP";
     cboLop.ValueMember   = "MALOP";
 }
Ejemplo n.º 9
0
        private void load_DSLop()
        {
            string maNamHoc = cboNamHoc.EditValue.ToString();

            bindingSourceLop.DataSource = LOP_BUS.LayLopTheoNamHoc(maNamHoc);
        }