Beispiel #1
0
        public IList <LopHoc> getAll(int PageNo, int PageSize, int Makhoihoc, int Siso, out int RecordCount)
        {
            SqlParameter[] parm = new SqlParameter[]
            {
                new SqlParameter("@PageIndex", SqlDbType.Int),
                new SqlParameter("@PageSize", SqlDbType.Int),
                new SqlParameter("@makhoihoc", SqlDbType.Int),
                new SqlParameter("@siso", SqlDbType.Int),
            };
            parm[0].Value = PageNo;
            parm[1].Value = PageSize;
            parm[2].Value = Makhoihoc;
            parm[3].Value = Siso;
            RecordCount   = 0;
            SqlDataReader  dra  = DataAccessHelper.ExecuteReader(DataAccessHelper.ConnectionString, CommandType.StoredProcedure, "tbl_LopHoc_Sel_All_Page", parm);
            IList <LopHoc> list = new List <LopHoc>();

            while (dra.Read())
            {
                RecordCount = int.Parse(dra["RecordCount"].ToString());
                list.Add(new LopHoc(
                             int.Parse(dra["malop"].ToString()),
                             dra["tenlop"].ToString(),
                             int.Parse(dra["makhoihoc"].ToString()),
                             int.Parse(dra["magiaovien"].ToString()),
                             int.Parse(dra["siso"].ToString())));
            }
            dra.Dispose();
            return(list);
        }
Beispiel #2
0
        public IList <MonHoc> getAll(int Mamonhoc, string Tenmonhoc, int Sotiet, out int RecordCount)
        {
            SqlParameter[] parm = new SqlParameter[]
            {
                new SqlParameter("@mamochoc", SqlDbType.Int),
                new SqlParameter("@tenmonhoc", SqlDbType.NVarChar, 20),
                new SqlParameter("@sotiet", SqlDbType.Int),
            };
            parm[0].Value = Mamonhoc;
            parm[1].Value = Tenmonhoc;
            parm[2].Value = Sotiet;
            RecordCount   = 0;
            SqlDataReader  dra  = DataAccessHelper.ExecuteReader(DataAccessHelper.ConnectionString, CommandType.StoredProcedure, "tbl_MonHoc_Sel_All_Page", parm);
            IList <MonHoc> list = new List <MonHoc>();

            while (dra.Read())
            {
                RecordCount = int.Parse(dra["RecordCount"].ToString());
                list.Add(new MonHoc(
                             int.Parse(dra["mamonhoc"].ToString()),
                             dra["tenmonhoc"].ToString(),
                             int.Parse(dra["sotiet"].ToString())));
            }
            dra.Dispose();
            return(list);
        }
Beispiel #3
0
        public Diem getmaDiem(int mabangdiem)
        {
            SqlParameter[] parm = new SqlParameter[]
            {
                new SqlParameter(PARM_MABANGDIEM, SqlDbType.Int)
            };
            parm[0].Value = mabangdiem;
            Diem          d   = null;
            SqlDataReader dra = DataAccessHelper.ExecuteReader(DataAccessHelper.ConnectionString, CommandType.StoredProcedure, "tbl_Diem_Sel_ID", parm);

            if (dra.Read())
            {
                d = new Diem(
                    int.Parse(dra["mabangdiem"].ToString()),
                    int.Parse(dra["malop"].ToString()),
                    int.Parse(dra["mahocsinh"].ToString()),
                    int.Parse(dra["kihoc"].ToString()),
                    dra["namhoc"].ToString(),
                    float.Parse(dra["diemtb"].ToString()),
                    dra["hanhkiem"].ToString(),
                    dra["hocluc"].ToString(),
                    dra["danhhieu"].ToString(),
                    int.Parse(dra["magiaovien"].ToString()));
            }
            dra.Dispose();
            return(d);
        }
Beispiel #4
0
        //public IList<HocSinh> getAll(int PageNo, int PageSize, string Tenhocsinh, string Quequan, out int RecordCount)
        //{
        //    SqlParameter[] parm = new SqlParameter[]
        //   {
        //       new SqlParameter("@PageIndex",SqlDbType.Int),
        //        new SqlParameter("@PageSize",SqlDbType.Int),
        //        new SqlParameter("@tenhocsinh",SqlDbType.NVarChar,20),
        //        new SqlParameter("@quequan",SqlDbType.NVarChar,20),
        //   };
        //    parm[0].Value = PageNo;
        //    parm[1].Value = PageSize;
        //    parm[2].Value = Tenhocsinh;
        //    parm[3].Value = Quequan;

        //    RecordCount = 0;
        //    SqlDataReader dra = DataAccessHelper.ExecuteReader(DataAccessHelper.ConnectionString, CommandType.StoredProcedure, "tbl_HocSinh_Sell_All_Page", parm);
        //    IList<HocSinh> list = new List<HocSinh>();
        //    while (dra.Read())
        //    {
        //        RecordCount = int.Parse(dra["RecordCount"].ToString());
        //        list.Add(new HocSinh(
        //            int.Parse(dra["mahocsinh"].ToString()),
        //            int.Parse(dra["malop"].ToString()),
        //            dra["tenhocsinh"].ToString(),
        //            DateTime.Parse(dra["ngaysinh"].ToString()),
        //            dra["gioitinh"].ToString(),
        //            dra["quequan"].ToString(),
        //            dra["sodienthoai"].ToString(),
        //            dra["socmnd"].ToString()));
        //    }
        //    dra.Dispose();
        //    return list;
        //}

        public HocSinh getmaHocSinh(int mahocsinh)
        {
            SqlParameter[] parm = new SqlParameter[]
            {
                new SqlParameter(PARM_MAHOCSINH, SqlDbType.Int)
            };
            parm[0].Value = mahocsinh;
            HocSinh       hs  = null;
            SqlDataReader dra = DataAccessHelper.ExecuteReader(DataAccessHelper.ConnectionString, CommandType.StoredProcedure, "tbl_HocSinh_Sel_ID", parm);

            if (dra.Read())
            {
                hs = new HocSinh(
                    int.Parse(dra["mahocsinh"].ToString()),
                    int.Parse(dra["malop"].ToString()),
                    dra["tenhocsinh"].ToString(),
                    DateTime.Parse(dra["ngaysinh"].ToString()),
                    dra["gioitinh"].ToString(),
                    dra["quequan"].ToString(),
                    dra["sodienthoai"].ToString(),
                    dra["socmnd"].ToString());
            }
            dra.Dispose();
            return(hs);
        }
Beispiel #5
0
        public IList <KhoiHoc> getAll()
        {
            SqlDataReader   dra  = DataAccessHelper.ExecuteReader(DataAccessHelper.ConnectionString, CommandType.StoredProcedure, "tbl_KhoiHoc_Sel_All", null);
            IList <KhoiHoc> list = new List <KhoiHoc>();

            while (dra.Read())
            {
                list.Add(new KhoiHoc(
                             int.Parse(dra["makhoihoc"].ToString()),
                             dra["tenkhoihoc"].ToString()));
            }
            dra.Dispose();
            return(list);
        }
Beispiel #6
0
        public IList <LoaiDiem> getAll()
        {
            SqlDataReader    dra  = DataAccessHelper.ExecuteReader(DataAccessHelper.ConnectionString, CommandType.StoredProcedure, "tbl_LoaiDiem_Sel_All", null);
            IList <LoaiDiem> list = new List <LoaiDiem>();

            while (dra.Read())
            {
                list.Add(new LoaiDiem(
                             int.Parse(dra["maloaidiem"].ToString()),
                             dra["tenloaidiem"].ToString(),
                             int.Parse(dra["heso"].ToString())));
            }
            dra.Dispose();
            return(list);
        }
Beispiel #7
0
        public KhoiHoc getmaKhoiHoc(int makhoihoc)
        {
            SqlParameter[] parm = new SqlParameter[]
            {
                new SqlParameter(PARM_MAKHOIHOC, SqlDbType.Int)
            };
            parm[0].Value = makhoihoc;
            KhoiHoc       cls = null;
            SqlDataReader dra = DataAccessHelper.ExecuteReader(DataAccessHelper.ConnectionString, CommandType.StoredProcedure, "tbl_KhoiHoc_Sel_ID", parm);

            if (dra.Read())
            {
                cls = new KhoiHoc(
                    int.Parse(dra["makhoihoc"].ToString()),
                    dra["tenkhoihoc"].ToString());
            }
            dra.Dispose();
            return(cls);
        }
Beispiel #8
0
        public IList <GiaoVien> getAll()
        {
            SqlDataReader    dra  = DataAccessHelper.ExecuteReader(DataAccessHelper.ConnectionString, CommandType.StoredProcedure, "tbl_GiaoVien_Sel_All", null);
            IList <GiaoVien> list = new List <GiaoVien>();

            while (dra.Read())
            {
                list.Add(new GiaoVien(
                             int.Parse(dra["magiaovien"].ToString()),
                             dra["tengiaovien"].ToString(),
                             DateTime.Parse(dra["ngaysinh"].ToString()),
                             dra["gioitinh"].ToString(),
                             dra["quequan"].ToString(),
                             dra["sodienthoai"].ToString(),
                             dra["socmnd"].ToString()));
            }
            dra.Dispose();
            return(list);
        }
Beispiel #9
0
        public LoaiDiem getmaLoaiDiem(int maloaidiem)
        {
            SqlParameter[] parm = new SqlParameter[]
            {
                new SqlParameter(PARM_MALOAIDIEM, SqlDbType.Int)
            };
            parm[0].Value = maloaidiem;
            LoaiDiem      ld  = null;
            SqlDataReader dra = DataAccessHelper.ExecuteReader(DataAccessHelper.ConnectionString, CommandType.StoredProcedure, "tbl_LoaiDiem_Sel_ID", parm);

            if (dra.Read())
            {
                ld = new LoaiDiem(
                    int.Parse(dra["maloaidiem"].ToString()),
                    dra["tenloaidiem"].ToString(),
                    int.Parse(dra["heso"].ToString()));
            }
            dra.Dispose();
            return(ld);
        }
Beispiel #10
0
        public MonHoc getmaMonHoc(int mamonhoc)
        {
            SqlParameter[] parm = new SqlParameter[]
            {
                new SqlParameter(PARM_MAMONHOC, SqlDbType.Int)
            };
            parm[0].Value = mamonhoc;
            MonHoc        l   = null;
            SqlDataReader dra = DataAccessHelper.ExecuteReader(DataAccessHelper.ConnectionString, CommandType.StoredProcedure, "tbl_MonHoc_Sel_ID", parm);

            if (dra.Read())
            {
                l = new MonHoc(
                    int.Parse(dra["mamonhoc"].ToString()),
                    dra["tenmonhoc"].ToString(),
                    int.Parse(dra["sotiet"].ToString()));
            }
            dra.Dispose();
            return(l);
        }
Beispiel #11
0
        public IList <CTDiem> getAll()
        {
            SqlDataReader  dra  = DataAccessHelper.ExecuteReader(DataAccessHelper.ConnectionString, CommandType.StoredProcedure, "tbl_CTDiem_Sel_All", null);
            IList <CTDiem> list = new List <CTDiem>();

            while (dra.Read())
            {
                list.Add(new CTDiem(
                             int.Parse(dra["mactdiem"].ToString()),
                             int.Parse(dra["mabangdiem"].ToString()),

                             int.Parse(dra["mahocsinh"].ToString()),
                             int.Parse(dra["mamonhoc"].ToString()),
                             int.Parse(dra["maloaidiem"].ToString()),
                             int.Parse(dra["diem"].ToString()),
                             float.Parse(dra["diemtb"].ToString()),

                             int.Parse(dra["magiaovien"].ToString())));
            }
            dra.Dispose();
            return(list);
        }
Beispiel #12
0
        public LopHoc getmaLopHoc(int malop)
        {
            SqlParameter[] parm = new SqlParameter[]
            {
                new SqlParameter(PARM_MALOP, SqlDbType.Int)
            };
            parm[0].Value = malop;
            LopHoc        l   = null;
            SqlDataReader dra = DataAccessHelper.ExecuteReader(DataAccessHelper.ConnectionString, CommandType.StoredProcedure, "tbl_LopHoc_Sel_ID", parm);

            if (dra.Read())
            {
                l = new LopHoc(
                    int.Parse(dra["malop"].ToString()),
                    dra["tenlop"].ToString(),
                    int.Parse(dra["makhoihoc"].ToString()),
                    int.Parse(dra["magiaovien"].ToString()),
                    int.Parse(dra["siso"].ToString()));
            }
            dra.Dispose();
            return(l);
        }
Beispiel #13
0
        public IList <Diem> getAll(int PageNo, int PageSize, int Malop, int Kihoc, string Namhoc, out int RecordCount)
        {
            SqlParameter[] parm = new SqlParameter[]
            {
                new SqlParameter("@PageIndex", SqlDbType.Int),
                new SqlParameter("@PageSize", SqlDbType.Int),
                new SqlParameter("@malop", SqlDbType.Int),
                new SqlParameter("@kihoc", SqlDbType.Int),
                new SqlParameter("@namhoc", SqlDbType.NVarChar, 20),
            };
            parm[0].Value = PageNo;
            parm[1].Value = PageSize;
            parm[2].Value = Malop;
            parm[3].Value = Kihoc;
            parm[3].Value = Namhoc;

            RecordCount = 0;
            SqlDataReader dra  = DataAccessHelper.ExecuteReader(DataAccessHelper.ConnectionString, CommandType.StoredProcedure, "tbl_HocSinh_Sell_All_Page", parm);
            IList <Diem>  list = new List <Diem>();

            while (dra.Read())
            {
                RecordCount = int.Parse(dra["RecordCount"].ToString());

                list.Add(new Diem(
                             int.Parse(dra["mabangdiem"].ToString()),
                             int.Parse(dra["malop"].ToString()),
                             int.Parse(dra["mahocsinh"].ToString()),
                             int.Parse(dra["kihoc"].ToString()),
                             dra["namhoc"].ToString(),
                             float.Parse(dra["diemtb"].ToString()),
                             dra["hanhkiem"].ToString(),
                             dra["hocluc"].ToString(),
                             dra["danhhieu"].ToString(),
                             int.Parse(dra["magiaovien"].ToString())));
            }
            dra.Dispose();
            return(list);
        }
Beispiel #14
0
        public IList <GiaoVien> getAll(int Magiaovien, string Tengiaovien, DateTime Ngaysinh, string Gioitinh, string Quequan, string Sodienthoai, string Socmnd, out int RecordCount)
        {
            SqlParameter[] parm = new SqlParameter[]
            {
                new SqlParameter("@magiaovien", SqlDbType.Int),
                new SqlParameter("@tengiaovien", SqlDbType.NVarChar, 20),
                new SqlParameter("@ngaysinh", SqlDbType.DateTime),
                new SqlParameter("@gioitinh", SqlDbType.NVarChar, 20),
                new SqlParameter("@quequan", SqlDbType.NVarChar, 20),
                new SqlParameter("@sodienthoai", SqlDbType.NVarChar, 20),
                new SqlParameter("@socmnd", SqlDbType.NVarChar, 20),
            };
            parm[0].Value = Magiaovien;
            parm[1].Value = Tengiaovien;
            parm[2].Value = Ngaysinh;
            parm[3].Value = Gioitinh;
            parm[4].Value = Quequan;
            parm[5].Value = Sodienthoai;
            parm[6].Value = Socmnd;
            RecordCount   = 0;
            SqlDataReader    dra  = DataAccessHelper.ExecuteReader(DataAccessHelper.ConnectionString, CommandType.StoredProcedure, "tbl_GiaoVien_Sel_All_Page", parm);
            IList <GiaoVien> list = new List <GiaoVien>();

            while (dra.Read())
            {
                RecordCount = int.Parse(dra["RecordCount"].ToString());
                list.Add(new GiaoVien(
                             int.Parse(dra["magiaovien"].ToString()),
                             dra["tengiaovien"].ToString(),
                             DateTime.Parse(dra["ngaysinh"].ToString()),
                             dra["gioitinh"].ToString(),
                             dra["quequan"].ToString(),
                             dra["sodienthoai"].ToString(),
                             dra["socmnd"].ToString()));
            }
            dra.Dispose();
            return(list);
        }
Beispiel #15
0
        public GiaoVien getmaGiaoVien(int magiaovien)
        {
            SqlParameter[] parm = new SqlParameter[]
            {
                new SqlParameter(PARM_MAGIAOVIEN, SqlDbType.Int)
            };
            parm[0].Value = magiaovien;
            GiaoVien      gv  = null;
            SqlDataReader dra = DataAccessHelper.ExecuteReader(DataAccessHelper.ConnectionString, CommandType.StoredProcedure, "tbl_KhoiHoc_Sel_ID", parm);

            if (dra.Read())
            {
                gv = new GiaoVien(
                    int.Parse(dra["magiaovien"].ToString()),
                    dra["tengiaovien"].ToString(),
                    DateTime.Parse(dra["ngaysinh"].ToString()),
                    dra["gioitinh"].ToString(),
                    dra["quequan"].ToString(),
                    dra["sodienthoai"].ToString(),
                    dra["socmnd"].ToString());
            }
            dra.Dispose();
            return(gv);
        }
Beispiel #16
0
        public Users checkAccount(string tenuser, string password)
        {
            SqlParameter[] parm = new SqlParameter[]
            {
                new SqlParameter(PARM_TENUSER, SqlDbType.NVarChar, 20),
                new SqlParameter(PARM_PASSWORD, SqlDbType.NVarChar, 20),
            };
            parm[0].Value = tenuser;
            parm[1].Value = password;
            Users         cls = null;
            SqlDataReader dra = DataAccessHelper.ExecuteReader(DataAccessHelper.ConnectionString, CommandType.StoredProcedure, "tbl_User_CheckAccount", parm);

            if (dra.Read())
            {
                cls = new Users(
                    int.Parse(dra["mauser"].ToString()),
                    dra["tenuser"].ToString(),
                    dra["passwword"].ToString(),
                    dra["tenrole"].ToString(),
                    dra["trangthai"].ToString());
            }
            dra.Dispose();
            return(cls);
        }