Exemple #1
0
        public static string loadTenMon(string strMaMon)
        {
            dataProvider = new CDataProvider_DAL();
            string selectTenMon = "select TenMon from MonHoc where MaMon='" + strMaMon + "'";

            return(dataProvider.getDataTableExcuteQuery("tbTenMon", selectTenMon).Rows[0]["TenMon"].ToString());
        }
Exemple #2
0
        public static DataTable loadDSMon()
        {
            dataProvider = new CDataProvider_DAL();
            string selectTenMon = "select * from MonHoc";

            return(dataProvider.getDataTableExcuteQuery("tbTenMon", selectTenMon));
        }
Exemple #3
0
        public static bool suaDiem(string strMaMon, string strMaSV, string strMaHK, string strMaDiem, float fSoDiem, float fHeSo, DateTime dtmNgayDiem)
        {
            dataProvider = new CDataProvider_DAL();
            string strUpdateDiem = string.Format("update DiemSo set SoDiem='{3}', HeSo='{4}', NgayDiem='{5}' where MaMon='{0}' and  MaSV='{1}' and MaDiem='{2}'",
                                                 strMaMon, strMaSV, strMaDiem, fSoDiem, fHeSo, dtmNgayDiem);
            string error = "";

            return(dataProvider.excuteNonQuery(strUpdateDiem, ref error));
        }
Exemple #4
0
        public static bool removeDiem(string strMaMon, string strMaSV, string strMaHK, string strMaDiem)
        {
            dataProvider = new CDataProvider_DAL();
            string strUpdateDiem = string.Format("delete DiemSo where  MaMon='{0}' and  MaSV='{1}' and MaDiem='{2}' and MaHK='{3}'",
                                                 strMaMon, strMaSV, strMaDiem, strMaHK);
            string error = "";

            return(dataProvider.excuteNonQuery(strUpdateDiem, ref error));
        }
        public static DataTable loadSinhVienInfor(string strMaSV)
        {
            dataProvider = new CDataProvider_DAL();
            DataTable tb;
            string    strSelectHoTen = string.Format("select * from SinhVien where MaSV='{0}'", strMaSV);

            tb = dataProvider.getDataTableExcuteQuery("tbTenSinhVien", strSelectHoTen);
            return(tb);
        }
        public static int countHoatDong()
        {
            dataProvider = new CDataProvider_DAL();
            string strCountHoatDong = "select count(*) from HoatDong";
            string strErr           = "";
            int    iCount           = (int)dataProvider.executeScalar(CommandType.Text, strCountHoatDong, ref strErr);

            return(iCount);
        }
Exemple #7
0
        public DataTable loadDSMonSV(string strMaSV)
        {
            string    strSelectMon = @"select MonHoc.MaMon, MonHoc.TenMon from DanhSachMon inner join MonHoc on DanhSachMon.MaMon=MonHoc.MaMon where DanhSachMon.MaSV='" + strMaSV + "'";
            DataTable tbl          = new DataTable();

            tbl = new CDataProvider_DAL().getDataTableExcuteQuery("tbMonHoc", strSelectMon);

            return(tbl);
        }
Exemple #8
0
        public static int countDiem(string strMaSV)
        {
            dataProvider = new CDataProvider_DAL();
            string strCountDiem = "select count(*) from DiemSo";
            string error        = "";
            int    iCount       = dataProvider.executeScalar(System.Data.CommandType.Text, strCountDiem, ref error);

            return(iCount);
        }
        public static DataTable loadLichHocTrongNgay(string strMaSV, int iThu)
        {
            dataProvider = new CDataProvider_DAL();
            iThu++;
            DataTable dtb          = new DataTable();
            string    strSelectCmd = string.Format("exec [dbo].[spLichHocTrongNgay] @MaSV={0}, @Thu={1}", strMaSV, iThu);

            dtb = dataProvider.getDataTableExcuteQuery("LichHocNgay" + iThu, strSelectCmd);
            return(dtb);
        }
        public static DataTable loadLichHocTrongNgay(string strMaSV)
        {
            dataProvider = new CDataProvider_DAL();
            int       iThu         = DateTime.Now.DayOfWeek.GetHashCode() + 1;
            DataTable dtb          = new DataTable();
            string    strSelectCmd = string.Format("exec [dbo].[spLichHocTrongNgay] @MaSV={0}, @Thu={1}", strMaSV, iThu);

            dtb = dataProvider.getDataTableExcuteQuery("LichHocNgay", strSelectCmd);
            return(dtb);
        }
        public static DataTable loadSuKienTrongNgay(string strMaSV)
        {
            dataProvider = new CDataProvider_DAL();
            DateTime  date         = DateTime.Now;
            DataTable dtb          = new DataTable();
            string    strSelectCmd = string.Format("exec [dbo].[spHoatDongTuongLai] @MaSV={0}, @ThoiGianHienTai='{1}'", strMaSV, date.ToShortDateString());

            dtb = dataProvider.getDataTableExcuteQuery("LichHocNgay", strSelectCmd);
            return(dtb);
        }
        public static string loadTenSinhVien(string strMaSV)
        {
            dataProvider = new CDataProvider_DAL();
            string    strSelectHoTen = string.Format("select HoTen from SinhVien where MaSV='{0}'", strMaSV);
            string    strHoTenSV     = "";
            DataTable tb             = dataProvider.getDataTableExcuteQuery("tbTenSinhVien", strSelectHoTen);

            strHoTenSV = tb.Rows[0]["HoTen"].ToString();
            return(strHoTenSV);
        }
Exemple #13
0
        public static DataTable loadDSDiemMon(string strMaSV, string strMaMon)
        {
            string strSelectDiem = "select * from DiemSo where MaMon='" + strMaMon + "' and MaSV='" + strMaSV + "'";

            DataTable dtb = new DataTable();

            dtb = new CDataProvider_DAL().getDataTableExcuteQuery("tbDiemSo", strSelectDiem);

            return(dtb);
        }
Exemple #14
0
        public static DataTable loadDSDiemMon(string strMaSV, string strMaMon, string strMaHK)
        {
            string strSelectDiem = string.Format("SELECT TenMon ,SoDiem, HeSo FROM DiemSo, DanhSachMon, MonHoc WHERE DiemSo.MaSV = '{0}' and DiemSo.MaMon = '{1}' and DanhSachMon.MaHK = '{2}' and DiemSo.MaMon = DanhSachMon.MaMon and DiemSo.MaHK = DanhSachMon.MaHK and DiemSo.MaSV = DanhSachMon.MaSV and MonHoc.MaMon = DanhSachMon.MaMon",
                                                 strMaSV, strMaMon, strMaHK);

            DataTable dtb = new DataTable();

            dtb = new CDataProvider_DAL().getDataTableExcuteQuery("tbDiemSo", strSelectDiem);

            return(dtb);
        }
Exemple #15
0
        public static DataTable loaDSHocKy()
        {
            dataProvider = new CDataProvider_DAL();
            string strSelectHocKy = "select * from HocKy";

            DataTable dtb = new DataTable();

            dtb = dataProvider.getDataTableExcuteQuery("tbHocKy", strSelectHocKy);

            return(dtb);
        }
Exemple #16
0
        public static bool checkAccount(string strTaiKhoan, string strMatKhau)
        {
            dataProvider = new CDataProvider_DAL();
            string strCountCmd   = string.Format("select count(*) from AccountSinhVien where MaSV='{0}' and PasswordSV=N'{1}'", strTaiKhoan, strMatKhau);
            string strError      = "";
            int    iCountAccount = (int)dataProvider.executeScalar(CommandType.Text, strCountCmd, ref strError);

            if (iCountAccount == 0)
            {
                return(false);
            }
            return(true);
        }
Exemple #17
0
        public static bool addAccountSinhVien(string strTaiKhoan, string strMatKhau)
        {
            dataProvider = new CDataProvider_DAL();
            string strAddSinhVien = string.Format("insert into AccountSinhVien values ('{0}',N'{1}')", strTaiKhoan, strMatKhau);
            string strErr         = "";

            dataProvider.excuteNonQuery(strAddSinhVien, ref strErr);
            if (strErr != "")
            {
                return(false);
            }
            return(true);
        }
Exemple #18
0
        public static DataTable loadDSMonHK(string strMaSV, string strMaHK)
        {
            dataProvider = new CDataProvider_DAL();

            string strSelectMon =
                @"select MonHoc.MaMon, MonHoc.TenMon from DanhSachMon inner join MonHoc on DanhSachMon.MaMon=MonHoc.MaMon where DanhSachMon.MaSV='" + strMaSV + "' and DanhSachMon.MaHK='" + strMaHK + "'";
            DataTable tbl = new DataTable();

            tbl = dataProvider.getDataTableExcuteQuery("tbMonHocTheoHK", strSelectMon);


            return(tbl);
        }
        public static bool themSinhVien(string strMaSV, string strHoTen, bool bGioiTinh, DateTime dtmNgaySinh, string strDiaChi, string strCacThongTinKhac, string ImageSV)
        {
            dataProvider = new CDataProvider_DAL();
            string strAddSinhVien = string.Format("insert into SinhVien values ('{0}',N'{1}','{2}','{3}','{4}','{5}','{6}')",
                                                  strMaSV, strHoTen, bGioiTinh, dtmNgaySinh, strDiaChi, strCacThongTinKhac, ImageSV);
            string strErr = "";

            dataProvider.excuteNonQuery(strAddSinhVien, ref strErr);
            if (strErr != "")
            {
                return(false);
            }
            return(true);
        }
        public static bool suaSinhVien(string strMaSV, string strHoTen, bool bGioiTinh, DateTime dtmNgaySinh, string strDiaChi, string strCacThongTinKhac, string ImageSV)
        {
            dataProvider = new CDataProvider_DAL();
            string strAddSinhVien = string.Format("update SinhVien set HoTen=N'{1}',GioiTinh='{2}',NgaySinh='{3}',DiaChi=N'{4}',CacThongTin=N'{5}',HinhAnh='{6}' where MaSV='{0}'",
                                                  strMaSV, strHoTen, bGioiTinh, dtmNgaySinh, strDiaChi, strCacThongTinKhac, ImageSV);
            string strErr = "";

            dataProvider.excuteNonQuery(strAddSinhVien, ref strErr);
            if (strErr != "")
            {
                return(false);
            }
            return(true);
        }
Exemple #21
0
        public static List <Tuple <string, string, string, string> > loadDSMonHKDiem(string strMaSV)
        {
            dataProvider = new CDataProvider_DAL();

            string strSelectMon =
                @"select MonHoc.MaMon, MonHoc.TenMon, HocKy.TenHK, HocKy.MaHK from DanhSachMon inner join MonHoc on DanhSachMon.MaMon=MonHoc.MaMon inner join HocKy on DanhSachMon.MaHK=HocKy.MaHK where DanhSachMon.MaSV='" + strMaSV + "'";
            DataTable tbl = new DataTable();

            tbl = new CDataProvider_DAL().getDataTableExcuteQuery("tbMonHoc", strSelectMon);

            List <Tuple <string, string, string, string> > lists;

            lists = new List <Tuple <string, string, string, string> >();
            foreach (DataRow dr in tbl.Rows)
            {
                Tuple <string, string, string, string> item = new Tuple <string, string, string, string>(dr["MaMon"].ToString(), dr["TenMon"].ToString() + "-" + dr["TenHK"].ToString(), dr["TenHK"].ToString(), dr["MaHK"].ToString());
                lists.Add(item);
            }
            return(lists);
        }
        public static bool themLichHoc(string strMaSV, int iThu, string strMaHD, string strMaMon, bool bChinhKhoa, DateTime dtmGioBD, DateTime dtmGioKT, string strGhiChu, int MauSac)
        {
            dataProvider = new CDataProvider_DAL();
            string strAddCmd = string.Format("spAddLichHoc");
            string strErr    = "";

            dataProvider.excuteNonQuery(strAddCmd, ref strErr, CommandType.StoredProcedure,
                                        new SqlParameter("@MaSV", strMaSV),
                                        new SqlParameter("@Thu", iThu),
                                        new SqlParameter("@MaHD", strMaHD),
                                        new SqlParameter("@MaMon", strMaMon),
                                        new SqlParameter("@ChinhKhoa", bChinhKhoa),
                                        new SqlParameter("@GioBD", dtmGioBD),
                                        new SqlParameter("@GioKT", dtmGioKT),
                                        new SqlParameter("@GhiChuHD", strGhiChu),
                                        new SqlParameter("@MauMucDo", MauSac)
                                        );
            if (strErr != "")
            {
                return(false);
            }
            return(true);
        }