예제 #1
0
        private void HienThi_Nut()
        {
            LaySiSoLop();
            DataTable dsTam = new DataTable();

            QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider = new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
            string sSql;

            sSql  = "select * from thamso where mathamso='TS3' ";
            dsTam = provider.LayDanhSach(sSql);
            int sohs_toida;

            sohs_toida = Convert.ToInt32(dsTam.DefaultView[0].Row["giatri"].ToString());
            int so = sohs - 1;

            if (so >= sohs_toida)
            {
                btnTiepNhan.Enabled = false;
                btnXoa.Enabled      = false;
                btnCapNhat.Enabled  = false;
            }
            else
            {
                btnTiepNhan.Enabled = true;
                btnXoa.Enabled      = false;
                btnCapNhat.Enabled  = false;
            }
        }
예제 #2
0
        private void dataDS_Click(object sender, System.EventArgs e)
        {
            btnXoa.Enabled      = true;
            btnCapNhat.Enabled  = true;
            btnTiepNhan.Enabled = false;
            khoitao_textbox();
            txtMaso.Text     = "";
            cboGioiTinh.Text = "";
            string sSql;
            string sMaHS = dataDS[dataDS.CurrentCell.RowNumber, 0].ToString();

            sSql = "select * from hocsinh where MAHS='" + sMaHS + "'";
            DataTable dsHS = new DataTable();

            QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider = new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
            dsHS = provider.LayDanhSach(sSql);
            //gan du lieu vao cac textbox
            txtMaso.Text             = dsHS.Rows[0]["MAHS"].ToString();
            txtDiaChi.Text           = dsHS.Rows[0]["DIACHI"].ToString();
            txtEmail.Text            = dsHS.Rows[0]["EMAIL"].ToString();
            txtHoTen.Text            = dsHS.Rows[0]["HOTEN"].ToString();
            cboGioiTinh.SelectedText = dsHS.Rows[0]["PHAI"].ToString();
            dtpNgaySinh.Value        = Convert.ToDateTime(dsHS.Rows[0]["NGAYSINH"].ToString());
            HienThi_Nut();
            btnCapNhat.Enabled  = true;
            btnXoa.Enabled      = true;
            btnTiepNhan.Enabled = false;
            //MessageBox.Show("'"+dataDS[dataDS.CurrentCell.RowNumber,0]+"'");
        }
예제 #3
0
        private int kiemtra_ngaysinh()
        {
            DataTable dsTam = new DataTable();

            QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider = new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
            string sSql;

            sSql  = "select * from thamso ";
            dsTam = provider.LayDanhSach(sSql);
            int    tuoitoithieu = 0, tuoitoida = 0, giatri = 0;
            string mathamso;

            for (int i = 0; i < dsTam.DefaultView.Count; i++)
            {
                mathamso = dsTam.DefaultView[i].Row["mathamso"].ToString();
                giatri   = Convert.ToInt32(dsTam.DefaultView[i].Row["giatri"].ToString());
                if (mathamso == "TS1")
                {
                    tuoitoithieu = giatri;
                }
                if (mathamso == "TS2")
                {
                    tuoitoida = giatri;
                }
            }
            int tuoi = DateTime.Now.Year - dtpNgaySinh.Value.Year;

            if (tuoi < tuoitoithieu || tuoi > tuoitoida)
            {
                MessageBox.Show("Học sinh " + tuoi + " tuổi . Không thoả qui định !", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(0);
            }
            return(1);
        }
예제 #4
0
        private void LayBangDiem()
        {
            DataColumn cot;
            DataTable  dsHS = new DataTable();
            string     sSql;

            sSql = "select MAHS from hocsinh where MALOP='" + cboLop.SelectedValue + "'";
            //QUANLYHOCSINHCAP3.HOCSINH.HocSinhData HSData=new QUANLYHOCSINHCAP3.HOCSINH.HocSinhData();
            //dsHS= HSData.GetDanhSachHocSinh(sSql);
            QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider = new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
            dsHS      = provider.LayDanhSach(sSql);
            sohocsinh = dsHS.DefaultView.Count;
            //tao cot Điểm 15 phút
            cot            = new DataColumn();
            cot.ColumnName = "Điểm 15 phút";
            cot.DataType   = Type.GetType("System.Double");
            dsHS.Columns.Add(cot);
            //tao cot Điểm 1tiet
            cot            = new DataColumn();
            cot.ColumnName = "Điểm 1 tiết";
            cot.DataType   = Type.GetType("System.Double");
            dsHS.Columns.Add(cot);
            //tao cot Điểm 1tiet
            cot            = new DataColumn();
            cot.ColumnName = "Điểm cuối HK";
            cot.DataType   = Type.GetType("System.Double");
            dsHS.Columns.Add(cot);
            dataBD.DataSource = dsHS;
            khoitao();
        }
예제 #5
0
        private void GetDanhSachMonHoc()
        {
            //string strSql="select * from monhoc where mamon not in(select mamonhoc from diemmon d,hocsinh h where h.mahs=d.mahocsinh and h.malop='"+cboLop.SelectedValue+"'and d.mahocky='"+cboHocky.SelectedValue+"' ) ";
            //QUANLYHOCSINHCAP3.MONHOC.MonHocData monhoc = new QUANLYHOCSINHCAP3.MONHOC.MonHocData();
            //cboMon.DataSource = monhoc.GetDanhSachMonHoc(strSql);
            string strSql = "select * from monhoc  ";

            QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider = new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
            cboMon.DataSource    = provider.LayDanhSach(strSql);
            cboMon.DisplayMember = "TENMON";
            cboMon.ValueMember   = "MAMON";

            /*if(cboMon.Text=="")
             * {
             *      btnLuu.Enabled=false;
             *      strSql="select * from monhoc";
             *      cboMon.DataSource=provider.LayDanhSach(strSql);
             *      cboMon.DisplayMember = "TENMON";
             *      cboMon.ValueMember = "MAMON";
             *      btnCapNhat.Enabled=true;
             *      btnXoa.Enabled=true;
             * }
             * else
             * {
             *      btnLuu.Enabled=true;
             *      btnCapNhat.Enabled=false;
             *      btnXoa.Enabled=false;
             * }*/
        }
예제 #6
0
 private void btnThoat_Click(object sender, System.EventArgs e)
 {
     QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider = new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
     //cboKhoi.DataSource=provider.LayDanhSach(strSql);
     provider.Disconnect();
     this.Close();
 }
예제 #7
0
        private void Getdanhsachlop()
        {
            string strSql = "select * from lop ";

            QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider = new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
            cboLop.DataSource    = provider.LayDanhSach(strSql);
            cboLop.DisplayMember = "TENLOP";
            cboLop.ValueMember   = "MALOP";
        }
예제 #8
0
        private void LaySiSoLop()
        {
            string    strSql = "select Siso from lop where malop='" + cboLop.SelectedValue + "'";
            DataTable dsHS   = new DataTable();

            QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider = new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
            dsHS         = provider.LayDanhSach(strSql);
            txtSiSo.Text = "";
            txtSiSo.Text = dsHS.Rows[0]["Siso"].ToString();
        }
예제 #9
0
        private void GetDanhSachKhoi()
        {
            string strSql = "select * from KHOI";

            //QUANLYHOCSINHCAP3.KHOI.KhoiData khoi=new QUANLYHOCSINHCAP3.KHOI.KhoiData();
            //cboKhoi.DataSource=khoi.GetDanhSachKhoi(strSql);
            QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider = new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
            cboKhoi.DataSource    = provider.LayDanhSach(strSql);
            cboKhoi.ValueMember   = "MAKHOI";
            cboKhoi.DisplayMember = "TENKHOI ";
        }
예제 #10
0
        private void GetDanhSachHocSinh()
        {
            DataTable dsHS = new DataTable();
            string    sSql;

            sSql = "select MAHS , HOTEN from hocsinh where MALOP='" + cboLop.SelectedValue + "'";
            QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider = new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
            dsHS = provider.LayDanhSach(sSql);
            dataDS.DataSource = dsHS;
            sohs         = dsHS.DefaultView.Count + 1;
            txtMaso.Text = Tao_MaHS();
        }
예제 #11
0
        private void GetDanhSachHocKi()
        {
            string strSql = "select * from hocki ";

            //QUANLYHOCSINHCAP3.HOCKY.HocKyData hocki = new QUANLYHOCSINHCAP3.HOCKY.HocKyData();
            //cboHocky.DataSource = hocki.GetDanhSachHocKi(strSql);
            QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider = new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
            cboHocky.DataSource    = provider.LayDanhSach(strSql);
            cboHocky.DisplayMember = "MAHOCKI";
            cboHocky.ValueMember   = "MAHOCKI";
            //LayBaoCaoMon();
        }
예제 #12
0
        private void GetDanhSachMonHoc()
        {
            string strSql = "select * from monhoc ";

            //QUANLYHOCSINHCAP3.MONHOC.MonHocData monhoc = new QUANLYHOCSINHCAP3.MONHOC.MonHocData();
            //cboMon.DataSource = monhoc.GetDanhSachMonHoc(strSql);
            QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider = new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
            cboMon.DataSource = provider.LayDanhSach(strSql);

            cboMon.DisplayMember = "TENMON";
            cboMon.ValueMember   = "MAMON";
        }
예제 #13
0
        private void GetDanhSachThamSo()
        {
            DataTable dsTS = new DataTable();
            string    sSql;

            sSql = "select mathamso as MATS,tenthamso AS TENTS from thamso";
            QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider = new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
            dsTS = provider.LayDanhSach(sSql);
            dataDS.DataSource = dsTS;
            sots         = dsTS.DefaultView.Count + 1;
            txtMaso.Text = "TS" + sots.ToString();
        }
예제 #14
0
        private void Tracuu()
        {
            string sSql;
            string sMaHS = txtMaHS.Text;

            sSql = "select * from hocsinh where MAHS='" + sMaHS + "'";
            DataTable dsHS = new DataTable();

            QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider = new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
            dsHS = provider.LayDanhSach(sSql);
            dataThongTinHocSinh.DataSource = dsHS;
            LayBangDiem();
        }
예제 #15
0
        private void DangNhap()
        {
            QUANLYHOCSINHCAP3.KNCSDL.DataProvider.Username = txtUsername.Text;
            QUANLYHOCSINHCAP3.KNCSDL.DataProvider.Password = txtPasswd.Text;
            QUANLYHOCSINHCAP3.KNCSDL.DataProvider.Service  = txtService.Text;
            QUANLYHOCSINHCAP3.KNCSDL.DataProvider _provider = new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
            string path = "Provider=MSDAORA.1;Data Source= " + txtService.Text + ";User ID=" + txtUsername.Text + ";Password="******";Persist Security Info=True";

            QUANLYHOCSINHCAP3.KNCSDL.DataProvider.ConnectionString = path;
            _provider.connect();
            if (_provider.flag == 1)
            {
                ((Form1)MdiParent).ShowMenu(true);
                this.Close();
            }
            else
            {
                MessageBox.Show("Không kết nối Oracle được !!!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtUsername.Text = "";
                txtUsername.Focus();
                return;
            }

            /*	if(txtMatKhau.Text=="")
             *      {
             *
             *              MessageBox.Show("Bạn phải nhập mật khẩu","Thông báo",MessageBoxButtons.OK,MessageBoxIcon.Information);
             *              txtMatKhau.Focus();
             *              return;
             *      }
             *      else
             *      {
             *              if(txtMatKhau.Text!="123")
             *              {
             *                      MessageBox.Show("Bạn nhập sai mật khẩu","Thông báo",MessageBoxButtons.OK,MessageBoxIcon.Error);
             *                      txtMatKhau.Text="";
             *                      txtMatKhau.Focus();
             *                      return;
             *              }
             *              else
             *              {
             *                      ((Form1)MdiParent).ShowMenu(true);
             *                      this.Close();
             *              }
             *      }*/
        }
예제 #16
0
        private int Lay_MaDiemMon(string mahs, string mahocky, string mamon)
        {
            DataTable dsTam = new DataTable();

            QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider = new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
            string sSql;

            sSql  = "select madiemmon from diemmon where mahocsinh='" + mahs + "' and mahocky='" + mahocky + "' and mamonhoc='" + mamon + "'";
            dsTam = provider.LayDanhSach(sSql);
            int madiemmon = 0;

            if (dsTam.DefaultView.Count != 0)
            {
                madiemmon = Convert.ToInt32(dsTam.DefaultView[0].Row["madiemmon"].ToString());
            }
            return(madiemmon);
        }
예제 #17
0
        private void dataDS_Click(object sender, System.EventArgs e)
        {
            btnCapnhat.Enabled = true;
            btnThem.Enabled    = false;
            string sSql;
            string MaTS = dataDS[dataDS.CurrentCell.RowNumber, 0].ToString();

            sSql = "select * from thamso where mathamso='" + MaTS + "'";
            DataTable dsTS = new DataTable();

            QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider = new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
            dsTS = provider.LayDanhSach(sSql);
            //gan du lieu vao cac textbox
            txtMaso.Text      = dsTS.Rows[0]["MATHAMSO"].ToString();
            txtTenThamSo.Text = dsTS.Rows[0]["TENTHAMSO"].ToString();
            txtGiaTri.Text    = dsTS.Rows[0]["GIATRI"].ToString();
            txtGhichu.Text    = dsTS.Rows[0]["GHICHU"].ToString();
        }
예제 #18
0
        private void btnThoat_Click(object sender, System.EventArgs e)
        {
            DialogResult nut;

            QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider = new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
            if (Kiemtra_Thoat() == 1)
            {
                provider.Disconnect();
                this.Close();
            }
            else
            {
                nut = MessageBox.Show("Bạn có muốn lưu trước khi thoát không ? ", "Thông báo", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information);
                if (nut == DialogResult.Yes)
                {
                    if (btnTiepNhan.Enabled == false)
                    {
                        if (btnCapNhat.Enabled == true)
                        {
                            if (kiemtra() == 1)
                            {
                                CapNhat();
                                provider.Disconnect();
                                this.Close();
                            }
                        }
                    }
                    else
                    {
                        if (kiemtra() == 1)
                        {
                            Luu();
                            provider.Disconnect();
                            this.Close();
                        }
                    }
                }
                if (nut == DialogResult.No)
                {
                    provider.Disconnect();
                    this.Close();
                }
            }
        }
예제 #19
0
        private void LayBangDiem()
        {
            DataColumn cot;
            DataTable  dsBangDiem = new DataTable();
            string     sSql;

            sSql = "select * from monhoc ";
            //QUANLYHOCSINHCAP3.MONHOC.MonHocData Monhoc_Data=new QUANLYHOCSINHCAP3.MONHOC.MonHocData();
            //dsBangDiem= Monhoc_Data.GetDanhSachMonHoc(sSql);
            QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider = new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
            dsBangDiem = provider.LayDanhSach(sSql);
            int soluongmon = dsBangDiem.DefaultView.Count;

            /*//tao cot HK
             * cot = new DataColumn();
             * cot.ColumnName=" Học Kỳ";
             * cot.DataType=Type.GetType("System.String");
             * dsLop.Columns.Add(cot);*/
            //tao cot TBHK1
            cot            = new DataColumn();
            cot.ColumnName = "TBHK1";

            cot.DataType = Type.GetType("System.String");
            dsBangDiem.Columns.Add(cot);
            //tao cot TBHK2'
            cot            = new DataColumn();
            cot.ColumnName = "TBHK2";

            cot.DataType = Type.GetType("System.String");
            dsBangDiem.Columns.Add(cot);
            dataBDiem.DataSource = dsBangDiem;
            int    i;
            string ma_mon, trungbinh;

            for (i = 0; i < soluongmon; i++)
            {
                ma_mon          = dsBangDiem.Rows[i][0].ToString();
                trungbinh       = LayTrungBinhMon(ma_mon, "HK1");
                dataBDiem[i, 2] = trungbinh.ToString();
                trungbinh       = LayTrungBinhMon(ma_mon, "HK2");
                dataBDiem[i, 3] = trungbinh.ToString();
            }
        }
예제 #20
0
        private string Tao_MaHS()
        {
            DataTable dsTam = new DataTable();

            QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider = new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
            string sSql;

            sSql  = "select mahs from hocsinh where malop='" + cboLop.SelectedValue + "' order by mahs asc";
            dsTam = provider.LayDanhSach(sSql);
            string mahs, s, tam;

            s   = cboLop.SelectedValue.ToString();
            tam = s;
            int j = 1, i;

            for (i = 0; i < dsTam.DefaultView.Count; i++)
            {
                mahs = dsTam.DefaultView[i].Row["mahs"].ToString();
                if (mahs == (tam + "_" + j.ToString()))
                {
                    s = mahs;
                }
                else
                {
                    s = tam + "_" + j.ToString();
                    //s=s+1;

                    break;
                }
                j++;
            }
            i = j - 1;
            if (s == cboLop.SelectedValue.ToString())
            {
                s = s + "_1";
            }

            else if (s == tam + "_" + i.ToString())
            {
                s = tam + "_" + j.ToString();
            }
            return(s);
        }
예제 #21
0
        private void btnBaoCao_Click(object sender, System.EventArgs e)
        {
            QUANLYHOCSINHCAP3.KNCSDL.DataProvider _provider = new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();

            if (nflag == 1)
            {
                BANGDIEM.RptBangDiemHS rpt = new QUANLYHOCSINHCAP3.BANGDIEM.RptBangDiemHS();
                rpt.SetDatabaseLogon(username, password);
                rpt.SetParameterValue("pMaHS", txtMaHS.Text);
                crystalReportViewer1.ReportSource = rpt;
            }
            if (nflag == 0)
            {
                BANGDIEM.RptDSHS rpt = new QUANLYHOCSINHCAP3.BANGDIEM.RptDSHS();
                rpt.SetDatabaseLogon(username, password);
                rpt.SetParameterValue("pLop", (string)cboLop.SelectedValue);
                rpt.SetParameterValue("pMamon", (string)cboMon.SelectedValue);
                crystalReportViewer1.ReportSource = rpt;
            }
            if (nflag == 2)
            {
                string         MaHK = (string)cboHocky.SelectedValue;
                RptBaocaoHocki rpt  = new RptBaocaoHocki();
                rpt.SetDatabaseLogon(username, password);
                rpt.SetParameterValue("pMaHK", MaHK);
                crystalReportViewer1.ReportSource = rpt;
            }
            if (nflag == 4)
            {
                BaoCaoTheoMon rpt = new BaoCaoTheoMon();
                rpt.SetDatabaseLogon(username, password);
                rpt.SetParameterValue("pMaHK", (string)cboHocky.SelectedValue);
                rpt.SetParameterValue("pMaMon", (string)cboMon.SelectedValue);
                crystalReportViewer1.ReportSource = rpt;
            }
            //CACH EXPORT VO WORD

            /*SaveFileDialog dlg = new SaveFileDialog ();
             * if (dlg.ShowDialog()==DialogResult.OK)
             *      rpt.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.WordForWindows,dlg.FileName) ;*/
        }
예제 #22
0
        private int kiemtra()
        {
            DataTable dsTam = new DataTable();

            QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider = new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
            string sSql;

            sSql  = "select * from thamso ";
            dsTam = provider.LayDanhSach(sSql);
            int    diemtoithieu = 0, diemtoida = 0, giatri = 0;
            string mathamso;
            int    i, j;

            for (i = 0; i < dsTam.DefaultView.Count; i++)
            {
                mathamso = dsTam.DefaultView[i].Row["mathamso"].ToString();
                giatri   = Convert.ToInt32(dsTam.DefaultView[i].Row["giatri"].ToString());
                if (mathamso == "TS4")
                {
                    diemtoithieu = giatri;
                }
                if (mathamso == "TS5")
                {
                    diemtoida = giatri;
                }
            }

            for (i = 0; i < sohocsinh; i++)
            {
                for (j = 1; j < 4; j++)
                {
                    if (Convert.ToInt32(dataBD[i, j]) < diemtoithieu || Convert.ToInt32(dataBD[i, j]) > diemtoida)
                    {
                        return(0);
                    }
                }
            }
            return(1);
        }
예제 #23
0
        private int Tao_MaDiemMon()
        {
            DataTable dsTam = new DataTable();

            QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider = new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
            string sSql;

            sSql = "select madiemmon from diemmon order by madiemmon asc";

            dsTam = provider.LayDanhSach(sSql);
            int madiemmon = 0;
            int s         = 0;

            for (int i = 0; i < dsTam.DefaultView.Count; i++)
            {
                madiemmon = Convert.ToInt32(dsTam.DefaultView[i].Row["madiemmon"].ToString());
                if (madiemmon == (s + 1))
                {
                    s = madiemmon;
                }
                else
                {
                    s = s + 1;
                    break;
                }
            }

            if (s == 0)
            {
                s = s + 1;
            }

            else if (s == madiemmon)
            {
                s = s + 1;
            }
            return(s);
        }
예제 #24
0
        private string LayTrungBinhMon(string mamon, string hocky)
        {
            /*dsBDiem=new DataTable();
             * string sSql,trungbinh;
             * sSql = "select trungbinh from diemmon where mamonhoc='"+mamon+"' and mahocky='"+hocky+"' and mahocsinh='"+txtMaHS.Text+"'";
             * QUANLYHOCSINHCAP3.BANGDIEM.BangDiemData BDiemData=new QUANLYHOCSINHCAP3.BANGDIEM.BangDiemData();
             * dsBDiem= BDiemData.GetDanhSachDiemMon(sSql);
             *
             * trungbinh=dsBDiem.Rows[0][0].ToString();*/
            DataTable dsTam = new DataTable();

            QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider = new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
            string sSql;

            sSql  = "select trungbinh from diemmon where mamonhoc='" + mamon + "' and mahocky='" + hocky + "' and mahocsinh='" + txtMaHS.Text + "'";
            dsTam = provider.LayDanhSach(sSql);
            string trungbinh = "0.0";

            if (dsTam.DefaultView.Count != 0)
            {
                trungbinh = dsTam.DefaultView[0].Row["trungbinh"].ToString();
            }
            return(trungbinh);
        }
예제 #25
0
	private void GetDanhSachMonHoc()
	{
			string strSql="select * from monhoc ";
			//QUANLYHOCSINHCAP3.MONHOC.MonHocData monhoc = new QUANLYHOCSINHCAP3.MONHOC.MonHocData();
			//cboMon.DataSource = monhoc.GetDanhSachMonHoc(strSql);
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider=new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
			cboMon.DataSource=provider.LayDanhSach(strSql);
					
			cboMon.DisplayMember = "TENMON"; 
			cboMon.ValueMember = "MAMON";	
	}
예제 #26
0
		private void GetDanhSachMonHoc()
		{
			//string strSql="select * from monhoc where mamon not in(select mamonhoc from diemmon d,hocsinh h where h.mahs=d.mahocsinh and h.malop='"+cboLop.SelectedValue+"'and d.mahocky='"+cboHocky.SelectedValue+"' ) ";
			//QUANLYHOCSINHCAP3.MONHOC.MonHocData monhoc = new QUANLYHOCSINHCAP3.MONHOC.MonHocData();
			//cboMon.DataSource = monhoc.GetDanhSachMonHoc(strSql);
			string strSql="select * from monhoc  ";
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider=new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
			cboMon.DataSource=provider.LayDanhSach(strSql);
			cboMon.DisplayMember = "TENMON"; 
			cboMon.ValueMember = "MAMON";	
			/*if(cboMon.Text=="")
			{
				btnLuu.Enabled=false;
				strSql="select * from monhoc";
				cboMon.DataSource=provider.LayDanhSach(strSql);
				cboMon.DisplayMember = "TENMON"; 
				cboMon.ValueMember = "MAMON";	
				btnCapNhat.Enabled=true;
				btnXoa.Enabled=true;
			}
			else
			{
				btnLuu.Enabled=true;
				btnCapNhat.Enabled=false;
				btnXoa.Enabled=false;
			}*/
		}	
예제 #27
0
		private int Lay_MaDiemMon(string mahs,string mahocky,string mamon)
		{
			DataTable dsTam=new DataTable();
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider=new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
			string sSql;
			sSql = "select madiemmon from diemmon where mahocsinh='"+mahs+"' and mahocky='"+mahocky+"' and mamonhoc='"+mamon+"'";
			dsTam=provider.LayDanhSach(sSql);
			int madiemmon =0;
			if(dsTam.DefaultView.Count!=0)
				madiemmon=Convert.ToInt32(dsTam.DefaultView[0].Row["madiemmon"].ToString());
			return madiemmon;
		}
예제 #28
0
 private void btnThoat_Click(object sender, System.EventArgs e)
 {
     QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider = new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
     provider.Disconnect();
     this.Close();
 }
예제 #29
0
		private void dataDS_Click(object sender, System.EventArgs e)
		{
			btnCapnhat.Enabled=true;
			btnThem.Enabled=false;
			string sSql;
			string MaTS=dataDS[dataDS.CurrentCell.RowNumber,0].ToString();
			sSql = "select * from thamso where mathamso='"+MaTS+"'";
			DataTable dsTS=new DataTable();
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider=new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
			dsTS=provider.LayDanhSach(sSql);
			//gan du lieu vao cac textbox
			txtMaso.Text=dsTS.Rows[0]["MATHAMSO"].ToString();
			txtTenThamSo.Text=dsTS.Rows[0]["TENTHAMSO"].ToString();
			txtGiaTri.Text=dsTS.Rows[0]["GIATRI"].ToString();
			txtGhichu.Text=dsTS.Rows[0]["GHICHU"].ToString();
			
		}
예제 #30
0
	private void GetDanhSachHocKi()
	{
			string strSql="select * from hocki ";
			//QUANLYHOCSINHCAP3.HOCKY.HocKyData hocki = new QUANLYHOCSINHCAP3.HOCKY.HocKyData();
			//cboHocky.DataSource = hocki.GetDanhSachHocKi(strSql);
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider=new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
			cboHocky.DataSource=provider.LayDanhSach(strSql);
			cboHocky.DisplayMember ="MAHOCKI"; 
			cboHocky.ValueMember =  "MAHOCKI"; 
			//LayBaoCaoMon();
	}
예제 #31
0
		private void LayBangDiem()
		{
			DataColumn cot ;
			DataTable dsHS=new DataTable();
			string sSql;
			sSql = "select MAHS from hocsinh where MALOP='" + cboLop.SelectedValue + "'";
			//QUANLYHOCSINHCAP3.HOCSINH.HocSinhData HSData=new QUANLYHOCSINHCAP3.HOCSINH.HocSinhData();
			//dsHS= HSData.GetDanhSachHocSinh(sSql);
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider=new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
			dsHS=provider.LayDanhSach(sSql);
			sohocsinh=dsHS.DefaultView.Count;
			//tao cot Điểm 15 phút
			cot = new DataColumn();
			cot.ColumnName="Điểm 15 phút";
			cot.DataType=Type.GetType("System.Double");
			dsHS.Columns.Add(cot);
			//tao cot Điểm 1tiet
			cot = new DataColumn();
			cot.ColumnName="Điểm 1 tiết";
			cot.DataType=Type.GetType("System.Double");
			dsHS.Columns.Add(cot);
			//tao cot Điểm 1tiet
			cot = new DataColumn();
			cot.ColumnName="Điểm cuối HK";
			cot.DataType=Type.GetType("System.Double");
			dsHS.Columns.Add(cot);
			dataBD.DataSource =dsHS;
			khoitao();
			
		}
예제 #32
0
		private int kiemtra()
		{
			DataTable dsTam=new DataTable();
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider=new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
			string sSql;
			sSql = "select * from thamso ";
			dsTam=provider.LayDanhSach(sSql);
			int diemtoithieu=0,diemtoida=0,giatri=0;
			string mathamso;
			int i,j;
			for(i=0;i<dsTam.DefaultView.Count;i++)
			{
				mathamso=dsTam.DefaultView[i].Row["mathamso"].ToString();
				giatri=Convert.ToInt32(dsTam.DefaultView[i].Row["giatri"].ToString());
				if(mathamso=="TS4")
					diemtoithieu=giatri;
				if(mathamso=="TS5")
					diemtoida=giatri;
			}
			
			for(i=0;i<sohocsinh;i++)
			{
				
				for(j=1;j<4;j++)
					if(Convert.ToInt32(dataBD[i,j])<diemtoithieu ||Convert.ToInt32(dataBD[i,j])>diemtoida)
						return 0;
			}
			return 1;
		}
예제 #33
0
		private void GetDanhSachKhoi()
		{
			string strSql="select * from KHOI";
			//QUANLYHOCSINHCAP3.KHOI.KhoiData khoi=new QUANLYHOCSINHCAP3.KHOI.KhoiData();
			//cboKhoi.DataSource=khoi.GetDanhSachKhoi(strSql);
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider=new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
			cboKhoi.DataSource=provider.LayDanhSach(strSql);
			cboKhoi.ValueMember="MAKHOI";
			cboKhoi.DisplayMember="TENKHOI ";
			
		}
예제 #34
0
		private string LayTrungBinhMon(string mamon,string hocky)
		{
			/*dsBDiem=new DataTable();
			string sSql,trungbinh;
			sSql = "select trungbinh from diemmon where mamonhoc='"+mamon+"' and mahocky='"+hocky+"' and mahocsinh='"+txtMaHS.Text+"'";
			QUANLYHOCSINHCAP3.BANGDIEM.BangDiemData BDiemData=new QUANLYHOCSINHCAP3.BANGDIEM.BangDiemData();
			dsBDiem= BDiemData.GetDanhSachDiemMon(sSql);
				
			trungbinh=dsBDiem.Rows[0][0].ToString();*/
			DataTable dsTam=new DataTable();
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider=new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
			string sSql;
			sSql = "select trungbinh from diemmon where mamonhoc='"+mamon+"' and mahocky='"+hocky+"' and mahocsinh='"+txtMaHS.Text+"'";
			dsTam=provider.LayDanhSach(sSql);
			string trungbinh="0.0";
			if(dsTam.DefaultView.Count!=0)
				trungbinh=dsTam.DefaultView[0].Row["trungbinh"].ToString();
			return trungbinh;
			
			
			
		}
예제 #35
0
		private void Tracuu()
		{
			
			string sSql;
			string sMaHS=txtMaHS.Text;
			sSql = "select * from hocsinh where MAHS='" + sMaHS + "'";
			DataTable dsHS=new DataTable();
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider=new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
			dsHS=provider.LayDanhSach(sSql);
			dataThongTinHocSinh.DataSource = dsHS;
			LayBangDiem();

		}
예제 #36
0
		private string Tao_MaHS()
		{
			DataTable dsTam=new DataTable();
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider=new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
			string sSql;
			sSql = "select mahs from hocsinh where malop='"+cboLop.SelectedValue+"' order by mahs asc";
			dsTam=provider.LayDanhSach(sSql);
			string mahs ,s,tam;
			s=cboLop.SelectedValue.ToString();
			tam=s;
			int j=1,i;
			for( i=0;i<dsTam.DefaultView.Count;i++)
			{
				
				mahs=dsTam.DefaultView[i].Row["mahs"].ToString();
				if(mahs ==(tam+"_"+j.ToString()))
				{
					s=mahs;
					
				}
				else
				{
					s=tam+"_"+j.ToString();
					//s=s+1;
						
					break;
				}
				j++;
			}	
			i=j-1;
			if(s==cboLop.SelectedValue.ToString())
				s=s+"_1";

			else if(s==tam+"_"+i.ToString())	
			{
				
				s=tam+"_"+j.ToString();
			}
			return s;
			
		}
예제 #37
0
		private void HienThi_Nut()
		{
			LaySiSoLop();
			DataTable dsTam=new DataTable();
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider=new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
			string sSql;
			sSql = "select * from thamso where mathamso='TS3' ";
			dsTam=provider.LayDanhSach(sSql);
			int sohs_toida;
			sohs_toida=Convert.ToInt32(dsTam.DefaultView[0].Row["giatri"].ToString());
			int so=sohs-1;
			if(so>=sohs_toida)
			{
				btnTiepNhan.Enabled=false;
				btnXoa.Enabled=false;
				btnCapNhat.Enabled=false;
			
			}
			else
			{
				btnTiepNhan.Enabled=true;
				btnXoa.Enabled=false;
				btnCapNhat.Enabled=false;
			}
			
		}
예제 #38
0
		private int Tao_MaDiemMon()
		{
			DataTable dsTam=new DataTable();
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider=new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
			string sSql;
			sSql = "select madiemmon from diemmon order by madiemmon asc";
			
			dsTam=provider.LayDanhSach(sSql);
			int madiemmon =0;
			int s=0;
			for(int i=0;i<dsTam.DefaultView.Count;i++)
			{
				madiemmon=Convert.ToInt32(dsTam.DefaultView[i].Row["madiemmon"].ToString());
				if(madiemmon ==(s+1))
					s=madiemmon;
				else
				{
					s=s+1;
					break;
				}
			}	
	
			if(s==0)
				s=s+1;
	
			else if(s == madiemmon)		
				s=s+1;
			return s;
			
		}
예제 #39
0
		private int kiemtra_ngaysinh()
		{
			DataTable dsTam=new DataTable();
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider=new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
			string sSql;
			sSql = "select * from thamso ";
			dsTam=provider.LayDanhSach(sSql);
			int tuoitoithieu=0,tuoitoida=0,giatri=0;
			string mathamso;
			for(int i=0;i<dsTam.DefaultView.Count;i++)
			{
				mathamso=dsTam.DefaultView[i].Row["mathamso"].ToString();
				giatri=Convert.ToInt32(dsTam.DefaultView[i].Row["giatri"].ToString());
				if(mathamso=="TS1")
					tuoitoithieu=giatri;
				if(mathamso=="TS2")
					tuoitoida=giatri;
			}
			int tuoi=DateTime.Now.Year-dtpNgaySinh.Value.Year;
			if(	tuoi<tuoitoithieu || tuoi>tuoitoida)
			{
				MessageBox.Show("Học sinh "+tuoi+" tuổi . Không thoả qui định !","Thông báo",MessageBoxButtons.OK,MessageBoxIcon.Information);
				return 0;
			}
			return 1;
		}
예제 #40
0
		private void btnThoat_Click(object sender, System.EventArgs e)
		{
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider=new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
			provider.Disconnect();			
			this.Close();
		}
예제 #41
0
		private void dataDS_Click(object sender, System.EventArgs e)
		{
			btnXoa.Enabled=true;
			btnCapNhat.Enabled=true;
			btnTiepNhan.Enabled=false;
			khoitao_textbox();
			txtMaso.Text="";
			cboGioiTinh.Text="";
			string sSql;
			string sMaHS=dataDS[dataDS.CurrentCell.RowNumber,0].ToString();
			sSql = "select * from hocsinh where MAHS='" + sMaHS + "'";
			DataTable dsHS=new DataTable();
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider=new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
			dsHS=provider.LayDanhSach(sSql);
			//gan du lieu vao cac textbox
			txtMaso.Text=dsHS.Rows[0]["MAHS"].ToString();
			txtDiaChi.Text=dsHS.Rows[0]["DIACHI"].ToString();
			txtEmail.Text=dsHS.Rows[0]["EMAIL"].ToString();
			txtHoTen.Text=dsHS.Rows[0]["HOTEN"].ToString();
			cboGioiTinh.SelectedText=dsHS.Rows[0]["PHAI"].ToString();
			dtpNgaySinh.Value=Convert.ToDateTime(dsHS.Rows[0]["NGAYSINH"].ToString());
			HienThi_Nut();
			btnCapNhat.Enabled=true;
			btnXoa.Enabled=true;
			btnTiepNhan.Enabled=false;
			//MessageBox.Show("'"+dataDS[dataDS.CurrentCell.RowNumber,0]+"'");
		}
예제 #42
0
		private void Getdanhsachlop()
		{
			string strSql="select * from lop ";
			//QUANLYHOCSINHCAP3.LOPHOC.LopHocData lop = new QUANLYHOCSINHCAP3.LOPHOC.LopHocData();
			//cboLop.DataSource = lop.Getdanhsachlop(strSql);
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider=new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
			cboLop.DataSource=provider.LayDanhSach(strSql);
			cboLop.DisplayMember = "TENLOP"; 
			cboLop.ValueMember = "MALOP";	
			

		}
예제 #43
0
		private void GetDanhSachThamSo()
		{
			DataTable dsTS=new DataTable();
			string sSql;
			sSql = "select mathamso as MATS,tenthamso AS TENTS from thamso";
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider=new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
			dsTS=provider.LayDanhSach(sSql);
			dataDS.DataSource =dsTS;
			sots=dsTS.DefaultView.Count+1;
			txtMaso.Text="TS"+ sots.ToString();
		}
예제 #44
0
		private void LaySiSoLop()
		{

			string strSql="select Siso from lop where malop='"+cboLop.SelectedValue+"'";
			DataTable dsHS=new DataTable();
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider=new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
			dsHS=provider.LayDanhSach(strSql);
			txtSiSo.Text="";
			txtSiSo.Text=dsHS.Rows[0]["Siso"].ToString();
		}
예제 #45
0
		private void btnBaoCao_Click(object sender, System.EventArgs e)
		{
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider _provider=new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
			
			if (nflag==1)
			{
				BANGDIEM.RptBangDiemHS  rpt=new QUANLYHOCSINHCAP3.BANGDIEM.RptBangDiemHS ();
				rpt.SetDatabaseLogon(username , password);
				rpt.SetParameterValue("pMaHS",txtMaHS.Text);
				crystalReportViewer1.ReportSource = rpt;
			}
			if (nflag==0)
			{
				BANGDIEM.RptDSHS rpt=new QUANLYHOCSINHCAP3.BANGDIEM.RptDSHS();
				rpt.SetDatabaseLogon(username , password);
				rpt.SetParameterValue("pLop",(string)cboLop.SelectedValue);
				rpt.SetParameterValue("pMamon",(string)cboMon.SelectedValue);
				crystalReportViewer1.ReportSource = rpt;
			}
			if (nflag==2)
			{
				string MaHK=(string)cboHocky.SelectedValue;
				RptBaocaoHocki  rpt=new RptBaocaoHocki ();
				rpt.SetDatabaseLogon(username , password);
				rpt.SetParameterValue("pMaHK",MaHK);
				crystalReportViewer1.ReportSource = rpt;
			}
			if (nflag==4)
			{
				BaoCaoTheoMon  rpt=new BaoCaoTheoMon();
				rpt.SetDatabaseLogon(username , password);
				rpt.SetParameterValue("pMaHK",(string)cboHocky.SelectedValue);
				rpt.SetParameterValue("pMaMon",(string)cboMon.SelectedValue);
				crystalReportViewer1.ReportSource = rpt;
				
			}
			//CACH EXPORT VO WORD
			/*SaveFileDialog dlg = new SaveFileDialog ();
			if (dlg.ShowDialog()==DialogResult.OK)
				rpt.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.WordForWindows,dlg.FileName) ;*/	
		}
예제 #46
0
		private void Getdanhsachlop(string ma_khoi)
		{
			string strSql="select * from lop where makhoi='"+ma_khoi+"'";
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider=new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
			cboLop.DataSource=provider.LayDanhSach(strSql);
			cboLop.DisplayMember = "TENLOP"; 
			cboLop.ValueMember = "MALOP";	
		}
예제 #47
0
		private void GetDanhSachHocSinh()
		{
			DataTable dsHS=new DataTable();
			string sSql;
			sSql = "select MAHS , HOTEN from hocsinh where MALOP='" + cboLop.SelectedValue + "'";
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider=new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
			dsHS=provider.LayDanhSach(sSql);
			dataDS.DataSource =dsHS;
			sohs=dsHS.DefaultView.Count+1;
			txtMaso.Text=Tao_MaHS();
			
		}
예제 #48
0
		private void LayBangDiem()
		{
			DataColumn cot ;
			DataTable dsBangDiem=new DataTable();
			string sSql;
			sSql = "select * from monhoc ";
			//QUANLYHOCSINHCAP3.MONHOC.MonHocData Monhoc_Data=new QUANLYHOCSINHCAP3.MONHOC.MonHocData();
			//dsBangDiem= Monhoc_Data.GetDanhSachMonHoc(sSql);
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider=new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
			dsBangDiem=provider.LayDanhSach(sSql);
			int soluongmon=dsBangDiem.DefaultView.Count;
			/*//tao cot HK 
			cot = new DataColumn();
			cot.ColumnName=" Học Kỳ";
			cot.DataType=Type.GetType("System.String");
			dsLop.Columns.Add(cot);*/
			//tao cot TBHK1
			cot = new DataColumn();
			cot.ColumnName="TBHK1";
			
			cot.DataType=Type.GetType("System.String");
			dsBangDiem.Columns.Add(cot);
			//tao cot TBHK2'
			cot = new DataColumn();
			cot.ColumnName="TBHK2";
			
			cot.DataType=Type.GetType("System.String");
			dsBangDiem.Columns.Add(cot);
			dataBDiem.DataSource =dsBangDiem;
			int i;
			string ma_mon,trungbinh;
				
			for(i=0;i<soluongmon;i++)
			{
				ma_mon=dsBangDiem.Rows[i][0].ToString();
				trungbinh=LayTrungBinhMon(ma_mon,"HK1");
				dataBDiem[i,2]=trungbinh.ToString();
				trungbinh=LayTrungBinhMon(ma_mon,"HK2");
				dataBDiem[i,3]=trungbinh.ToString();
				
			}
			
		}
예제 #49
0
		private void btnThoat_Click(object sender, System.EventArgs e)
		{
			DialogResult nut;
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider=new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
			if(Kiemtra_Thoat()==1)
			{
				provider.Disconnect();
				this.Close();
			}
			else
			{
					
					nut=MessageBox.Show("Bạn có muốn lưu trước khi thoát không ? ","Thông báo",MessageBoxButtons.YesNoCancel,MessageBoxIcon.Information);
					if(nut==DialogResult.Yes)
					{
				
						if(btnTiepNhan.Enabled==false)
						{
							if(btnCapNhat.Enabled==true)
							{
								if(kiemtra()==1)
								{
									CapNhat();
									provider.Disconnect();
									this.Close();
								}
							}
						}
						else
						{
							if(kiemtra()==1)
							{
								Luu();
								provider.Disconnect();
								this.Close();
							}
						}
					}
					if(nut==DialogResult.No)
					{
						provider.Disconnect();
						this.Close();
					}
			}
		}
예제 #50
0
		private void btnThoat_Click(object sender, System.EventArgs e)
		{
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider provider=new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
			//cboKhoi.DataSource=provider.LayDanhSach(strSql);
			provider.Disconnect();
			this.Close();
		}
예제 #51
0
		private void DangNhap()
		{
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider.Username=txtUsername.Text;
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider.Password=txtPasswd.Text;
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider.Service=txtService.Text;
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider _provider= new QUANLYHOCSINHCAP3.KNCSDL.DataProvider();
			string path = "Provider=MSDAORA.1;Data Source= "+txtService.Text+";User ID="+txtUsername.Text+";Password="******";Persist Security Info=True";
			QUANLYHOCSINHCAP3.KNCSDL.DataProvider.ConnectionString=path;
			_provider.connect();
			if(_provider.flag==1)
			{
				((Form1)MdiParent).ShowMenu(true);
				this.Close();
			}
			else
			{
				MessageBox.Show("Không kết nối Oracle được !!!","Thông báo",MessageBoxButtons.OK,MessageBoxIcon.Error);
				txtUsername.Text="";
				txtUsername.Focus();
				return;
			}
		/*	if(txtMatKhau.Text=="")
			{
				
				MessageBox.Show("Bạn phải nhập mật khẩu","Thông báo",MessageBoxButtons.OK,MessageBoxIcon.Information);
				txtMatKhau.Focus();
				return;
			}
			else
			{
				if(txtMatKhau.Text!="123")
				{
					MessageBox.Show("Bạn nhập sai mật khẩu","Thông báo",MessageBoxButtons.OK,MessageBoxIcon.Error);
					txtMatKhau.Text="";
					txtMatKhau.Focus();
					return;
				}
				else
				{
					((Form1)MdiParent).ShowMenu(true);
					this.Close();	
				}
			}*/

		}