Beispiel #1
0
        /// <summary>
        /// 数据查询
        /// </summary>
        /// <param name="adminName"></param>
        /// <param name="adminPwd"></param>
        /// <returns></returns>
        public Admin GetAdminInof(string adminName, string adminPwd)
        {
            string sql = "select * from Admin where AdminName=@AdminName and AdminPwd=@AdminPwd";

            SqlParameter[] pars =
            {
                new SqlParameter("@AdminName", SqlDbType.NVarChar, 20),
                new SqlParameter("@AdminPwd",  SqlDbType.NVarChar, 20),
            };
            pars[0].Value = adminName;
            pars[1].Value = adminPwd;
            DataTable da    = SqlHelp.GetTable(sql, CommandType.Text, pars);
            Admin     admin = null;

            if (da.Rows.Count > 0)
            {
                admin = new Admin();
                LoadEntity(admin, da.Rows[0]);
            }
            return(admin);
        }
Beispiel #2
0
        /// <summary>
        /// 获取总页数数据
        /// </summary>
        /// <returns></returns>
        public int GetRecordCount()
        {
            string sql = "select count(*) from BookMsg";

            return(Convert.ToInt32(SqlHelp.ExecuteScalare(sql, CommandType.Text)));
        }