Hotel/Common/PublicMethod.cs

(开头部分) 22KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.Data;
using System.Data.SqlClient;
using System.Web;
using System.Web.UI.WebControls;
using System.Text.RegularExpressions;
using System.Linq;
using System.Collections;
using Common.Data.SqlServer;
namespace Common
{
    public class PublicMethod
    {

        #region 取得某表中的總記錄數

        /// <summary>
        /// 取得某表中的總記錄數
        /// </summary>
        /// <param name="tablename">表名</param>
        /// <returns></returns>
        public static int GetRecordCount(string tablename)
        {
            string s = "select count(*) from {0}";
            s = string.Format(s, tablename);
            return Convert.ToInt32(SqlEasy.ExecuteScalar(s));
        }

        public static int GetRecordCount(string tablename, string where)
        {
            string s = "select count(*) from {0} ";
            s = string.Format(s, tablename);
            if (!string.IsNullOrEmpty(where))
                s += " where " + where;
            return Convert.ToInt32(SqlHelper.ExecuteScalar(SqlEasy.connString, CommandType.Text, s));
        }

        public static int GetRecordCount(string connString, string tablename, string where)
        {
            string s = "select count(*) from {0} ";
            s = string.Format(s, tablename);
            if (!string.IsNullOrEmpty(where))
                s += " where " + where;
            return Convert.ToInt32(SqlHelper.ExecuteScalar(connString, CommandType.Text, s));
        }


        #endregion

        #region 根據條件取得指定表中的數據

        /// <summary>
        /// 根據條件取得指定表中的數據
        /// </summary>
        /// <param name="tablename">表名</param>
        /// <param name="where">條件</param>
        /// <returns></returns>
后面还有 594 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。