Esempio n. 1
0
        public List <OSlide> GetAll()
        {
            List <OSlide> list = new List <OSlide>();

            conn.connect();
            var comm = new SqlCommand("Slide_GetAllSlide", conn.db);

            comm.CommandType = System.Data.CommandType.StoredProcedure;
            DataTable dt = new DataTable();

            dt.Load(comm.ExecuteReader());
            list = Help.DAL.ConvertDataTable <OSlide>(dt);
            conn.Close();
            return(list);
        }
Esempio n. 2
0
        public List <OTacGia> GetAll()
        {
            List <OTacGia> list = new List <OTacGia>();

            conn.connect();
            var comm = new SqlCommand("TacGia_GetAll", conn.db);

            comm.CommandType = System.Data.CommandType.StoredProcedure;
            if (comm == null)
            {
                return(null);
            }
            DataTable dt = new DataTable();

            dt.Load(comm.ExecuteReader());

            list = Help.DAL.ConvertDataTable <OTacGia>(dt);

            conn.Close();
            return(list);
        }
Esempio n. 3
0
        public List <OTinTuc> GetAll()
        {
            conn.connect();
            var comm = new SqlCommand("TinTuc_GetAll", conn.db);

            comm.CommandType = CommandType.StoredProcedure;

            List <OTinTuc> list = new List <OTinTuc>();

            DataTable dt = new DataTable();

            dt.Load(comm.ExecuteReader());
            list = Help.DAL.ConvertDataTable <OTinTuc>(dt);
            conn.Close();
            return(list);
        }
Esempio n. 4
0
        public OAccount Login(string username, string password)
        {
            conn.connect();
            var comm = new SqlCommand("Account_Login", conn.db);

            comm.CommandType = System.Data.CommandType.StoredProcedure;
            comm.Parameters.Add("@UserName", SqlDbType.NVarChar).Value = username;
            comm.Parameters.Add("@Password", SqlDbType.NVarChar).Value = Help.Helper.EncodeSHA1(password);
            DataTable dt = new DataTable();

            dt.Load(comm.ExecuteReader());
            OAccount oAccount = new OAccount();

            oAccount = Help.DAL.ConvertDataTable <OAccount>(dt).FirstOrDefault();
            conn.Close();
            return(oAccount);
        }
Esempio n. 5
0
        public List <OImageSach> GetAll(int masp)
        {
            List <OImageSach> list = new List <OImageSach>();

            conn.connect();
            var comm = new SqlCommand("Image_SanPham_GetByMaSanPham", conn.db);

            comm.CommandType = System.Data.CommandType.StoredProcedure;
            if (comm == null)
            {
                return(null);
            }
            comm.Parameters.Add("@MaSanPham", SqlDbType.Int).Value = masp;

            DataTable dt = new DataTable();

            dt.Load(comm.ExecuteReader());

            list = Help.DAL.ConvertDataTable <OImageSach>(dt);

            conn.Close();
            return(list);
        }
Esempio n. 6
0
        public List <OCTHDB> GetAll(int id)
        {
            List <OCTHDB> list = new List <OCTHDB>();

            conn.connect();
            var comm = new SqlCommand("CTHDB_GetAll", conn.db);

            comm.CommandType = System.Data.CommandType.StoredProcedure;
            if (comm == null)
            {
                return(null);
            }

            comm.Parameters.Add("@MaHDB", SqlDbType.Int).Value = id;

            DataTable dt = new DataTable();

            dt.Load(comm.ExecuteReader());

            list = Help.DAL.ConvertDataTable <OCTHDB>(dt);

            conn.Close();
            return(list);
        }