private void BtnManHinh_Click(object sender, EventArgs e)
        {
            if (txtMaSV.Text.Trim() == "")
            {
                MessageBox.Show("Vui lòng nhập mã sinh viên!", "", MessageBoxButtons.OK);
                txtMaSV.Focus();
                return;
            }
            maSV = txtMaSV.Text;
            // check if maSV is exists
            formSinhVien formSV           = new formSinhVien();
            int          checkMasvIsExist = formSV.kiemTraSinhVienTonTai(maSV);

            if (checkMasvIsExist == 1)
            {
                gctrl_sP_PhieuDiemSinhVien.Enabled = true;

                sP_PhieuDiemSinhVienTableAdapter.Connection.ConnectionString = Program.connstr;
                sP_PhieuDiemSinhVienTableAdapter.Fill(this.qLDSVROOT.SP_PhieuDiemSinhVien, maSV);
            }
            else
            {
                MessageBox.Show("Mã sinh viên không tồn tại!\nVui lòng nhập lại.", "", MessageBoxButtons.OK);
                txtMaSV.Focus();
                return;
            }
        }
Ejemplo n.º 2
0
        private void BtnSinhVien_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Form frm = this.CheckExists(typeof(formSinhVien));

            if (frm != null)
            {
                frm.Activate();
            }
            else
            {
                formSinhVien f = new formSinhVien();
                f.MdiParent = this;
                f.Show();
            }
        }
Ejemplo n.º 3
0
 private void BtnCL_Click_2(object sender, EventArgs e)
 {
     try
     {
         int check = checkSVCoDiemTonTai(txtMaSV.Text);
         if (check == 1)
         {
             MessageBox.Show("Sinh viên đã có điểm! Không được chuyển lớp.\n", "", MessageBoxButtons.OK);
         }
         else if (check == 2)
         {
             MessageBox.Show("Sinh viên đã nghĩ học không được chuyển lớp.\n", "", MessageBoxButtons.OK);
         }
         else
         {
             if (Program.conn.State == ConnectionState.Closed)
             {
                 Program.conn.Open();
             }
             String maLop          = comboKhacKhoaLop.SelectedValue.ToString();
             String updateSinhVien = "SP_UpdateSinhVienSiteKhac";
             Program.sqlcmd             = Program.conn.CreateCommand();
             Program.sqlcmd.CommandType = CommandType.StoredProcedure;
             Program.sqlcmd.CommandText = updateSinhVien;
             cmdSinhVien(txtMaSV.Text, txtHo.Text, txtTen.Text, maLop, cbPhai.Checked,
                         comboNgaySinh.Text, txtNoiSinh.Text, txtDiaChi.Text, cbNghiHoc.Checked);
             Program.sqlcmd.ExecuteNonQuery();
             Program.conn.Close();
             MessageBox.Show("Chuyển lớp thành công!", "", MessageBoxButtons.OK);
             this.Hide();
             this.Close();
             formSinhVien frm = new formSinhVien();
             frm.formSinhVien_Load(sender, e);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Lỗi.\n" + ex.Message, "", MessageBoxButtons.OK);
         return;
     }
 }