예제 #1
0
        public float getDiemTrungBinhMonHocKy(String maHS,
            String strMaMonHoc,
            String strMaHocKy,
            String strMaKhoaHoc,
            String strMaLop)
        {
            float diemDTBMonHocHocKy = 0;
               DataService m_DData = new DataService();

               SqlCommand cmd = new SqlCommand(@"SELECT DTBMonHocKy FROM KQ_HOC_KY_MON_HOC
                                            WHERE    MaHocSinh = @MaHocSinh
                                                    and MaLop = @MaLop
                                                    and MaMonHoc = @MaMonHoc
                                                    and MaHocKy = @MaHocKy
                                                    and MaNamHoc = @MaNamHoc

                                            ");
               cmd.Parameters.Add("MaHocSinh", SqlDbType.VarChar).Value = maHS;
               cmd.Parameters.Add("MaLop", SqlDbType.VarChar).Value = strMaLop;
               cmd.Parameters.Add("MaMonHoc", SqlDbType.VarChar).Value = strMaMonHoc;
               cmd.Parameters.Add("MaHocKy", SqlDbType.VarChar).Value = strMaHocKy;
               cmd.Parameters.Add("MaNamHoc", SqlDbType.VarChar).Value = strMaKhoaHoc;

               m_DData.Load(cmd);
               int dong = m_DData.Rows.Count;
               if (dong > 0)
               {
               diemDTBMonHocHocKy = float.Parse(m_DData.Rows[dong - 1]["DTBMonHocKy"].ToString().Trim());
               }
               return diemDTBMonHocHocKy;
        }
 public void XoaKetQua(String maHocSinh, String maLop, String maMonHoc, String maHocKy, String maNamHoc)
 {
     DataService m_KQHKMHData = new DataService();
     SqlCommand cmd = new SqlCommand("DELETE FROM KQ_HOC_KY_MON_HOC WHERE MaHocSinh = @maHocSinh AND MaLop = @maLop AND MaMonHoc = @maMonHoc AND MaHocKy = @maHocKy AND MaNamHoc = @maNamHoc");
     cmd.Parameters.Add("maHocSinh", SqlDbType.VarChar).Value = maHocSinh;
     cmd.Parameters.Add("maLop", SqlDbType.VarChar).Value = maLop;
     cmd.Parameters.Add("maMonHoc", SqlDbType.VarChar).Value = maMonHoc;
     cmd.Parameters.Add("maHocKy", SqlDbType.VarChar).Value = maHocKy;
     cmd.Parameters.Add("maNamHoc", SqlDbType.VarChar).Value = maNamHoc;
     m_KQHKMHData.Load(cmd);
 }
        public void XoaKetQua(String maHocSinh, String maLop, String maNamHoc)
        {
            DataService m_KQCNTHData = new DataService();

            SqlCommand cmd = new SqlCommand("DELETE FROM KQ_CA_NAM_TONG_HOP WHERE MaHocSinh = @maHocSinh AND MaLop = @maLop AND MaNamHoc = @maNamHoc");
            cmd.Parameters.Add("maHocSinh", SqlDbType.VarChar).Value = maHocSinh;
            cmd.Parameters.Add("maLop", SqlDbType.VarChar).Value = maLop;
            cmd.Parameters.Add("maNamHoc", SqlDbType.VarChar).Value = maNamHoc;

            m_KQCNTHData.Load(cmd);
        }
예제 #4
0
 public bool isGiaoVienChuNhiem(String strMaGiaoVien, String strMaLop, String strMaKhoaHoc)
 {
     DataService m_LopData_ = new DataService();
        SqlCommand cmd = new SqlCommand(@"SELECT * FROM LOP
                                     WHERE MaLop = @MaLop
                                     and   MaNamHoc  = @MaNamHoc
                                     and MaGiaoVien = @MaGiaoVien");
        cmd.Parameters.Add("MaLop", SqlDbType.VarChar).Value = strMaLop;
        cmd.Parameters.Add("MaNamHoc", SqlDbType.VarChar).Value = strMaKhoaHoc;
        cmd.Parameters.Add("MaGiaoVien", SqlDbType.VarChar).Value = strMaGiaoVien;
        m_LopData_.Load(cmd);
        return m_LopData.Rows.Count>0;
 }
        public void XoaKetQua(String maHocSinh, String maLop, String maMonHoc, String maNamHoc)
        {
            DataService m_KQCNMHData = new DataService();

            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = "sp_DEL_KQ_CA_NAM_MON_HOC";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("maHocSinh", SqlDbType.VarChar).Value = maHocSinh;
            cmd.Parameters.Add("maLop", SqlDbType.VarChar).Value = maLop;
            cmd.Parameters.Add("maMonHoc", SqlDbType.VarChar).Value = maMonHoc;
            cmd.Parameters.Add("maNamHoc", SqlDbType.VarChar).Value = maNamHoc;

            m_KQCNMHData.Load(cmd);
        }
        public void LuuKetQua(String maHocSinh, String maLop, String maMonHoc, String maNamHoc, float diemThiLai, float diemTBMonCN)
        {
            DataService m_KQCNMHData = new DataService();

            SqlCommand cmd = new SqlCommand("INSERT INTO KQ_CA_NAM_MON_HOC VALUES(@maHocSinh, @maLop, @maMonHoc, @maNamHoc, @diemThiLai, @diemTBMonCN)");
            cmd.Parameters.Add("maHocSinh", SqlDbType.VarChar).Value = maHocSinh;
            cmd.Parameters.Add("maLop", SqlDbType.VarChar).Value = maLop;
            cmd.Parameters.Add("maMonHoc", SqlDbType.VarChar).Value = maMonHoc;
            cmd.Parameters.Add("maNamHoc", SqlDbType.VarChar).Value = maNamHoc;
            cmd.Parameters.Add("diemThiLai", SqlDbType.Float).Value = Math.Round(diemThiLai, 2);
            cmd.Parameters.Add("diemTBMonCN", SqlDbType.Float).Value = Math.Round(diemTBMonCN, 2);

            m_KQCNMHData.Load(cmd);
        }
        public void LuuKetQua(String maHocSinh, String maLop, String maNamHoc, String maHocLuc, String maHanhKiem, float diemTBChungCacMonCN, String maKetQua)
        {
            DataService m_KQCNTHData = new DataService();

            SqlCommand cmd = new SqlCommand("INSERT INTO KQ_CA_NAM_TONG_HOP VALUES(@maHocSinh, @maLop, @maNamHoc, @maHocLuc, @maHanhKiem, @diemTBChungCacMonCN, @maKetQua)");
            cmd.Parameters.Add("maHocSinh", SqlDbType.VarChar).Value = maHocSinh;
            cmd.Parameters.Add("maLop", SqlDbType.VarChar).Value = maLop;
            cmd.Parameters.Add("maNamHoc", SqlDbType.VarChar).Value = maNamHoc;
            cmd.Parameters.Add("maHocLuc", SqlDbType.VarChar).Value = maHocLuc;
            cmd.Parameters.Add("maHanhKiem", SqlDbType.VarChar).Value = maHanhKiem;
            cmd.Parameters.Add("diemTBChungCacMonCN", SqlDbType.Float).Value = Math.Round(diemTBChungCacMonCN, 2);
            cmd.Parameters.Add("maKetQua", SqlDbType.VarChar).Value = maKetQua;

            m_KQCNTHData.Load(cmd);
        }
        public void UpdateKetQua(String maHocSinh, String maLop, String maMonHoc, String maNamHoc, float diemThiLai, float diemTBMonCN)
        {
            DataService m_KQCNMHData = new DataService();

            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = "sp_UpdateKetQuaCNMonHoc";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("maHocSinh", SqlDbType.VarChar).Value = maHocSinh;
            cmd.Parameters.Add("maLop", SqlDbType.VarChar).Value = maLop;
            cmd.Parameters.Add("maMonHoc", SqlDbType.VarChar).Value = maMonHoc;
            cmd.Parameters.Add("maNamHoc", SqlDbType.VarChar).Value = maNamHoc;
            cmd.Parameters.Add("diemThiLai", SqlDbType.Float).Value = Math.Round(diemThiLai, 2);
            cmd.Parameters.Add("diemTBMonCN", SqlDbType.Float).Value = Math.Round(diemTBMonCN, 2);

            m_KQCNMHData.Load(cmd);
        }
        public bool isTonTaiKetQua(     String maHocSinh,
            String maLop,
            String maHocKy,
            String maNamHoc
            )
        {
            DataService m_KQHKTHData = new DataService();

            SqlCommand cmd = new SqlCommand("SELECT * FROM KQ_HOC_KY_TONG_HOP WHERE MaHocSinh = @maHocSinh AND MaLop = @maLop AND MaHocKy = @maHocKy AND MaNamHoc = @maNamHoc");
            cmd.Parameters.Add("maHocSinh", SqlDbType.VarChar).Value = maHocSinh;
            cmd.Parameters.Add("maLop", SqlDbType.VarChar).Value = maLop;
            cmd.Parameters.Add("maHocKy", SqlDbType.VarChar).Value = maHocKy;
            cmd.Parameters.Add("maNamHoc", SqlDbType.VarChar).Value = maNamHoc;

            m_KQHKTHData.Load(cmd);
            return m_KQHKTHData.Rows.Count > 0;
        }
        public void CapNhatKetQuaDiemTBCMvaHocLucHocKy(String maHocSinh, String maLop, String maHocKy, String maNamHoc, String maHocLuc,  float diemTBChungCacMonHK)
        {
            DataService m_KQHKTHData = new DataService();

               SqlCommand cmd = new SqlCommand(@"UPDATE  KQ_HOC_KY_TONG_HOP
                                             SET  MaHocLuc =   @maHocLuc,
                                                  DTBMonHocKy =@diemTBChungCacMonHK
                                            WHERE maHocSinh = @maHocSinh
                                            and   maLop = @maLop
                                            and   maNamHoc = @maNamHoc
                                            ");
               cmd.Parameters.Add("maHocSinh", SqlDbType.VarChar).Value = maHocSinh;
               cmd.Parameters.Add("maLop", SqlDbType.VarChar).Value = maLop;
               cmd.Parameters.Add("maHocKy", SqlDbType.VarChar).Value = maHocKy;
               cmd.Parameters.Add("maNamHoc", SqlDbType.VarChar).Value = maNamHoc;
               cmd.Parameters.Add("maHocLuc", SqlDbType.VarChar).Value = maHocLuc;
               cmd.Parameters.Add("diemTBChungCacMonHK", SqlDbType.Float).Value = Math.Round(diemTBChungCacMonHK, 2);

               m_KQHKTHData.Load(cmd);
        }
        public void CapNhatHanhKiemHocKy(String maHocSinh, 
            String maLop,
            String maHocKy,
            String maNamHoc,
            String maHanhKiem
            )
        {
            DataService m_KQHKTHData = new DataService();

               SqlCommand cmd = new SqlCommand();
               cmd.CommandText = "sp_CapNhatHanhKiemHocKy";
               cmd.CommandType = CommandType.StoredProcedure;
               cmd.Parameters.Add("maHocSinh", SqlDbType.VarChar).Value = maHocSinh;
               cmd.Parameters.Add("maLop", SqlDbType.VarChar).Value = maLop;
               cmd.Parameters.Add("maHocKy", SqlDbType.VarChar).Value = maHocKy;
               cmd.Parameters.Add("maNamHoc", SqlDbType.VarChar).Value = maNamHoc;
               cmd.Parameters.Add("maHanhKiem", SqlDbType.VarChar).Value = maHanhKiem;

               m_KQHKTHData.Load(cmd);
        }
예제 #12
0
        public void LuuKetQua(String maHocSinh, String maLop, String maMonHoc, String maHocKy, String maNamHoc, float diemTBMonHK)
        {
            DataService m_KQHKMHData = new DataService();

            SqlCommand cmd = new SqlCommand(@"DELETE FROM KQ_HOC_KY_MON_HOC
                                            WHERE MaHocSinh = @maHocSinh AND
                                            MaLop = @maLop AND
                                            MaMonHoc = @maMonHoc AND
                                            MaHocKy = @maHocKy AND
                                            MaNamHoc = @maNamHoc;
                                            INSERT INTO KQ_HOC_KY_MON_HOC
                                            VALUES(@maHocSinh, @maLop, @maMonHoc, @maHocKy, @maNamHoc, @diemTBMonHK)");
            cmd.Parameters.Add("maHocSinh", SqlDbType.VarChar).Value = maHocSinh;
            cmd.Parameters.Add("maLop", SqlDbType.VarChar).Value = maLop;
            cmd.Parameters.Add("maMonHoc", SqlDbType.VarChar).Value = maMonHoc;
            cmd.Parameters.Add("maHocKy", SqlDbType.VarChar).Value = maHocKy;
            cmd.Parameters.Add("maNamHoc", SqlDbType.VarChar).Value = maNamHoc;
            cmd.Parameters.Add("diemTBMonHK", SqlDbType.Float).Value = Math.Round(diemTBMonHK, 2);

            m_KQHKMHData.Load(cmd);
        }
예제 #13
0
        public DataTable LayDsDiem(String maHocSinh, String maMonHoc, String maHocKy, String maNamHoc, String maLop)
        {
            DataService m_DData = new DataService();

               SqlCommand cmd = new SqlCommand(@"SELECT *
                                           FROM DIEM D, HOCSINH S, MONHOC H, LOAIDIEM O, LOP L
                                           WHERE D.MaHocSinh = S.MaHocSinh AND
                                           D.MaMonHoc = H.MaMonHoc AND
                                           D.MaLoaiDiem = O.MaLoaiDiem AND
                                           D.MaLop = L.MaLop AND
                                           S.MaHocSinh = @maHocSinh AND
                                           H.MaMonHoc = @maMonHoc AND
                                           D.MaHocKy = @maHocKy AND
                                           D.MaNamHoc = @maNamHoc AND
                                           L.MaLop = @maLop");
               cmd.Parameters.Add("maHocSinh", SqlDbType.VarChar).Value = maHocSinh;
               cmd.Parameters.Add("maLop", SqlDbType.VarChar).Value = maLop;
               cmd.Parameters.Add("maMonHoc", SqlDbType.VarChar).Value = maMonHoc;
               cmd.Parameters.Add("maHocKy", SqlDbType.VarChar).Value = maHocKy;
               cmd.Parameters.Add("maNamHoc", SqlDbType.VarChar).Value = maNamHoc;

               m_DData.Load(cmd);
               return m_DData;
        }
        public void ThemKetQuaDiemTBCacMonVaHocLucHocKy(String maHocSinh, String maLop, String maHocKy, String maNamHoc, String maHocLuc, float diemTBChungCacMonHK)
        {
            DataService m_KQHKTHData = new DataService();

            SqlCommand cmd = new SqlCommand(@"INSERT INTO KQ_HOC_KY_TONG_HOP
                (maHocSinh,maLop,maHocKy,maNamHoc,maHocLuc,DTBMonHocKy)
                VALUES(@maHocSinh, @maLop, @maHocKy, @maNamHoc, @maHocLuc, @diemTBChungCacMonHK)"
                );
            cmd.Parameters.Add("maHocSinh", SqlDbType.VarChar).Value = maHocSinh;
            cmd.Parameters.Add("maLop", SqlDbType.VarChar).Value = maLop;
            cmd.Parameters.Add("maHocKy", SqlDbType.VarChar).Value = maHocKy;
            cmd.Parameters.Add("maNamHoc", SqlDbType.VarChar).Value = maNamHoc;
            cmd.Parameters.Add("maHocLuc", SqlDbType.VarChar).Value = maHocLuc;
            cmd.Parameters.Add("diemTBChungCacMonHK", SqlDbType.Float).Value = Math.Round(diemTBChungCacMonHK, 2);

            m_KQHKTHData.Load(cmd);
        }
예제 #15
0
        public DataTable LayDsDiemHocSinh(String maHocSinh, String maMonHoc, String maHocKy, String maNamHoc, String maLop)
        {
            DataService m_DData = new DataService();

               SqlCommand cmd = new SqlCommand();
               cmd.CommandText = "sp_LayDsDiemHocSinh";
               cmd.CommandType = CommandType.StoredProcedure;
               cmd.Parameters.Add("maHocSinh", SqlDbType.VarChar).Value = maHocSinh;
               cmd.Parameters.Add("maMonHoc", SqlDbType.VarChar).Value = maMonHoc;
               cmd.Parameters.Add("maHocKy", SqlDbType.VarChar).Value = maHocKy;
               cmd.Parameters.Add("maNamHoc", SqlDbType.VarChar).Value = maNamHoc;
               cmd.Parameters.Add("maLop", SqlDbType.VarChar).Value = maLop;

               m_DData.Load(cmd);
               return m_DData;
        }
예제 #16
0
        public void XoaDiem(int stt)
        {
            DataService m_DData = new DataService();

               SqlCommand cmd = new SqlCommand("DELETE FROM DIEM WHERE STT = @stt");
               cmd.Parameters.Add("stt", SqlDbType.Int).Value = stt;

               m_DData.Load(cmd);
        }
예제 #17
0
        public void LuuDiem(String maHocSinh, String maMonHoc, String maHocKy, String maNamHoc, String maLop, String maLoaiDiem, String diemSo)
        {
            DataService m_DData = new DataService();

               SqlCommand cmd = new SqlCommand(@"

            DELETE FROM DIEM
            WHERE maHocSinh = @maHocSinh
            and maMonHoc = @maMonHoc
            and maHocKy = @maHocKy
            and maNamHoc = @maNamHoc
            and maLop = @maLop
            and maLoaiDiem = @maLoaiDiem
            ;
            INSERT INTO DIEM VALUES(@maHocSinh, @maMonHoc, @maHocKy, @maNamHoc, @maLop, @maLoaiDiem, @diemSo)");
               cmd.Parameters.Add("maHocSinh", SqlDbType.VarChar).Value = maHocSinh;
               cmd.Parameters.Add("maMonHoc", SqlDbType.VarChar).Value = maMonHoc;
               cmd.Parameters.Add("maHocKy", SqlDbType.VarChar).Value = maHocKy;
               cmd.Parameters.Add("maNamHoc", SqlDbType.VarChar).Value = maNamHoc;
               cmd.Parameters.Add("maLop", SqlDbType.VarChar).Value = maLop;
               cmd.Parameters.Add("maLoaiDiem", SqlDbType.VarChar).Value = maLoaiDiem;
               cmd.Parameters.Add("diemSo", SqlDbType.VarChar).Value = diemSo;

               m_DData.Load(cmd);
        }
예제 #18
0
        public DataTable LayDsDiemHocSinhTL(String maHocSinh, String maMonHoc, String maNamHoc, String maLop)
        {
            DataService m_DData = new DataService();

               SqlCommand cmd = new SqlCommand("SELECT * " +
                                           "FROM DIEM D, LOAIDIEM L " +
                                           "WHERE D.MaLoaiDiem = L.MaLoaiDiem AND " +
                                           "D.MaHocSinh = @maHocSinh AND " +
                                           "D.MaMonHoc = @maMonHoc AND " +
                                           "D.MaNamHoc = @maNamHoc AND " +
                                           "D.MaLop = @maLop");
               cmd.Parameters.Add("maHocSinh", SqlDbType.VarChar).Value = maHocSinh;
               cmd.Parameters.Add("maMonHoc", SqlDbType.VarChar).Value = maMonHoc;
               cmd.Parameters.Add("maNamHoc", SqlDbType.VarChar).Value = maNamHoc;
               cmd.Parameters.Add("maLop", SqlDbType.VarChar).Value = maLop;

               m_DData.Load(cmd);
               return m_DData;
        }