| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601 |
- using CallCenterApi.DB;
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Data.SqlClient;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace CallCenterApi.DAL
- {
- /// <summary>
- /// 数据访问类:T_Sys_Customer
- /// </summary>
- public partial class T_Sys_Customer
- {
- public T_Sys_Customer()
- { }
- #region BasicMethod
- /// <summary>
- /// 得到最大ID
- /// </summary>
- public int GetMaxId()
- {
- return DbHelperSQL.GetMaxID("F_ID", "T_Sys_Customer");
- }
- /// <summary>
- /// 是否存在该记录
- /// </summary>
- public bool Exists(int F_ID)
- {
- StringBuilder strSql = new StringBuilder();
- strSql.Append("select count(1) from T_Sys_Customer");
- strSql.Append(" where F_ID=@F_ID");
- SqlParameter[] parameters = {
- new SqlParameter("@F_ID", SqlDbType.Int,4)
- };
- parameters[0].Value = F_ID;
- return DbHelperSQL.Exists(strSql.ToString(), parameters);
- }
- /// <summary>
- /// 增加一条数据
- /// </summary>
- public int Add(CallCenterApi.Model.T_Sys_Customer model)
- {
- StringBuilder strSql = new StringBuilder();
- strSql.Append("insert into T_Sys_Customer(");
- strSql.Append("customer_no,customer_name,identify_no,customer_sex,customer_birthday,customer_phone,customer_mobile,customer_number,ambulance_enter,live_condition,children_condition,remarks,customer_ukey,spouse_name,spouse_identifyNo,spouse_sex,spouse_birthday,account_address,customer_address,post_code,waiter_name,customer_belongs,neighborhood_phone,machine_no,owned_property,property_phone,police_belongs,police_phone,use_status,charge_kind,F_IsDelete,F_CreateTime,F_UpdateTime,icon)");
- strSql.Append(" values (");
- strSql.Append("@customer_no,@customer_name,@identify_no,@customer_sex,@customer_birthday,@customer_phone,@customer_mobile,@customer_number,@ambulance_enter,@live_condition,@children_condition,@remarks,@customer_ukey,@spouse_name,@spouse_identifyNo,@spouse_sex,@spouse_birthday,@account_address,@customer_address,@post_code,@waiter_name,@customer_belongs,@neighborhood_phone,@machine_no,@owned_property,@property_phone,@police_belongs,@police_phone,@use_status,@charge_kind,@F_IsDelete,@F_CreateTime,@F_UpdateTime,icon)");
- strSql.Append(";select @@IDENTITY");
- SqlParameter[] parameters = {
- new SqlParameter("@customer_no", SqlDbType.NVarChar,100),
- new SqlParameter("@customer_name", SqlDbType.NVarChar,100),
- new SqlParameter("@identify_no", SqlDbType.NVarChar,50),
- new SqlParameter("@customer_sex", SqlDbType.NVarChar,50),
- new SqlParameter("@customer_birthday", SqlDbType.NVarChar,50),
- new SqlParameter("@customer_phone", SqlDbType.NVarChar,50),
- new SqlParameter("@customer_mobile", SqlDbType.NVarChar,50),
- new SqlParameter("@customer_number", SqlDbType.NVarChar,50),
- new SqlParameter("@ambulance_enter", SqlDbType.NVarChar,50),
- new SqlParameter("@live_condition", SqlDbType.NVarChar,50),
- new SqlParameter("@children_condition", SqlDbType.NVarChar,50),
- new SqlParameter("@remarks", SqlDbType.NVarChar,-1),
- new SqlParameter("@customer_ukey", SqlDbType.NVarChar,100),
- new SqlParameter("@spouse_name", SqlDbType.NVarChar,50),
- new SqlParameter("@spouse_identifyNo", SqlDbType.NVarChar,50),
- new SqlParameter("@spouse_sex", SqlDbType.NVarChar,50),
- new SqlParameter("@spouse_birthday", SqlDbType.NVarChar,50),
- new SqlParameter("@account_address", SqlDbType.NVarChar,500),
- new SqlParameter("@customer_address", SqlDbType.NVarChar,500),
- new SqlParameter("@post_code", SqlDbType.NVarChar,50),
- new SqlParameter("@waiter_name", SqlDbType.NVarChar,50),
- new SqlParameter("@customer_belongs", SqlDbType.NVarChar,500),
- new SqlParameter("@neighborhood_phone", SqlDbType.NVarChar,50),
- new SqlParameter("@machine_no", SqlDbType.NVarChar,50),
- new SqlParameter("@owned_property", SqlDbType.NVarChar,500),
- new SqlParameter("@property_phone", SqlDbType.NVarChar,50),
- new SqlParameter("@police_belongs", SqlDbType.NVarChar,50),
- new SqlParameter("@police_phone", SqlDbType.NVarChar,50),
- new SqlParameter("@use_status", SqlDbType.NVarChar,50),
- new SqlParameter("@charge_kind", SqlDbType.NVarChar,50),
- new SqlParameter("@F_IsDelete", SqlDbType.Int,4),
- new SqlParameter("@F_CreateTime", SqlDbType.DateTime),
- new SqlParameter("@F_UpdateTime", SqlDbType.DateTime),
- new SqlParameter("@icon", SqlDbType.NVarChar,500),
- };
- parameters[0].Value = model.customer_no;
- parameters[1].Value = model.customer_name;
- parameters[2].Value = model.identify_no;
- parameters[3].Value = model.customer_sex;
- parameters[4].Value = model.customer_birthday;
- parameters[5].Value = model.customer_phone;
- parameters[6].Value = model.customer_mobile;
- parameters[7].Value = model.customer_number;
- parameters[8].Value = model.ambulance_enter;
- parameters[9].Value = model.live_condition;
- parameters[10].Value = model.children_condition;
- parameters[11].Value = model.remarks;
- parameters[12].Value = model.customer_ukey;
- parameters[13].Value = model.spouse_name;
- parameters[14].Value = model.spouse_identifyNo;
- parameters[15].Value = model.spouse_sex;
- parameters[16].Value = model.spouse_birthday;
- parameters[17].Value = model.account_address;
- parameters[18].Value = model.customer_address;
- parameters[19].Value = model.post_code;
- parameters[20].Value = model.waiter_name;
- parameters[21].Value = model.customer_belongs;
- parameters[22].Value = model.neighborhood_phone;
- parameters[23].Value = model.machine_no;
- parameters[24].Value = model.owned_property;
- parameters[25].Value = model.property_phone;
- parameters[26].Value = model.police_belongs;
- parameters[27].Value = model.police_phone;
- parameters[28].Value = model.use_status;
- parameters[29].Value = model.charge_kind;
- parameters[30].Value = model.F_IsDelete;
- parameters[31].Value = model.F_CreateTime;
- parameters[32].Value = model.F_UpdateTime;
- parameters[33].Value = model.icon;
-
- object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
- if (obj == null)
- {
- return 0;
- }
- else
- {
- return Convert.ToInt32(obj);
- }
- }
- /// <summary>
- /// 更新一条数据
- /// </summary>
- public bool Update(CallCenterApi.Model.T_Sys_Customer model)
- {
- StringBuilder strSql = new StringBuilder();
- strSql.Append("update T_Sys_Customer set ");
- strSql.Append("customer_no=@customer_no,");
- strSql.Append("customer_name=@customer_name,");
- strSql.Append("identify_no=@identify_no,");
- strSql.Append("customer_sex=@customer_sex,");
- strSql.Append("customer_birthday=@customer_birthday,");
- strSql.Append("customer_phone=@customer_phone,");
- strSql.Append("customer_mobile=@customer_mobile,");
- strSql.Append("customer_number=@customer_number,");
- strSql.Append("ambulance_enter=@ambulance_enter,");
- strSql.Append("live_condition=@live_condition,");
- strSql.Append("children_condition=@children_condition,");
- strSql.Append("remarks=@remarks,");
- strSql.Append("customer_ukey=@customer_ukey,");
- strSql.Append("spouse_name=@spouse_name,");
- strSql.Append("spouse_identifyNo=@spouse_identifyNo,");
- strSql.Append("spouse_sex=@spouse_sex,");
- strSql.Append("spouse_birthday=@spouse_birthday,");
- strSql.Append("account_address=@account_address,");
- strSql.Append("customer_address=@customer_address,");
- strSql.Append("post_code=@post_code,");
- strSql.Append("waiter_name=@waiter_name,");
- strSql.Append("customer_belongs=@customer_belongs,");
- strSql.Append("neighborhood_phone=@neighborhood_phone,");
- strSql.Append("machine_no=@machine_no,");
- strSql.Append("owned_property=@owned_property,");
- strSql.Append("property_phone=@property_phone,");
- strSql.Append("police_belongs=@police_belongs,");
- strSql.Append("police_phone=@police_phone,");
- strSql.Append("use_status=@use_status,");
- strSql.Append("charge_kind=@charge_kind,");
- strSql.Append("F_IsDelete=@F_IsDelete,");
- strSql.Append("F_CreateTime=@F_CreateTime,");
- strSql.Append("icon=@icon,");
- strSql.Append("F_UpdateTime=@F_UpdateTime");
- strSql.Append(" where F_ID=@F_ID");
- SqlParameter[] parameters = {
- new SqlParameter("@customer_no", SqlDbType.NVarChar,100),
- new SqlParameter("@customer_name", SqlDbType.NVarChar,100),
- new SqlParameter("@identify_no", SqlDbType.NVarChar,50),
- new SqlParameter("@customer_sex", SqlDbType.NVarChar,50),
- new SqlParameter("@customer_birthday", SqlDbType.NVarChar,50),
- new SqlParameter("@customer_phone", SqlDbType.NVarChar,50),
- new SqlParameter("@customer_mobile", SqlDbType.NVarChar,50),
- new SqlParameter("@customer_number", SqlDbType.NVarChar,50),
- new SqlParameter("@ambulance_enter", SqlDbType.NVarChar,50),
- new SqlParameter("@live_condition", SqlDbType.NVarChar,50),
- new SqlParameter("@children_condition", SqlDbType.NVarChar,50),
- new SqlParameter("@remarks", SqlDbType.NVarChar,-1),
- new SqlParameter("@customer_ukey", SqlDbType.NVarChar,100),
- new SqlParameter("@spouse_name", SqlDbType.NVarChar,50),
- new SqlParameter("@spouse_identifyNo", SqlDbType.NVarChar,50),
- new SqlParameter("@spouse_sex", SqlDbType.NVarChar,50),
- new SqlParameter("@spouse_birthday", SqlDbType.NVarChar,50),
- new SqlParameter("@account_address", SqlDbType.NVarChar,500),
- new SqlParameter("@customer_address", SqlDbType.NVarChar,500),
- new SqlParameter("@post_code", SqlDbType.NVarChar,50),
- new SqlParameter("@waiter_name", SqlDbType.NVarChar,50),
- new SqlParameter("@customer_belongs", SqlDbType.NVarChar,500),
- new SqlParameter("@neighborhood_phone", SqlDbType.NVarChar,50),
- new SqlParameter("@machine_no", SqlDbType.NVarChar,50),
- new SqlParameter("@owned_property", SqlDbType.NVarChar,500),
- new SqlParameter("@property_phone", SqlDbType.NVarChar,50),
- new SqlParameter("@police_belongs", SqlDbType.NVarChar,50),
- new SqlParameter("@police_phone", SqlDbType.NVarChar,50),
- new SqlParameter("@use_status", SqlDbType.NVarChar,50),
- new SqlParameter("@charge_kind", SqlDbType.NVarChar,50),
- new SqlParameter("@F_IsDelete", SqlDbType.Int,4),
- new SqlParameter("@F_CreateTime", SqlDbType.DateTime),
- new SqlParameter("@icon", SqlDbType.NVarChar,500),
- new SqlParameter("@F_UpdateTime", SqlDbType.DateTime),
- new SqlParameter("@F_ID", SqlDbType.Int,4)};
- parameters[0].Value = model.customer_no;
- parameters[1].Value = model.customer_name;
- parameters[2].Value = model.identify_no;
- parameters[3].Value = model.customer_sex;
- parameters[4].Value = model.customer_birthday;
- parameters[5].Value = model.customer_phone;
- parameters[6].Value = model.customer_mobile;
- parameters[7].Value = model.customer_number;
- parameters[8].Value = model.ambulance_enter;
- parameters[9].Value = model.live_condition;
- parameters[10].Value = model.children_condition;
- parameters[11].Value = model.remarks;
- parameters[12].Value = model.customer_ukey;
- parameters[13].Value = model.spouse_name;
- parameters[14].Value = model.spouse_identifyNo;
- parameters[15].Value = model.spouse_sex;
- parameters[16].Value = model.spouse_birthday;
- parameters[17].Value = model.account_address;
- parameters[18].Value = model.customer_address;
- parameters[19].Value = model.post_code;
- parameters[20].Value = model.waiter_name;
- parameters[21].Value = model.customer_belongs;
- parameters[22].Value = model.neighborhood_phone;
- parameters[23].Value = model.machine_no;
- parameters[24].Value = model.owned_property;
- parameters[25].Value = model.property_phone;
- parameters[26].Value = model.police_belongs;
- parameters[27].Value = model.police_phone;
- parameters[28].Value = model.use_status;
- parameters[29].Value = model.charge_kind;
- parameters[30].Value = model.F_IsDelete;
- parameters[31].Value = model.F_CreateTime;
- parameters[32].Value = model.icon;
- parameters[33].Value = model.F_UpdateTime;
- parameters[34].Value = model.F_ID;
- int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
- if (rows > 0)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- /// <summary>
- /// 删除一条数据
- /// </summary>
- public bool Delete(int F_ID)
- {
- StringBuilder strSql = new StringBuilder();
- strSql.Append("delete from T_Sys_Customer ");
- strSql.Append(" where F_ID=@F_ID");
- SqlParameter[] parameters = {
- new SqlParameter("@F_ID", SqlDbType.Int,4)
- };
- parameters[0].Value = F_ID;
- int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
- if (rows > 0)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- /// <summary>
- /// 批量删除数据
- /// </summary>
- public bool DeleteList(string F_IDlist)
- {
- StringBuilder strSql = new StringBuilder();
- strSql.Append("delete from T_Sys_Customer ");
- strSql.Append(" where F_ID in (" + F_IDlist + ") ");
- int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
- if (rows > 0)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- /// <summary>
- /// 得到一个对象实体
- /// </summary>
- public CallCenterApi.Model.T_Sys_Customer GetModel(int F_ID)
- {
- StringBuilder strSql = new StringBuilder();
- strSql.Append("select top 1 F_ID,customer_no,customer_name,identify_no,customer_sex,customer_birthday,customer_phone,customer_mobile,customer_number,ambulance_enter,live_condition,children_condition,remarks,customer_ukey,spouse_name,spouse_identifyNo,spouse_sex,spouse_birthday,account_address,customer_address,post_code,waiter_name,customer_belongs,neighborhood_phone,machine_no,owned_property,property_phone,police_belongs,police_phone,use_status,charge_kind,F_IsDelete,F_CreateTime,F_UpdateTime,icon from T_Sys_Customer ");
- strSql.Append(" where F_ID=@F_ID");
- SqlParameter[] parameters = {
- new SqlParameter("@F_ID", SqlDbType.Int,4)
- };
- parameters[0].Value = F_ID;
- CallCenterApi.Model.T_Sys_Customer model = new CallCenterApi.Model.T_Sys_Customer();
- DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
- if (ds.Tables[0].Rows.Count > 0)
- {
- return DataRowToModel(ds.Tables[0].Rows[0]);
- }
- else
- {
- return null;
- }
- }
- /// <summary>
- /// 得到一个对象实体
- /// </summary>
- public CallCenterApi.Model.T_Sys_Customer DataRowToModel(DataRow row)
- {
- CallCenterApi.Model.T_Sys_Customer model = new CallCenterApi.Model.T_Sys_Customer();
- if (row != null)
- {
- if (row["F_ID"] != null && row["F_ID"].ToString() != "")
- {
- model.F_ID = int.Parse(row["F_ID"].ToString());
- }
- if (row["customer_no"] != null)
- {
- model.customer_no = row["customer_no"].ToString();
- }
- if (row["customer_name"] != null)
- {
- model.customer_name = row["customer_name"].ToString();
- }
- if (row["identify_no"] != null)
- {
- model.identify_no = row["identify_no"].ToString();
- }
- if (row["customer_sex"] != null)
- {
- model.customer_sex = row["customer_sex"].ToString();
- }
- if (row["customer_birthday"] != null)
- {
- model.customer_birthday = row["customer_birthday"].ToString();
- }
- if (row["customer_phone"] != null)
- {
- model.customer_phone = row["customer_phone"].ToString();
- }
- if (row["customer_mobile"] != null)
- {
- model.customer_mobile = row["customer_mobile"].ToString();
- }
- if (row["customer_number"] != null)
- {
- model.customer_number = row["customer_number"].ToString();
- }
- if (row["ambulance_enter"] != null)
- {
- model.ambulance_enter = row["ambulance_enter"].ToString();
- }
- if (row["live_condition"] != null)
- {
- model.live_condition = row["live_condition"].ToString();
- }
- if (row["children_condition"] != null)
- {
- model.children_condition = row["children_condition"].ToString();
- }
- if (row["remarks"] != null)
- {
- model.remarks = row["remarks"].ToString();
- }
- if (row["customer_ukey"] != null)
- {
- model.customer_ukey = row["customer_ukey"].ToString();
- }
- if (row["spouse_name"] != null)
- {
- model.spouse_name = row["spouse_name"].ToString();
- }
- if (row["spouse_identifyNo"] != null)
- {
- model.spouse_identifyNo = row["spouse_identifyNo"].ToString();
- }
- if (row["spouse_sex"] != null)
- {
- model.spouse_sex = row["spouse_sex"].ToString();
- }
- if (row["spouse_birthday"] != null)
- {
- model.spouse_birthday = row["spouse_birthday"].ToString();
- }
- if (row["account_address"] != null)
- {
- model.account_address = row["account_address"].ToString();
- }
- if (row["customer_address"] != null)
- {
- model.customer_address = row["customer_address"].ToString();
- }
- if (row["post_code"] != null)
- {
- model.post_code = row["post_code"].ToString();
- }
- if (row["waiter_name"] != null)
- {
- model.waiter_name = row["waiter_name"].ToString();
- }
- if (row["customer_belongs"] != null)
- {
- model.customer_belongs = row["customer_belongs"].ToString();
- }
- if (row["neighborhood_phone"] != null)
- {
- model.neighborhood_phone = row["neighborhood_phone"].ToString();
- }
- if (row["machine_no"] != null)
- {
- model.machine_no = row["machine_no"].ToString();
- }
- if (row["owned_property"] != null)
- {
- model.owned_property = row["owned_property"].ToString();
- }
- if (row["property_phone"] != null)
- {
- model.property_phone = row["property_phone"].ToString();
- }
- if (row["police_belongs"] != null)
- {
- model.police_belongs = row["police_belongs"].ToString();
- }
- if (row["police_phone"] != null)
- {
- model.police_phone = row["police_phone"].ToString();
- }
- if (row["use_status"] != null)
- {
- model.use_status = row["use_status"].ToString();
- }
- if (row["charge_kind"] != null)
- {
- model.charge_kind = row["charge_kind"].ToString();
- }
- if (row["F_IsDelete"] != null && row["F_IsDelete"].ToString() != "")
- {
- model.F_IsDelete = int.Parse(row["F_IsDelete"].ToString());
- }
- if (row["F_CreateTime"] != null && row["F_CreateTime"].ToString() != "")
- {
- model.F_CreateTime = DateTime.Parse(row["F_CreateTime"].ToString());
- }
- if (row["F_UpdateTime"] != null && row["F_UpdateTime"].ToString() != "")
- {
- model.F_UpdateTime = DateTime.Parse(row["F_UpdateTime"].ToString());
- }
- if (row["icon"] != null)
- {
- model.icon = row["icon"].ToString();
- }
-
- }
- return model;
- }
- /// <summary>
- /// 获得数据列表
- /// </summary>
- public DataSet GetList(string strWhere)
- {
- StringBuilder strSql = new StringBuilder();
- strSql.Append("select F_ID,customer_no,customer_name,identify_no,customer_sex,customer_birthday,customer_phone,customer_mobile,customer_number,ambulance_enter,live_condition,children_condition,remarks,customer_ukey,spouse_name,spouse_identifyNo,spouse_sex,spouse_birthday,account_address,customer_address,post_code,waiter_name,customer_belongs,neighborhood_phone,machine_no,owned_property,property_phone,police_belongs,police_phone,use_status,charge_kind,F_IsDelete,F_CreateTime,F_UpdateTime,icon ");
- strSql.Append(" FROM T_Sys_Customer ");
- if (strWhere.Trim() != "")
- {
- strSql.Append(" where " + strWhere);
- }
- return DbHelperSQL.Query(strSql.ToString());
- }
- /// <summary>
- /// 获得前几行数据
- /// </summary>
- public DataSet GetList(int Top, string strWhere, string filedOrder)
- {
- StringBuilder strSql = new StringBuilder();
- strSql.Append("select ");
- if (Top > 0)
- {
- strSql.Append(" top " + Top.ToString());
- }
- strSql.Append(" F_ID,customer_no,customer_name,identify_no,customer_sex,customer_birthday,customer_phone,customer_mobile,customer_number,ambulance_enter,live_condition,children_condition,remarks,customer_ukey,spouse_name,spouse_identifyNo,spouse_sex,spouse_birthday,account_address,customer_address,post_code,waiter_name,customer_belongs,neighborhood_phone,machine_no,owned_property,property_phone,police_belongs,police_phone,use_status,charge_kind,F_IsDelete,F_CreateTime,F_UpdateTime,icon ");
- strSql.Append(" FROM T_Sys_Customer ");
- if (strWhere.Trim() != "")
- {
- strSql.Append(" where " + strWhere);
- }
- strSql.Append(" order by " + filedOrder);
- return DbHelperSQL.Query(strSql.ToString());
- }
- /// <summary>
- /// 获取记录总数
- /// </summary>
- public int GetRecordCount(string strWhere)
- {
- StringBuilder strSql = new StringBuilder();
- strSql.Append("select count(1) FROM T_Sys_Customer ");
- if (strWhere.Trim() != "")
- {
- strSql.Append(" where " + strWhere);
- }
- object obj = DbHelperSQL.GetSingle(strSql.ToString());
- if (obj == null)
- {
- return 0;
- }
- else
- {
- return Convert.ToInt32(obj);
- }
- }
- /// <summary>
- /// 分页获取数据列表
- /// </summary>
- public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
- {
- StringBuilder strSql = new StringBuilder();
- strSql.Append("SELECT * FROM ( ");
- strSql.Append(" SELECT ROW_NUMBER() OVER (");
- if (!string.IsNullOrEmpty(orderby.Trim()))
- {
- strSql.Append("order by T." + orderby);
- }
- else
- {
- strSql.Append("order by T.F_ID desc");
- }
- strSql.Append(")AS Row, T.* from T_Sys_Customer T ");
- if (!string.IsNullOrEmpty(strWhere.Trim()))
- {
- strSql.Append(" WHERE " + strWhere);
- }
- strSql.Append(" ) TT");
- strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
- return DbHelperSQL.Query(strSql.ToString());
- }
- /*
- /// <summary>
- /// 分页获取数据列表
- /// </summary>
- public DataSet GetList(int PageSize,int PageIndex,string strWhere)
- {
- SqlParameter[] parameters = {
- new SqlParameter("@tblName", SqlDbType.VarChar, 255),
- new SqlParameter("@fldName", SqlDbType.VarChar, 255),
- new SqlParameter("@PageSize", SqlDbType.Int),
- new SqlParameter("@PageIndex", SqlDbType.Int),
- new SqlParameter("@IsReCount", SqlDbType.Bit),
- new SqlParameter("@OrderType", SqlDbType.Bit),
- new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
- };
- parameters[0].Value = "T_Sys_Customer";
- parameters[1].Value = "F_ID";
- parameters[2].Value = PageSize;
- parameters[3].Value = PageIndex;
- parameters[4].Value = 0;
- parameters[5].Value = 0;
- parameters[6].Value = strWhere;
- return CallCenterApi.RunProcedure("UP_GetRecordByPage",parameters,"ds");
- }*/
- #endregion BasicMethod
- #region ExtensionMethod
- #endregion ExtensionMethod
- }
- }
|