Нет описания

T_Cus_CustomerExpand.cs 47KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897
  1. using CallCenterApi.DB;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.Data.SqlClient;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace CallCenterApi.DAL
  10. {
  11. /// <summary>
  12. /// 数据访问类:T_Cus_CustomerExpand
  13. /// </summary>
  14. public partial class T_Cus_CustomerExpand
  15. {
  16. public T_Cus_CustomerExpand()
  17. { }
  18. #region BasicMethod
  19. /// <summary>
  20. /// 是否存在该记录
  21. /// </summary>
  22. public bool Exists(Guid F_ExpandId)
  23. {
  24. StringBuilder strSql = new StringBuilder();
  25. strSql.Append("select count(1) from T_Cus_CustomerExpand");
  26. strSql.Append(" where F_ExpandId=@F_ExpandId ");
  27. SqlParameter[] parameters = {
  28. new SqlParameter("@F_ExpandId", SqlDbType.UniqueIdentifier,16) };
  29. parameters[0].Value = F_ExpandId;
  30. return DbHelperSQL.Exists(strSql.ToString(), parameters);
  31. }
  32. /// <summary>
  33. /// 增加一条数据
  34. /// </summary>
  35. public bool Add(CallCenterApi.Model.T_Cus_CustomerExpand model)
  36. {
  37. StringBuilder strSql = new StringBuilder();
  38. strSql.Append("insert into T_Cus_CustomerExpand(");
  39. strSql.Append("F_CustomerId,F_StrExpand1,F_StrExpand2,F_StrExpand3,F_StrExpand4,F_StrExpand5,F_StrExpand6,F_StrExpand7,F_StrExpand8,F_StrExpand9,F_StrExpand10,F_StrExpand11,F_StrExpand12,F_StrExpand13,F_StrExpand14,F_StrExpand15,F_StrExpand16,F_StrExpand17,F_StrExpand18,F_StrExpand19,F_StrExpand20,F_StrExpand21,F_StrExpand22,F_StrExpand23,F_StrExpand24,F_StrExpand25,F_StrExpand26,F_StrExpand27,F_StrExpand28,F_StrExpand29,F_StrExpand30,F_StrExpand31,F_StrExpand32,F_StrExpand33,F_StrExpand34,F_StrExpand35,F_StrExpand36,F_StrExpand37,F_StrExpand38,F_StrExpand39,F_StrExpand40)");
  40. strSql.Append(" values (");
  41. strSql.Append("@F_CustomerId,@F_StrExpand1,@F_StrExpand2,@F_StrExpand3,@F_StrExpand4,@F_StrExpand5,@F_StrExpand6,@F_StrExpand7,@F_StrExpand8,@F_StrExpand9,@F_StrExpand10,@F_StrExpand11,@F_StrExpand12,@F_StrExpand13,@F_StrExpand14,@F_StrExpand15,@F_StrExpand16,@F_StrExpand17,@F_StrExpand18,@F_StrExpand19,@F_StrExpand20,@F_StrExpand21,@F_StrExpand22,@F_StrExpand23,@F_StrExpand24,@F_StrExpand25,@F_StrExpand26,@F_StrExpand27,@F_StrExpand28,@F_StrExpand29,@F_StrExpand30,@F_StrExpand31,@F_StrExpand32,@F_StrExpand33,@F_StrExpand34,@F_StrExpand35,@F_StrExpand36,@F_StrExpand37,@F_StrExpand38,@F_StrExpand39,@F_StrExpand40)");
  42. int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), new SqlParameter[] {
  43. new SqlParameter("@F_CustomerId",model.F_CustomerId ),
  44. new SqlParameter("@F_StrExpand1",model. F_StrExpand1) ,
  45. new SqlParameter("@F_StrExpand2",model. F_StrExpand2) ,
  46. new SqlParameter("@F_StrExpand3",model. F_StrExpand3) ,
  47. new SqlParameter("@F_StrExpand4",model. F_StrExpand4) ,
  48. new SqlParameter("@F_StrExpand5",model. F_StrExpand5) ,
  49. new SqlParameter("@F_StrExpand6",model. F_StrExpand6) ,
  50. new SqlParameter("@F_StrExpand7",model. F_StrExpand7) ,
  51. new SqlParameter("@F_StrExpand8",model. F_StrExpand8) ,
  52. new SqlParameter("@F_StrExpand9",model. F_StrExpand9) ,
  53. new SqlParameter("@F_StrExpand10",model.F_StrExpand10),
  54. new SqlParameter("@F_StrExpand11",model.F_StrExpand11),
  55. new SqlParameter("@F_StrExpand12",model.F_StrExpand12),
  56. new SqlParameter("@F_StrExpand13",model.F_StrExpand13),
  57. new SqlParameter("@F_StrExpand14",model.F_StrExpand14),
  58. new SqlParameter("@F_StrExpand15",model.F_StrExpand15),
  59. new SqlParameter("@F_StrExpand16",model.F_StrExpand16),
  60. new SqlParameter("@F_StrExpand17",model.F_StrExpand17),
  61. new SqlParameter("@F_StrExpand18",model.F_StrExpand18),
  62. new SqlParameter("@F_StrExpand19",model.F_StrExpand19),
  63. new SqlParameter("@F_StrExpand20",model.F_StrExpand20),
  64. new SqlParameter("@F_StrExpand21",model.F_StrExpand21),
  65. new SqlParameter("@F_StrExpand22",model.F_StrExpand22),
  66. new SqlParameter("@F_StrExpand23",model.F_StrExpand23),
  67. new SqlParameter("@F_StrExpand24",model.F_StrExpand24),
  68. new SqlParameter("@F_StrExpand25",model.F_StrExpand25),
  69. new SqlParameter("@F_StrExpand26",model.F_StrExpand26),
  70. new SqlParameter("@F_StrExpand27",model.F_StrExpand27),
  71. new SqlParameter("@F_StrExpand28",model.F_StrExpand28),
  72. new SqlParameter("@F_StrExpand29",model.F_StrExpand29),
  73. new SqlParameter("@F_StrExpand30",model.F_StrExpand30),
  74. new SqlParameter("@F_StrExpand31",model.F_StrExpand31),
  75. new SqlParameter("@F_StrExpand32",model.F_StrExpand32),
  76. new SqlParameter("@F_StrExpand33",model.F_StrExpand33),
  77. new SqlParameter("@F_StrExpand34",model.F_StrExpand34),
  78. new SqlParameter("@F_StrExpand35",model.F_StrExpand35),
  79. new SqlParameter("@F_StrExpand36",model.F_StrExpand36),
  80. new SqlParameter("@F_StrExpand37",model.F_StrExpand37),
  81. new SqlParameter("@F_StrExpand38",model.F_StrExpand38),
  82. new SqlParameter("@F_StrExpand39",model.F_StrExpand39),
  83. new SqlParameter("@F_StrExpand40",model.F_StrExpand40)
  84. });
  85. if (rows > 0)
  86. {
  87. return true;
  88. }
  89. else
  90. {
  91. return false;
  92. }
  93. }
  94. /// <summary>
  95. /// 更新一条数据
  96. /// </summary>
  97. public bool Update(CallCenterApi.Model.T_Cus_CustomerExpand model)
  98. {
  99. StringBuilder strSql = new StringBuilder();
  100. strSql.Append("update T_Cus_CustomerExpand set ");
  101. strSql.Append("F_StrExpand1=@F_StrExpand1, ");
  102. strSql.Append("F_StrExpand2=@F_StrExpand2, ");
  103. strSql.Append("F_StrExpand3=@F_StrExpand3, ");
  104. strSql.Append("F_StrExpand4=@F_StrExpand4, ");
  105. strSql.Append("F_StrExpand5=@F_StrExpand5, ");
  106. strSql.Append("F_StrExpand6=@F_StrExpand6, ");
  107. strSql.Append("F_StrExpand7=@F_StrExpand7, ");
  108. strSql.Append("F_StrExpand8=@F_StrExpand8, ");
  109. strSql.Append("F_StrExpand9=@F_StrExpand9, ");
  110. strSql.Append("F_StrExpand10=@F_StrExpand10, ");
  111. strSql.Append("F_StrExpand11=@F_StrExpand11, ");
  112. strSql.Append("F_StrExpand12=@F_StrExpand12, ");
  113. strSql.Append("F_StrExpand13=@F_StrExpand13, ");
  114. strSql.Append("F_StrExpand14=@F_StrExpand14, ");
  115. strSql.Append("F_StrExpand15=@F_StrExpand15, ");
  116. strSql.Append("F_StrExpand16=@F_StrExpand16, ");
  117. strSql.Append("F_StrExpand17=@F_StrExpand17, ");
  118. strSql.Append("F_StrExpand18=@F_StrExpand18, ");
  119. strSql.Append("F_StrExpand19=@F_StrExpand19, ");
  120. strSql.Append("F_StrExpand20=@F_StrExpand20, ");
  121. strSql.Append("F_StrExpand21=@F_StrExpand21, ");
  122. strSql.Append("F_StrExpand22=@F_StrExpand22, ");
  123. strSql.Append("F_StrExpand23=@F_StrExpand23, ");
  124. strSql.Append("F_StrExpand24=@F_StrExpand24, ");
  125. strSql.Append("F_StrExpand25=@F_StrExpand25, ");
  126. strSql.Append("F_StrExpand26=@F_StrExpand26, ");
  127. strSql.Append("F_StrExpand27=@F_StrExpand27, ");
  128. strSql.Append("F_StrExpand28=@F_StrExpand28, ");
  129. strSql.Append("F_StrExpand29=@F_StrExpand29, ");
  130. strSql.Append("F_StrExpand30=@F_StrExpand30, ");
  131. strSql.Append("F_StrExpand31=@F_StrExpand31, ");
  132. strSql.Append("F_StrExpand32=@F_StrExpand32, ");
  133. strSql.Append("F_StrExpand33=@F_StrExpand33, ");
  134. strSql.Append("F_StrExpand34=@F_StrExpand34, ");
  135. strSql.Append("F_StrExpand35=@F_StrExpand35, ");
  136. strSql.Append("F_StrExpand36=@F_StrExpand36, ");
  137. strSql.Append("F_StrExpand37=@F_StrExpand37, ");
  138. strSql.Append("F_StrExpand38=@F_StrExpand38, ");
  139. strSql.Append("F_StrExpand39=@F_StrExpand39, ");
  140. strSql.Append("F_StrExpand40=@F_StrExpand40 ");
  141. strSql.Append("where F_CustomerId=@F_CustomerId ");
  142. int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), new SqlParameter[] {
  143. new SqlParameter("@F_CustomerId",model.F_CustomerId ),
  144. new SqlParameter("@F_StrExpand1",model.F_StrExpand1) ,
  145. new SqlParameter("@F_StrExpand2",model.F_StrExpand2) ,
  146. new SqlParameter("@F_StrExpand3",model.F_StrExpand3) ,
  147. new SqlParameter("@F_StrExpand4",model.F_StrExpand4) ,
  148. new SqlParameter("@F_StrExpand5",model.F_StrExpand5) ,
  149. new SqlParameter("@F_StrExpand6",model.F_StrExpand6) ,
  150. new SqlParameter("@F_StrExpand7",model.F_StrExpand7) ,
  151. new SqlParameter("@F_StrExpand8",model.F_StrExpand8) ,
  152. new SqlParameter("@F_StrExpand9",model.F_StrExpand9) ,
  153. new SqlParameter("@F_StrExpand10",model.F_StrExpand10),
  154. new SqlParameter("@F_StrExpand11",model.F_StrExpand11),
  155. new SqlParameter("@F_StrExpand12",model.F_StrExpand12),
  156. new SqlParameter("@F_StrExpand13",model.F_StrExpand13),
  157. new SqlParameter("@F_StrExpand14",model.F_StrExpand14),
  158. new SqlParameter("@F_StrExpand15",model.F_StrExpand15),
  159. new SqlParameter("@F_StrExpand16",model.F_StrExpand16),
  160. new SqlParameter("@F_StrExpand17",model.F_StrExpand17),
  161. new SqlParameter("@F_StrExpand18",model.F_StrExpand18),
  162. new SqlParameter("@F_StrExpand19",model.F_StrExpand19),
  163. new SqlParameter("@F_StrExpand20",model.F_StrExpand20),
  164. new SqlParameter("@F_StrExpand21",model.F_StrExpand21),
  165. new SqlParameter("@F_StrExpand22",model.F_StrExpand22),
  166. new SqlParameter("@F_StrExpand23",model.F_StrExpand23),
  167. new SqlParameter("@F_StrExpand24",model.F_StrExpand24),
  168. new SqlParameter("@F_StrExpand25",model.F_StrExpand25),
  169. new SqlParameter("@F_StrExpand26",model.F_StrExpand26),
  170. new SqlParameter("@F_StrExpand27",model.F_StrExpand27),
  171. new SqlParameter("@F_StrExpand28",model.F_StrExpand28),
  172. new SqlParameter("@F_StrExpand29",model.F_StrExpand29),
  173. new SqlParameter("@F_StrExpand30",model.F_StrExpand30),
  174. new SqlParameter("@F_StrExpand31",model.F_StrExpand31),
  175. new SqlParameter("@F_StrExpand32",model.F_StrExpand32),
  176. new SqlParameter("@F_StrExpand33",model.F_StrExpand33),
  177. new SqlParameter("@F_StrExpand34",model.F_StrExpand34),
  178. new SqlParameter("@F_StrExpand35",model.F_StrExpand35),
  179. new SqlParameter("@F_StrExpand36",model.F_StrExpand36),
  180. new SqlParameter("@F_StrExpand37",model.F_StrExpand37),
  181. new SqlParameter("@F_StrExpand38",model.F_StrExpand38),
  182. new SqlParameter("@F_StrExpand39",model.F_StrExpand39),
  183. new SqlParameter("@F_StrExpand40",model.F_StrExpand40)
  184. });
  185. if (rows > 0)
  186. {
  187. return true;
  188. }
  189. else
  190. {
  191. return false;
  192. }
  193. }
  194. /// <summary>
  195. /// 删除一条数据
  196. /// </summary>
  197. public bool Delete(Guid F_ExpandId)
  198. {
  199. StringBuilder strSql = new StringBuilder();
  200. strSql.Append("delete from T_Cus_CustomerExpand ");
  201. strSql.Append(" where F_ExpandId=@F_ExpandId ");
  202. SqlParameter[] parameters = {
  203. new SqlParameter("@F_ExpandId", SqlDbType.UniqueIdentifier,16) };
  204. parameters[0].Value = F_ExpandId;
  205. int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
  206. if (rows > 0)
  207. {
  208. return true;
  209. }
  210. else
  211. {
  212. return false;
  213. }
  214. }
  215. /// <summary>
  216. /// 批量删除数据
  217. /// </summary>
  218. public bool DeleteList(string F_ExpandIdlist)
  219. {
  220. StringBuilder strSql = new StringBuilder();
  221. strSql.Append("delete from T_Cus_CustomerExpand ");
  222. strSql.Append(" where F_ExpandId in (" + F_ExpandIdlist + ") ");
  223. int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
  224. if (rows > 0)
  225. {
  226. return true;
  227. }
  228. else
  229. {
  230. return false;
  231. }
  232. }
  233. /// <summary>
  234. /// 得到一个对象实体
  235. /// </summary>
  236. public CallCenterApi.Model.T_Cus_CustomerExpand GetModel(Guid F_ExpandId)
  237. {
  238. StringBuilder strSql = new StringBuilder();
  239. strSql.Append("select top 1 F_ExpandId,F_CustomerId,F_StrExpand1,F_StrExpand2,F_StrExpand3,F_StrExpand4,F_StrExpand5,F_StrExpand6,F_StrExpand7,F_StrExpand8,F_StrExpand9,F_StrExpand10,F_StrExpand11,F_StrExpand12,F_StrExpand13,F_StrExpand14,F_StrExpand15,F_StrExpand16,F_StrExpand17,F_StrExpand18,F_StrExpand19,F_StrExpand20,F_StrExpand21,F_StrExpand22,F_StrExpand23,F_StrExpand24,F_StrExpand25,F_StrExpand26,F_StrExpand27,F_StrExpand28,F_StrExpand29,F_StrExpand30,F_StrExpand31,F_StrExpand32,F_StrExpand33,F_StrExpand34,F_StrExpand35,F_StrExpand36,F_StrExpand37,F_StrExpand38,F_StrExpand39,F_StrExpand40 from T_Cus_CustomerExpand ");
  240. strSql.Append(" where F_ExpandId=@F_ExpandId ");
  241. SqlParameter[] parameters = {
  242. new SqlParameter("@F_ExpandId", SqlDbType.UniqueIdentifier,16) };
  243. parameters[0].Value = F_ExpandId;
  244. CallCenterApi.Model.T_Cus_CustomerExpand model = new CallCenterApi.Model.T_Cus_CustomerExpand();
  245. DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
  246. if (ds.Tables[0].Rows.Count > 0)
  247. {
  248. return DataRowToModel(ds.Tables[0].Rows[0]);
  249. }
  250. else
  251. {
  252. return null;
  253. }
  254. }
  255. /// <summary>
  256. /// 得到一个对象实体
  257. /// </summary>
  258. public CallCenterApi.Model.T_Cus_CustomerExpand GetModelByCustomerId(string customerId)
  259. {
  260. StringBuilder strSql = new StringBuilder();
  261. strSql.Append("select top 1 F_ExpandId,F_CustomerId,F_StrExpand1,F_StrExpand2,F_StrExpand3,F_StrExpand4,F_StrExpand5,F_StrExpand6,F_StrExpand7,F_StrExpand8,F_StrExpand9,F_StrExpand10,F_StrExpand11,F_StrExpand12,F_StrExpand13,F_StrExpand14,F_StrExpand15,F_StrExpand16,F_StrExpand17,F_StrExpand18,F_StrExpand19,F_StrExpand20,F_StrExpand21,F_StrExpand22,F_StrExpand23,F_StrExpand24,F_StrExpand25,F_StrExpand26,F_StrExpand27,F_StrExpand28,F_StrExpand29,F_StrExpand30,F_StrExpand31,F_StrExpand32,F_StrExpand33,F_StrExpand34,F_StrExpand35,F_StrExpand36,F_StrExpand37,F_StrExpand38,F_StrExpand39,F_StrExpand40 from T_Cus_CustomerExpand ");
  262. strSql.Append(" where F_CustomerId=@F_CustomerId ");
  263. SqlParameter[] parameters = {
  264. new SqlParameter("@F_CustomerId",customerId) };
  265. CallCenterApi.Model.T_Cus_CustomerExpand model = new CallCenterApi.Model.T_Cus_CustomerExpand();
  266. DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
  267. if (ds.Tables[0].Rows.Count > 0)
  268. {
  269. return DataRowToModel(ds.Tables[0].Rows[0]);
  270. }
  271. else
  272. {
  273. return null;
  274. }
  275. }
  276. /// <summary>
  277. /// 得到一个对象实体
  278. /// </summary>
  279. public CallCenterApi.Model.T_Cus_CustomerExpand DataRowToModel(DataRow row)
  280. {
  281. CallCenterApi.Model.T_Cus_CustomerExpand model = new CallCenterApi.Model.T_Cus_CustomerExpand();
  282. var columns = row.Table.Columns;
  283. if (row != null)
  284. {
  285. model.F_ExpandId = row["F_ExpandId"] == DBNull.Value ? "" : row["F_ExpandId"].ToString();
  286. model.F_CustomerId = row["F_CustomerId"] == DBNull.Value ? "" : row["F_CustomerId"].ToString();
  287. if (columns.Contains("F_StrExpand1")) { model.F_StrExpand1 = row["F_StrExpand1"] == DBNull.Value ? "" : row["F_StrExpand1"].ToString(); }
  288. if (columns.Contains("F_StrExpand2")) { model.F_StrExpand2 = row["F_StrExpand2"] == DBNull.Value ? "" : row["F_StrExpand2"].ToString(); }
  289. if (columns.Contains("F_StrExpand3")) { model.F_StrExpand3 = row["F_StrExpand3"] == DBNull.Value ? "" : row["F_StrExpand3"].ToString(); }
  290. if (columns.Contains("F_StrExpand4")) { model.F_StrExpand4 = row["F_StrExpand4"] == DBNull.Value ? "" : row["F_StrExpand4"].ToString(); }
  291. if (columns.Contains("F_StrExpand5")) { model.F_StrExpand5 = row["F_StrExpand5"] == DBNull.Value ? "" : row["F_StrExpand5"].ToString(); }
  292. if (columns.Contains("F_StrExpand6")) { model.F_StrExpand6 = row["F_StrExpand6"] == DBNull.Value ? "" : row["F_StrExpand6"].ToString(); }
  293. if (columns.Contains("F_StrExpand7")) { model.F_StrExpand7 = row["F_StrExpand7"] == DBNull.Value ? "" : row["F_StrExpand7"].ToString(); }
  294. if (columns.Contains("F_StrExpand8")) { model.F_StrExpand8 = row["F_StrExpand8"] == DBNull.Value ? "" : row["F_StrExpand8"].ToString(); }
  295. if (columns.Contains("F_StrExpand9")) { model.F_StrExpand9 = row["F_StrExpand9"] == DBNull.Value ? "" : row["F_StrExpand9"].ToString(); }
  296. if (columns.Contains("F_StrExpand10")) { model.F_StrExpand10 = row["F_StrExpand10"] == DBNull.Value ? "" : row["F_StrExpand10"].ToString(); }
  297. if (columns.Contains("F_StrExpand11")) { model.F_StrExpand11 = row["F_StrExpand11"] == DBNull.Value ? "" : row["F_StrExpand11"].ToString(); }
  298. if (columns.Contains("F_StrExpand12")) { model.F_StrExpand12 = row["F_StrExpand12"] == DBNull.Value ? "" : row["F_StrExpand12"].ToString(); }
  299. if (columns.Contains("F_StrExpand13")) { model.F_StrExpand13 = row["F_StrExpand13"] == DBNull.Value ? "" : row["F_StrExpand13"].ToString(); }
  300. if (columns.Contains("F_StrExpand14")) { model.F_StrExpand14 = row["F_StrExpand14"] == DBNull.Value ? "" : row["F_StrExpand14"].ToString(); }
  301. if (columns.Contains("F_StrExpand15")) { model.F_StrExpand15 = row["F_StrExpand15"] == DBNull.Value ? "" : row["F_StrExpand15"].ToString(); }
  302. if (columns.Contains("F_StrExpand16")) { model.F_StrExpand16 = row["F_StrExpand16"] == DBNull.Value ? "" : row["F_StrExpand16"].ToString(); }
  303. if (columns.Contains("F_StrExpand17")) { model.F_StrExpand17 = row["F_StrExpand17"] == DBNull.Value ? "" : row["F_StrExpand17"].ToString(); }
  304. if (columns.Contains("F_StrExpand18")) { model.F_StrExpand18 = row["F_StrExpand18"] == DBNull.Value ? "" : row["F_StrExpand18"].ToString(); }
  305. if (columns.Contains("F_StrExpand19")) { model.F_StrExpand19 = row["F_StrExpand19"] == DBNull.Value ? "" : row["F_StrExpand19"].ToString(); }
  306. if (columns.Contains("F_StrExpand20")) { model.F_StrExpand20 = row["F_StrExpand20"] == DBNull.Value ? "" : row["F_StrExpand20"].ToString(); }
  307. if (columns.Contains("F_StrExpand21")) { model.F_StrExpand21 = row["F_StrExpand21"] == DBNull.Value ? "" : row["F_StrExpand21"].ToString(); }
  308. if (columns.Contains("F_StrExpand22")) { model.F_StrExpand22 = row["F_StrExpand22"] == DBNull.Value ? "" : row["F_StrExpand22"].ToString(); }
  309. if (columns.Contains("F_StrExpand23")) { model.F_StrExpand23 = row["F_StrExpand23"] == DBNull.Value ? "" : row["F_StrExpand23"].ToString(); }
  310. if (columns.Contains("F_StrExpand24")) { model.F_StrExpand24 = row["F_StrExpand24"] == DBNull.Value ? "" : row["F_StrExpand24"].ToString(); }
  311. if (columns.Contains("F_StrExpand25")) { model.F_StrExpand25 = row["F_StrExpand25"] == DBNull.Value ? "" : row["F_StrExpand25"].ToString(); }
  312. if (columns.Contains("F_StrExpand26")) { model.F_StrExpand26 = row["F_StrExpand26"] == DBNull.Value ? "" : row["F_StrExpand26"].ToString(); }
  313. if (columns.Contains("F_StrExpand27")) { model.F_StrExpand27 = row["F_StrExpand27"] == DBNull.Value ? "" : row["F_StrExpand27"].ToString(); }
  314. if (columns.Contains("F_StrExpand28")) { model.F_StrExpand28 = row["F_StrExpand28"] == DBNull.Value ? "" : row["F_StrExpand28"].ToString(); }
  315. if (columns.Contains("F_StrExpand29")) { model.F_StrExpand29 = row["F_StrExpand29"] == DBNull.Value ? "" : row["F_StrExpand29"].ToString(); }
  316. if (columns.Contains("F_StrExpand30")) { model.F_StrExpand30 = row["F_StrExpand30"] == DBNull.Value ? "" : row["F_StrExpand30"].ToString(); }
  317. if (columns.Contains("F_StrExpand31")) { model.F_StrExpand31 = row["F_StrExpand31"] == DBNull.Value ? "" : row["F_StrExpand31"].ToString(); }
  318. if (columns.Contains("F_StrExpand32")) { model.F_StrExpand32 = row["F_StrExpand32"] == DBNull.Value ? "" : row["F_StrExpand32"].ToString(); }
  319. if (columns.Contains("F_StrExpand33")) { model.F_StrExpand33 = row["F_StrExpand33"] == DBNull.Value ? "" : row["F_StrExpand33"].ToString(); }
  320. if (columns.Contains("F_StrExpand34")) { model.F_StrExpand34 = row["F_StrExpand34"] == DBNull.Value ? "" : row["F_StrExpand34"].ToString(); }
  321. if (columns.Contains("F_StrExpand35")) { model.F_StrExpand35 = row["F_StrExpand35"] == DBNull.Value ? "" : row["F_StrExpand35"].ToString(); }
  322. if (columns.Contains("F_StrExpand36")) { model.F_StrExpand36 = row["F_StrExpand36"] == DBNull.Value ? "" : row["F_StrExpand36"].ToString(); }
  323. if (columns.Contains("F_StrExpand37")) { model.F_StrExpand37 = row["F_StrExpand37"] == DBNull.Value ? "" : row["F_StrExpand37"].ToString(); }
  324. if (columns.Contains("F_StrExpand38")) { model.F_StrExpand38 = row["F_StrExpand38"] == DBNull.Value ? "" : row["F_StrExpand38"].ToString(); }
  325. if (columns.Contains("F_StrExpand39")) { model.F_StrExpand39 = row["F_StrExpand39"] == DBNull.Value ? "" : row["F_StrExpand39"].ToString(); }
  326. if (columns.Contains("F_StrExpand40")) { model.F_StrExpand40 = row["F_StrExpand40"] == DBNull.Value ? "" : row["F_StrExpand40"].ToString(); }
  327. }
  328. return model;
  329. }
  330. /// <summary>
  331. /// 获得数据列表
  332. /// </summary>
  333. public DataSet GetList(string strWhere)
  334. {
  335. StringBuilder strSql = new StringBuilder();
  336. strSql.Append("select F_ExpandId,F_CustomerId,F_StrExpand1,F_StrExpand2,F_StrExpand3,F_StrExpand4,F_StrExpand5,F_StrExpand6,F_TypeExpand1,F_TypeExpand2,F_IntExpand1,F_IntExpand2,F_TimeExpand1,F_TimeExpand2,F_TextExpand1,F_TextExpand2 ");
  337. strSql.Append(" FROM T_Cus_CustomerExpand ");
  338. if (strWhere.Trim() != "")
  339. {
  340. strSql.Append(" where " + strWhere);
  341. }
  342. return DbHelperSQL.Query(strSql.ToString());
  343. }
  344. /// <summary>
  345. /// 获得前几行数据
  346. /// </summary>
  347. public DataSet GetList(int Top, string strWhere, string filedOrder)
  348. {
  349. StringBuilder strSql = new StringBuilder();
  350. strSql.Append("select ");
  351. if (Top > 0)
  352. {
  353. strSql.Append(" top " + Top.ToString());
  354. }
  355. strSql.Append(" F_ExpandId,F_CustomerId,F_StrExpand1,F_StrExpand2,F_StrExpand3,F_StrExpand4,F_StrExpand5,F_StrExpand6,F_TypeExpand1,F_TypeExpand2,F_IntExpand1,F_IntExpand2,F_TimeExpand1,F_TimeExpand2,F_TextExpand1,F_TextExpand2 ");
  356. strSql.Append(" FROM T_Cus_CustomerExpand ");
  357. if (strWhere.Trim() != "")
  358. {
  359. strSql.Append(" where " + strWhere);
  360. }
  361. strSql.Append(" order by " + filedOrder);
  362. return DbHelperSQL.Query(strSql.ToString());
  363. }
  364. /// <summary>
  365. /// 获取记录总数
  366. /// </summary>
  367. public int GetRecordCount(string strWhere)
  368. {
  369. StringBuilder strSql = new StringBuilder();
  370. strSql.Append("select count(1) FROM T_Cus_CustomerExpand ");
  371. if (strWhere.Trim() != "")
  372. {
  373. strSql.Append(" where " + strWhere);
  374. }
  375. object obj = DbHelperSQL.GetSingle(strSql.ToString());
  376. if (obj == null)
  377. {
  378. return 0;
  379. }
  380. else
  381. {
  382. return Convert.ToInt32(obj);
  383. }
  384. }
  385. /// <summary>
  386. /// 分页获取数据列表
  387. /// </summary>
  388. public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
  389. {
  390. StringBuilder strSql = new StringBuilder();
  391. strSql.Append("SELECT * FROM ( ");
  392. strSql.Append(" SELECT ROW_NUMBER() OVER (");
  393. if (!string.IsNullOrEmpty(orderby.Trim()))
  394. {
  395. strSql.Append("order by T." + orderby);
  396. }
  397. else
  398. {
  399. strSql.Append("order by T.F_ExpandId desc");
  400. }
  401. strSql.Append(")AS Row, T.* from T_Cus_CustomerExpand T ");
  402. if (!string.IsNullOrEmpty(strWhere.Trim()))
  403. {
  404. strSql.Append(" WHERE " + strWhere);
  405. }
  406. strSql.Append(" ) TT");
  407. strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
  408. return DbHelperSQL.Query(strSql.ToString());
  409. }
  410. /*
  411. /// <summary>
  412. /// 分页获取数据列表
  413. /// </summary>
  414. public DataSet GetList(int PageSize,int PageIndex,string strWhere)
  415. {
  416. SqlParameter[] parameters = {
  417. new SqlParameter("@tblName", SqlDbType.VarChar, 255),
  418. new SqlParameter("@fldName", SqlDbType.VarChar, 255),
  419. new SqlParameter("@PageSize", SqlDbType.Int),
  420. new SqlParameter("@PageIndex", SqlDbType.Int),
  421. new SqlParameter("@IsReCount", SqlDbType.Bit),
  422. new SqlParameter("@OrderType", SqlDbType.Bit),
  423. new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
  424. };
  425. parameters[0].Value = "T_Cus_CustomerExpand";
  426. parameters[1].Value = "F_ExpandId";
  427. parameters[2].Value = PageSize;
  428. parameters[3].Value = PageIndex;
  429. parameters[4].Value = 0;
  430. parameters[5].Value = 0;
  431. parameters[6].Value = strWhere;
  432. return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
  433. }*/
  434. #endregion BasicMethod
  435. #region ExtensionMethod
  436. #endregion ExtensionMethod
  437. // public T_Cus_CustomerExpand()
  438. // { }
  439. // #region BasicMethod
  440. // /// <summary>
  441. // /// 是否存在该记录
  442. // /// </summary>
  443. // public bool Exists(Guid F_ExpandId)
  444. // {
  445. // StringBuilder strSql = new StringBuilder();
  446. // strSql.Append("select count(1) from T_Cus_CustomerExpand");
  447. // strSql.Append(" where F_ExpandId=@F_ExpandId ");
  448. // SqlParameter[] parameters = {
  449. // new SqlParameter("@F_ExpandId", SqlDbType.UniqueIdentifier,16) };
  450. // parameters[0].Value = F_ExpandId;
  451. // return DbHelperSQL.Exists(strSql.ToString(), parameters);
  452. // }
  453. // /// <summary>
  454. // /// 增加一条数据
  455. // /// </summary>
  456. // public bool Add(CallCenterApi.Model.T_Cus_CustomerExpand model)
  457. // {
  458. // StringBuilder strSql = new StringBuilder();
  459. // strSql.Append("insert into T_Cus_CustomerExpand(");
  460. // strSql.Append("F_ExpandId,F_CustomerId,F_StrExpand1,F_StrExpand2,F_StrExpand3,F_StrExpand4,F_StrExpand5,F_StrExpand6,F_TypeExpand1,F_TypeExpand2,F_IntExpand1,F_IntExpand2,F_TimeExpand1,F_TimeExpand2,F_TextExpand1,F_TextExpand2)");
  461. // strSql.Append(" values (");
  462. // strSql.Append("@F_ExpandId,@F_CustomerId,@F_StrExpand1,@F_StrExpand2,@F_StrExpand3,@F_StrExpand4,@F_StrExpand5,@F_StrExpand6,@F_TypeExpand1,@F_TypeExpand2,@F_IntExpand1,@F_IntExpand2,@F_TimeExpand1,@F_TimeExpand2,@F_TextExpand1,@F_TextExpand2)");
  463. // SqlParameter[] parameters = {
  464. // new SqlParameter("@F_ExpandId", SqlDbType.UniqueIdentifier,16),
  465. // new SqlParameter("@F_CustomerId", SqlDbType.UniqueIdentifier,16),
  466. // new SqlParameter("@F_StrExpand1", SqlDbType.NVarChar,200),
  467. // new SqlParameter("@F_StrExpand2", SqlDbType.NVarChar,200),
  468. // new SqlParameter("@F_StrExpand3", SqlDbType.NVarChar,200),
  469. // new SqlParameter("@F_StrExpand4", SqlDbType.NVarChar,200),
  470. // new SqlParameter("@F_StrExpand5", SqlDbType.NVarChar,200),
  471. // new SqlParameter("@F_StrExpand6", SqlDbType.NVarChar,200),
  472. // new SqlParameter("@F_TypeExpand1", SqlDbType.NVarChar,50),
  473. // new SqlParameter("@F_TypeExpand2", SqlDbType.NVarChar,50),
  474. // new SqlParameter("@F_IntExpand1", SqlDbType.Int,4),
  475. // new SqlParameter("@F_IntExpand2", SqlDbType.Int,4),
  476. // new SqlParameter("@F_TimeExpand1", SqlDbType.DateTime),
  477. // new SqlParameter("@F_TimeExpand2", SqlDbType.DateTime),
  478. // new SqlParameter("@F_TextExpand1", SqlDbType.Text),
  479. // new SqlParameter("@F_TextExpand2", SqlDbType.Text)};
  480. // parameters[0].Value = Guid.NewGuid();
  481. // parameters[1].Value = Guid.NewGuid();
  482. // parameters[2].Value = model.F_StrExpand1;
  483. // parameters[3].Value = model.F_StrExpand2;
  484. // parameters[4].Value = model.F_StrExpand3;
  485. // parameters[5].Value = model.F_StrExpand4;
  486. // parameters[6].Value = model.F_StrExpand5;
  487. // parameters[7].Value = model.F_StrExpand6;
  488. // parameters[8].Value = model.F_TypeExpand1;
  489. // parameters[9].Value = model.F_TypeExpand2;
  490. // parameters[10].Value = model.F_IntExpand1;
  491. // parameters[11].Value = model.F_IntExpand2;
  492. // parameters[12].Value = model.F_TimeExpand1;
  493. // parameters[13].Value = model.F_TimeExpand2;
  494. // parameters[14].Value = model.F_TextExpand1;
  495. // parameters[15].Value = model.F_TextExpand2;
  496. // int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
  497. // if (rows > 0)
  498. // {
  499. // return true;
  500. // }
  501. // else
  502. // {
  503. // return false;
  504. // }
  505. // }
  506. // /// <summary>
  507. // /// 更新一条数据
  508. // /// </summary>
  509. // public bool Update(CallCenterApi.Model.T_Cus_CustomerExpand model)
  510. // {
  511. // StringBuilder strSql = new StringBuilder();
  512. // strSql.Append("update T_Cus_CustomerExpand set ");
  513. // strSql.Append("F_CustomerId=@F_CustomerId,");
  514. // strSql.Append("F_StrExpand1=@F_StrExpand1,");
  515. // strSql.Append("F_StrExpand2=@F_StrExpand2,");
  516. // strSql.Append("F_StrExpand3=@F_StrExpand3,");
  517. // strSql.Append("F_StrExpand4=@F_StrExpand4,");
  518. // strSql.Append("F_StrExpand5=@F_StrExpand5,");
  519. // strSql.Append("F_StrExpand6=@F_StrExpand6,");
  520. // strSql.Append("F_TypeExpand1=@F_TypeExpand1,");
  521. // strSql.Append("F_TypeExpand2=@F_TypeExpand2,");
  522. // strSql.Append("F_IntExpand1=@F_IntExpand1,");
  523. // strSql.Append("F_IntExpand2=@F_IntExpand2,");
  524. // strSql.Append("F_TimeExpand1=@F_TimeExpand1,");
  525. // strSql.Append("F_TimeExpand2=@F_TimeExpand2,");
  526. // strSql.Append("F_TextExpand1=@F_TextExpand1,");
  527. // strSql.Append("F_TextExpand2=@F_TextExpand2");
  528. // strSql.Append(" where F_ExpandId=@F_ExpandId ");
  529. // SqlParameter[] parameters = {
  530. // new SqlParameter("@F_CustomerId", SqlDbType.UniqueIdentifier,16),
  531. // new SqlParameter("@F_StrExpand1", SqlDbType.NVarChar,200),
  532. // new SqlParameter("@F_StrExpand2", SqlDbType.NVarChar,200),
  533. // new SqlParameter("@F_StrExpand3", SqlDbType.NVarChar,200),
  534. // new SqlParameter("@F_StrExpand4", SqlDbType.NVarChar,200),
  535. // new SqlParameter("@F_StrExpand5", SqlDbType.NVarChar,200),
  536. // new SqlParameter("@F_StrExpand6", SqlDbType.NVarChar,200),
  537. // new SqlParameter("@F_TypeExpand1", SqlDbType.NVarChar,50),
  538. // new SqlParameter("@F_TypeExpand2", SqlDbType.NVarChar,50),
  539. // new SqlParameter("@F_IntExpand1", SqlDbType.Int,4),
  540. // new SqlParameter("@F_IntExpand2", SqlDbType.Int,4),
  541. // new SqlParameter("@F_TimeExpand1", SqlDbType.DateTime),
  542. // new SqlParameter("@F_TimeExpand2", SqlDbType.DateTime),
  543. // new SqlParameter("@F_TextExpand1", SqlDbType.Text),
  544. // new SqlParameter("@F_TextExpand2", SqlDbType.Text),
  545. // new SqlParameter("@F_ExpandId", SqlDbType.UniqueIdentifier,16)};
  546. // parameters[0].Value = model.F_CustomerId;
  547. // parameters[1].Value = model.F_StrExpand1;
  548. // parameters[2].Value = model.F_StrExpand2;
  549. // parameters[3].Value = model.F_StrExpand3;
  550. // parameters[4].Value = model.F_StrExpand4;
  551. // parameters[5].Value = model.F_StrExpand5;
  552. // parameters[6].Value = model.F_StrExpand6;
  553. // parameters[7].Value = model.F_TypeExpand1;
  554. // parameters[8].Value = model.F_TypeExpand2;
  555. // parameters[9].Value = model.F_IntExpand1;
  556. // parameters[10].Value = model.F_IntExpand2;
  557. // parameters[11].Value = model.F_TimeExpand1;
  558. // parameters[12].Value = model.F_TimeExpand2;
  559. // parameters[13].Value = model.F_TextExpand1;
  560. // parameters[14].Value = model.F_TextExpand2;
  561. // parameters[15].Value = model.F_ExpandId;
  562. // int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
  563. // if (rows > 0)
  564. // {
  565. // return true;
  566. // }
  567. // else
  568. // {
  569. // return false;
  570. // }
  571. // }
  572. // /// <summary>
  573. // /// 删除一条数据
  574. // /// </summary>
  575. // public bool Delete(Guid F_ExpandId)
  576. // {
  577. // StringBuilder strSql = new StringBuilder();
  578. // strSql.Append("delete from T_Cus_CustomerExpand ");
  579. // strSql.Append(" where F_ExpandId=@F_ExpandId ");
  580. // SqlParameter[] parameters = {
  581. // new SqlParameter("@F_ExpandId", SqlDbType.UniqueIdentifier,16) };
  582. // parameters[0].Value = F_ExpandId;
  583. // int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
  584. // if (rows > 0)
  585. // {
  586. // return true;
  587. // }
  588. // else
  589. // {
  590. // return false;
  591. // }
  592. // }
  593. // /// <summary>
  594. // /// 批量删除数据
  595. // /// </summary>
  596. // public bool DeleteList(string F_ExpandIdlist)
  597. // {
  598. // StringBuilder strSql = new StringBuilder();
  599. // strSql.Append("delete from T_Cus_CustomerExpand ");
  600. // strSql.Append(" where F_ExpandId in (" + F_ExpandIdlist + ") ");
  601. // int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
  602. // if (rows > 0)
  603. // {
  604. // return true;
  605. // }
  606. // else
  607. // {
  608. // return false;
  609. // }
  610. // }
  611. // /// <summary>
  612. // /// 得到一个对象实体
  613. // /// </summary>
  614. // public CallCenterApi.Model.T_Cus_CustomerExpand GetModel(Guid F_ExpandId)
  615. // {
  616. // StringBuilder strSql = new StringBuilder();
  617. // strSql.Append("select top 1 F_ExpandId,F_CustomerId,F_StrExpand1,F_StrExpand2,F_StrExpand3,F_StrExpand4,F_StrExpand5,F_StrExpand6,F_TypeExpand1,F_TypeExpand2,F_IntExpand1,F_IntExpand2,F_TimeExpand1,F_TimeExpand2,F_TextExpand1,F_TextExpand2 from T_Cus_CustomerExpand ");
  618. // strSql.Append(" where F_ExpandId=@F_ExpandId ");
  619. // SqlParameter[] parameters = {
  620. // new SqlParameter("@F_ExpandId", SqlDbType.UniqueIdentifier,16) };
  621. // parameters[0].Value = F_ExpandId;
  622. // CallCenterApi.Model.T_Cus_CustomerExpand model = new CallCenterApi.Model.T_Cus_CustomerExpand();
  623. // DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
  624. // if (ds.Tables[0].Rows.Count > 0)
  625. // {
  626. // return DataRowToModel(ds.Tables[0].Rows[0]);
  627. // }
  628. // else
  629. // {
  630. // return null;
  631. // }
  632. // }
  633. // /// <summary>
  634. // /// 得到一个对象实体
  635. // /// </summary>
  636. // public CallCenterApi.Model.T_Cus_CustomerExpand DataRowToModel(DataRow row)
  637. // {
  638. // CallCenterApi.Model.T_Cus_CustomerExpand model = new CallCenterApi.Model.T_Cus_CustomerExpand();
  639. // if (row != null)
  640. // {
  641. // if (row["F_ExpandId"] != null && row["F_ExpandId"].ToString() != "")
  642. // {
  643. // model.F_ExpandId = new Guid(row["F_ExpandId"].ToString());
  644. // }
  645. // if (row["F_CustomerId"] != null && row["F_CustomerId"].ToString() != "")
  646. // {
  647. // model.F_CustomerId = new Guid(row["F_CustomerId"].ToString());
  648. // }
  649. // if (row["F_StrExpand1"] != null)
  650. // {
  651. // model.F_StrExpand1 = row["F_StrExpand1"].ToString();
  652. // }
  653. // if (row["F_StrExpand2"] != null)
  654. // {
  655. // model.F_StrExpand2 = row["F_StrExpand2"].ToString();
  656. // }
  657. // if (row["F_StrExpand3"] != null)
  658. // {
  659. // model.F_StrExpand3 = row["F_StrExpand3"].ToString();
  660. // }
  661. // if (row["F_StrExpand4"] != null)
  662. // {
  663. // model.F_StrExpand4 = row["F_StrExpand4"].ToString();
  664. // }
  665. // if (row["F_StrExpand5"] != null)
  666. // {
  667. // model.F_StrExpand5 = row["F_StrExpand5"].ToString();
  668. // }
  669. // if (row["F_StrExpand6"] != null)
  670. // {
  671. // model.F_StrExpand6 = row["F_StrExpand6"].ToString();
  672. // }
  673. // if (row["F_TypeExpand1"] != null)
  674. // {
  675. // model.F_TypeExpand1 = row["F_TypeExpand1"].ToString();
  676. // }
  677. // if (row["F_TypeExpand2"] != null)
  678. // {
  679. // model.F_TypeExpand2 = row["F_TypeExpand2"].ToString();
  680. // }
  681. // if (row["F_IntExpand1"] != null && row["F_IntExpand1"].ToString() != "")
  682. // {
  683. // model.F_IntExpand1 = int.Parse(row["F_IntExpand1"].ToString());
  684. // }
  685. // if (row["F_IntExpand2"] != null && row["F_IntExpand2"].ToString() != "")
  686. // {
  687. // model.F_IntExpand2 = int.Parse(row["F_IntExpand2"].ToString());
  688. // }
  689. // if (row["F_TimeExpand1"] != null && row["F_TimeExpand1"].ToString() != "")
  690. // {
  691. // model.F_TimeExpand1 = DateTime.Parse(row["F_TimeExpand1"].ToString());
  692. // }
  693. // if (row["F_TimeExpand2"] != null && row["F_TimeExpand2"].ToString() != "")
  694. // {
  695. // model.F_TimeExpand2 = DateTime.Parse(row["F_TimeExpand2"].ToString());
  696. // }
  697. // if (row["F_TextExpand1"] != null)
  698. // {
  699. // model.F_TextExpand1 = row["F_TextExpand1"].ToString();
  700. // }
  701. // if (row["F_TextExpand2"] != null)
  702. // {
  703. // model.F_TextExpand2 = row["F_TextExpand2"].ToString();
  704. // }
  705. // }
  706. // return model;
  707. // }
  708. // /// <summary>
  709. // /// 获得数据列表
  710. // /// </summary>
  711. // public DataSet GetList(string strWhere)
  712. // {
  713. // StringBuilder strSql = new StringBuilder();
  714. // strSql.Append("select F_ExpandId,F_CustomerId,F_StrExpand1,F_StrExpand2,F_StrExpand3,F_StrExpand4,F_StrExpand5,F_StrExpand6,F_TypeExpand1,F_TypeExpand2,F_IntExpand1,F_IntExpand2,F_TimeExpand1,F_TimeExpand2,F_TextExpand1,F_TextExpand2 ");
  715. // strSql.Append(" FROM T_Cus_CustomerExpand ");
  716. // if (strWhere.Trim() != "")
  717. // {
  718. // strSql.Append(" where " + strWhere);
  719. // }
  720. // return DbHelperSQL.Query(strSql.ToString());
  721. // }
  722. // /// <summary>
  723. // /// 获得前几行数据
  724. // /// </summary>
  725. // public DataSet GetList(int Top, string strWhere, string filedOrder)
  726. // {
  727. // StringBuilder strSql = new StringBuilder();
  728. // strSql.Append("select ");
  729. // if (Top > 0)
  730. // {
  731. // strSql.Append(" top " + Top.ToString());
  732. // }
  733. // strSql.Append(" F_ExpandId,F_CustomerId,F_StrExpand1,F_StrExpand2,F_StrExpand3,F_StrExpand4,F_StrExpand5,F_StrExpand6,F_TypeExpand1,F_TypeExpand2,F_IntExpand1,F_IntExpand2,F_TimeExpand1,F_TimeExpand2,F_TextExpand1,F_TextExpand2 ");
  734. // strSql.Append(" FROM T_Cus_CustomerExpand ");
  735. // if (strWhere.Trim() != "")
  736. // {
  737. // strSql.Append(" where " + strWhere);
  738. // }
  739. // strSql.Append(" order by " + filedOrder);
  740. // return DbHelperSQL.Query(strSql.ToString());
  741. // }
  742. // /// <summary>
  743. // /// 获取记录总数
  744. // /// </summary>
  745. // public int GetRecordCount(string strWhere)
  746. // {
  747. // StringBuilder strSql = new StringBuilder();
  748. // strSql.Append("select count(1) FROM T_Cus_CustomerExpand ");
  749. // if (strWhere.Trim() != "")
  750. // {
  751. // strSql.Append(" where " + strWhere);
  752. // }
  753. // object obj = DbHelperSQL.GetSingle(strSql.ToString());
  754. // if (obj == null)
  755. // {
  756. // return 0;
  757. // }
  758. // else
  759. // {
  760. // return Convert.ToInt32(obj);
  761. // }
  762. // }
  763. // /// <summary>
  764. // /// 分页获取数据列表
  765. // /// </summary>
  766. // public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
  767. // {
  768. // StringBuilder strSql = new StringBuilder();
  769. // strSql.Append("SELECT * FROM ( ");
  770. // strSql.Append(" SELECT ROW_NUMBER() OVER (");
  771. // if (!string.IsNullOrEmpty(orderby.Trim()))
  772. // {
  773. // strSql.Append("order by T." + orderby);
  774. // }
  775. // else
  776. // {
  777. // strSql.Append("order by T.F_ExpandId desc");
  778. // }
  779. // strSql.Append(")AS Row, T.* from T_Cus_CustomerExpand T ");
  780. // if (!string.IsNullOrEmpty(strWhere.Trim()))
  781. // {
  782. // strSql.Append(" WHERE " + strWhere);
  783. // }
  784. // strSql.Append(" ) TT");
  785. // strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
  786. // return DbHelperSQL.Query(strSql.ToString());
  787. // }
  788. // /*
  789. ///// <summary>
  790. ///// 分页获取数据列表
  791. ///// </summary>
  792. //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
  793. //{
  794. // SqlParameter[] parameters = {
  795. // new SqlParameter("@tblName", SqlDbType.VarChar, 255),
  796. // new SqlParameter("@fldName", SqlDbType.VarChar, 255),
  797. // new SqlParameter("@PageSize", SqlDbType.Int),
  798. // new SqlParameter("@PageIndex", SqlDbType.Int),
  799. // new SqlParameter("@IsReCount", SqlDbType.Bit),
  800. // new SqlParameter("@OrderType", SqlDbType.Bit),
  801. // new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
  802. // };
  803. // parameters[0].Value = "T_Cus_CustomerExpand";
  804. // parameters[1].Value = "F_ExpandId";
  805. // parameters[2].Value = PageSize;
  806. // parameters[3].Value = PageIndex;
  807. // parameters[4].Value = 0;
  808. // parameters[5].Value = 0;
  809. // parameters[6].Value = strWhere;
  810. // return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
  811. //}*/
  812. // #endregion BasicMethod
  813. // #region ExtensionMethod
  814. // #endregion ExtensionMethod
  815. }
  816. }