Нет описания

T_Cus_CustomerBase.cs 70KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282
  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_CustomerBase
  13. /// </summary>
  14. public partial class T_Cus_CustomerBase
  15. {
  16. public T_Cus_CustomerBase()
  17. { }
  18. #region BasicMethod
  19. /// <summary>
  20. /// 得到最大ID
  21. /// </summary>
  22. public int GetMaxId()
  23. {
  24. return DbHelperSQL.GetMaxID("F_CustomerId", "T_Cus_CustomerBase");
  25. }
  26. /// <summary>
  27. /// 是否存在该记录
  28. /// </summary>
  29. public bool Exists(int F_CustomerId)
  30. {
  31. StringBuilder strSql = new StringBuilder();
  32. strSql.Append("select count(1) from T_Cus_CustomerBase");
  33. strSql.Append(" where F_CustomerId=@F_CustomerId");
  34. SqlParameter[] parameters = {
  35. new SqlParameter("@F_CustomerId", SqlDbType.Int,4)
  36. };
  37. parameters[0].Value = F_CustomerId;
  38. return DbHelperSQL.Exists(strSql.ToString(), parameters);
  39. }
  40. /// <summary>
  41. /// 增加一条数据
  42. /// </summary>
  43. public string Add(CallCenterApi.Model.T_Cus_CustomerBase model)
  44. {
  45. StringBuilder strSql = new StringBuilder();
  46. strSql.Append("insert into T_Cus_CustomerBase(");
  47. strSql.Append("F_Name,F_PhoneNum1,F_PhoneNum2,F_Address,F_CusType,F_AddAgentId,F_Remark,F_YHFKId,F_YHFKName,F_DeptId)");
  48. strSql.Append(" values (");
  49. strSql.Append("@F_Name,@F_PhoneNum1,@F_PhoneNum2,@F_Address,@F_CusType,@F_AddAgentId,@F_Remark,@F_YHFKId,@F_YHFKName,@F_DeptId);");
  50. strSql.Append("select F_Id from T_Cus_CustomerBase order by F_AddTime desc ");
  51. SqlParameter[] parameters = {
  52. new SqlParameter("@F_Name", model.F_Name),
  53. new SqlParameter("@F_PhoneNum1",model.F_PhoneNum1),
  54. new SqlParameter("@F_PhoneNum2", model.F_PhoneNum2),
  55. new SqlParameter("@F_Address", model.F_Address),
  56. new SqlParameter("@F_CusType", model.F_CusType),
  57. new SqlParameter("@F_AddAgentId", model.F_AddAgentId),
  58. new SqlParameter("@F_Remark", model.F_Remark),
  59. new SqlParameter("@F_YHFKId", model.F_YHFKId),
  60. new SqlParameter("@F_YHFKName",model.F_YHFKName),
  61. new SqlParameter("@F_DeptId", model.F_DeptId),
  62. };
  63. object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
  64. if (obj == null)
  65. {
  66. return null;
  67. }
  68. else
  69. {
  70. return obj.ToString();
  71. }
  72. }
  73. /// <summary>
  74. /// 更新一条数据
  75. /// </summary>
  76. public bool Update(CallCenterApi.Model.T_Cus_CustomerBase model)
  77. {
  78. StringBuilder strSql = new StringBuilder();
  79. strSql.Append("update T_Cus_CustomerBase set ");
  80. strSql.Append("F_Name=@F_Name,");
  81. strSql.Append("F_PhoneNum1=@F_PhoneNum1,");
  82. strSql.Append("F_PhoneNum2=@F_PhoneNum2,");
  83. strSql.Append("F_Address=@F_Address,");
  84. strSql.Append("F_CusType=@F_CusType,");
  85. strSql.Append("F_AddAgentId=@F_AddAgentId,");
  86. strSql.Append("F_Remark=@F_Remark,");
  87. strSql.Append("F_YHFKId=@F_YHFKId,");
  88. strSql.Append("F_YHFKName=@F_YHFKName,");
  89. strSql.Append("F_DeptId=@F_DeptId ");
  90. strSql.Append(" where F_Id=@F_Id");
  91. SqlParameter[] parameters = {
  92. new SqlParameter("@F_Id",model.F_Id),
  93. new SqlParameter("@F_Name", model.F_Name),
  94. new SqlParameter("@F_PhoneNum1",model.F_PhoneNum1),
  95. new SqlParameter("@F_PhoneNum2", model.F_PhoneNum2),
  96. new SqlParameter("@F_Address", model.F_Address),
  97. new SqlParameter("@F_CusType", model.F_CusType),
  98. new SqlParameter("@F_AddAgentId", model.F_AddAgentId),
  99. new SqlParameter("@F_Remark", model.F_Remark),
  100. new SqlParameter("@F_YHFKId", model.F_YHFKId),
  101. new SqlParameter("@F_YHFKName",model.F_YHFKName),
  102. new SqlParameter("@F_DeptId", model.F_DeptId),
  103. };
  104. int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
  105. if (rows > 0)
  106. {
  107. return true;
  108. }
  109. else
  110. {
  111. return false;
  112. }
  113. }
  114. /// <summary>
  115. /// 删除一条数据
  116. /// </summary>
  117. public bool Delete(int F_CustomerId)
  118. {
  119. StringBuilder strSql = new StringBuilder();
  120. //strSql.Append("delete from T_Cus_CustomerBase ");
  121. strSql.Append("update T_Cus_CustomerBase set F_DeleteFlag=1");
  122. strSql.Append(" where F_CustomerId=@F_CustomerId");
  123. SqlParameter[] parameters = {
  124. new SqlParameter("@F_CustomerId", SqlDbType.Int,4)
  125. };
  126. parameters[0].Value = F_CustomerId;
  127. int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
  128. if (rows > 0)
  129. {
  130. return true;
  131. }
  132. else
  133. {
  134. return false;
  135. }
  136. }
  137. /// <summary>
  138. /// 批量删除数据
  139. /// </summary>
  140. public bool DeleteList(string F_CustomerIdlist)
  141. {
  142. StringBuilder strSql = new StringBuilder();
  143. //strSql.Append("delete from T_Cus_CustomerBase ");
  144. strSql.Append("update T_Cus_CustomerBase set F_DeleteFlag=1");
  145. strSql.Append(" where F_CustomerId in (" + F_CustomerIdlist + ") ");
  146. int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
  147. if (rows > 0)
  148. {
  149. return true;
  150. }
  151. else
  152. {
  153. return false;
  154. }
  155. }
  156. /// <summary>
  157. /// 得到一个对象实体
  158. /// </summary>
  159. public CallCenterApi.Model.T_Cus_CustomerBase GetModel(string id)
  160. {
  161. StringBuilder strSql = new StringBuilder();
  162. strSql.Append("select top 1 cb.*,ua.F_UserName as AddAgentName FROM T_Cus_CustomerBase cb left join T_Sys_UserAccount ua on ua.F_UserId=cb.F_AddAgentId ");
  163. strSql.Append(" where cb.F_Id=@F_Id");
  164. SqlParameter[] parameters = {
  165. new SqlParameter("@F_Id",id)
  166. };
  167. CallCenterApi.Model.T_Cus_CustomerBase model = new CallCenterApi.Model.T_Cus_CustomerBase();
  168. DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
  169. if (ds.Tables[0].Rows.Count > 0)
  170. {
  171. return DataRowToModel(ds.Tables[0].Rows[0]);
  172. }
  173. else
  174. {
  175. return null;
  176. }
  177. }
  178. /// <summary>
  179. /// 得到一个对象实体
  180. /// </summary>
  181. public CallCenterApi.Model.T_Cus_CustomerBase GetModelByTel(string tel)
  182. {
  183. StringBuilder strSql = new StringBuilder();
  184. strSql.Append("select top 1 F_Id,F_Name,F_PhoneNum1,F_PhoneNum2,F_Address,F_CusType,F_AddAgentId,F_AddTime,F_Remark,F_YHFKId,F_YHFKName,F_DeptId,F_DeleteFlag from T_Cus_CustomerBase ");
  185. strSql.Append(" where F_PhoneNum1=@F_PhoneNum1");
  186. SqlParameter[] parameters = {
  187. new SqlParameter("@F_PhoneNum1",tel)
  188. };
  189. CallCenterApi.Model.T_Cus_CustomerBase model = new CallCenterApi.Model.T_Cus_CustomerBase();
  190. DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
  191. if (ds.Tables[0].Rows.Count > 0)
  192. {
  193. return DataRowToModel(ds.Tables[0].Rows[0]);
  194. }
  195. else
  196. {
  197. return null;
  198. }
  199. }
  200. /// <summary>
  201. /// 得到一个对象实体
  202. /// </summary>
  203. public CallCenterApi.Model.T_Cus_CustomerBase DataRowToModel(DataRow row)
  204. {
  205. CallCenterApi.Model.T_Cus_CustomerBase model = new CallCenterApi.Model.T_Cus_CustomerBase();
  206. var columns = row.Table.Columns;
  207. if (row != null)
  208. {
  209. model.F_Id = row["F_ID"] == DBNull.Value ? "" : row["F_ID"].ToString();
  210. model.F_Name = row["F_Name"] == DBNull.Value ? "" : row["F_Name"].ToString();
  211. model.F_PhoneNum1 = row["F_PhoneNum1"] == DBNull.Value ? "" : row["F_PhoneNum1"].ToString();
  212. model.F_PhoneNum2 = row["F_PhoneNum2"] == DBNull.Value ? "" : row["F_PhoneNum2"].ToString();
  213. model.F_Address = row["F_Address"] == DBNull.Value ? "" : row["F_Address"].ToString();
  214. model.F_CusType = row["F_CusType"] == DBNull.Value ? 0 : Convert.ToInt32(row["F_CusType"]);
  215. model.F_AddAgentId = row["F_AddAgentId"] == DBNull.Value ? 0 : Convert.ToInt32(row["F_AddAgentId"]);
  216. model.F_AddTime = row["F_AddTime"] == DBNull.Value ? DateTime.Now : Convert.ToDateTime(row["F_AddTime"]);
  217. model.F_Remark = row["F_Remark"] == DBNull.Value ? "" : row["F_Remark"].ToString();
  218. model.F_YHFKId = row["F_YHFKId"] == DBNull.Value ? 0 : Convert.ToInt32(row["F_YHFKId"]);
  219. model.F_YHFKName = row["F_YHFKName"] == DBNull.Value ? "" : row["F_YHFKName"].ToString();
  220. model.F_DeptId = row["F_DeptId"] == DBNull.Value ? 0 : Convert.ToInt32(row["F_DeptId"]);
  221. model.F_DeleteFlag = row["F_DeleteFlag"] == DBNull.Value ? 0 : Convert.ToInt32(row["F_DeleteFlag"]);
  222. if (columns.Contains("AddAgentName")) { model.F_AddAgentName = row["AddAgentName"] == DBNull.Value ? "" : row["AddAgentName"].ToString(); }
  223. }
  224. return model;
  225. }
  226. /// <summary>
  227. /// 获得数据列表
  228. /// </summary>
  229. public DataSet GetList(string strWhere)
  230. {
  231. StringBuilder strSql = new StringBuilder();
  232. strSql.Append("select cb.*,ua.F_UserName as AddAgentName ");
  233. strSql.Append(" FROM T_Cus_CustomerBase cb left join T_Sys_UserAccount ua on ua.F_UserId=cb.F_AddAgentId ");
  234. if (strWhere.Trim() != "")
  235. {
  236. strSql.Append(" where " + strWhere);
  237. }
  238. return DbHelperSQL.Query(strSql.ToString());
  239. }
  240. /// <summary>
  241. /// 获得前几行数据
  242. /// </summary>
  243. public DataSet GetList(int Top, string strWhere, string filedOrder)
  244. {
  245. StringBuilder strSql = new StringBuilder();
  246. strSql.Append("select ");
  247. if (Top > 0)
  248. {
  249. strSql.Append(" top " + Top.ToString());
  250. }
  251. strSql.Append(" F_CustomerId,F_CustomerName,F_CustomerCode,F_CustomerEName,F_CustomerPym,F_Layer,F_CustomerLayer,F_CategoryId,F_TradeId,F_RegionId,F_IndustryId,F_Address,F_Url,F_Telephone,F_Mobile,F_Fax,F_Email,F_Website,F_PostCode,F_ScaleResume,F_BusinessProfile,F_BusinessLicenseID,F_TaxID,F_OpeningBank,F_BankAccount,F_LegalRepresentative,F_LegalRepresentativeCardID,F_Nature,F_Kind,F_CustomerType,F_MainProduct,F_CustomerFrom,F_TrackInfo,F_TrackState,F_ImportDegree,F_IntentProduct,F_CreateBy,F_CreatedOn,F_ModifyBy,F_ModifiedOn,F_DeleteFlag,F_StatusCode,F_ServiceDept,F_ChargeName,F_ChargeTelephone,F_Province,F_ProductLine,F_ChargeDept,F_AfterSaleName,F_CustomerNature,F_CustomerClass,F_CustomerIndustry,F_RelationShipClass,F_CurrentVersion,F_SystemStartTime,F_QualityGuaranteeEndTime,F_AfterSaleTelephone,F_Notes,F_SystemType,F_City,F_CustomerStatus,F_DeviceCount,F_MaintenanceType,F_ERPCustomerCode,F_ServiceDeptID,F_ProductLineID,F_AfterSaleNameID,F_CustomerNatureID,F_CustomerClassID,F_RelationShipClassID,F_CityID ");
  252. strSql.Append(" FROM T_Cus_CustomerBase ");
  253. if (strWhere.Trim() != "")
  254. {
  255. strSql.Append(" where " + strWhere);
  256. }
  257. strSql.Append(" order by " + filedOrder);
  258. return DbHelperSQL.Query(strSql.ToString());
  259. }
  260. /// <summary>
  261. /// 获取记录总数
  262. /// </summary>
  263. public int GetRecordCount(string strWhere)
  264. {
  265. StringBuilder strSql = new StringBuilder();
  266. strSql.Append("select count(1) FROM T_Cus_CustomerBase ");
  267. if (strWhere.Trim() != "")
  268. {
  269. strSql.Append(" where " + strWhere);
  270. }
  271. object obj = DbHelperSQL.GetSingle(strSql.ToString());
  272. if (obj == null)
  273. {
  274. return 0;
  275. }
  276. else
  277. {
  278. return Convert.ToInt32(obj);
  279. }
  280. }
  281. /// <summary>
  282. /// 分页获取数据列表
  283. /// </summary>
  284. public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
  285. {
  286. StringBuilder strSql = new StringBuilder();
  287. strSql.Append("SELECT * FROM ( ");
  288. strSql.Append(" SELECT ROW_NUMBER() OVER (");
  289. if (!string.IsNullOrEmpty(orderby.Trim()))
  290. {
  291. strSql.Append("order by T." + orderby);
  292. }
  293. else
  294. {
  295. strSql.Append("order by T.F_CustomerId desc");
  296. }
  297. strSql.Append(")AS Row, T.* from T_Cus_CustomerBase T ");
  298. if (!string.IsNullOrEmpty(strWhere.Trim()))
  299. {
  300. strSql.Append(" WHERE " + strWhere);
  301. }
  302. strSql.Append(" ) TT");
  303. strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
  304. return DbHelperSQL.Query(strSql.ToString());
  305. }
  306. /*
  307. /// <summary>
  308. /// 分页获取数据列表
  309. /// </summary>
  310. public DataSet GetList(int PageSize,int PageIndex,string strWhere)
  311. {
  312. SqlParameter[] parameters = {
  313. new SqlParameter("@tblName", SqlDbType.VarChar, 255),
  314. new SqlParameter("@fldName", SqlDbType.VarChar, 255),
  315. new SqlParameter("@PageSize", SqlDbType.Int),
  316. new SqlParameter("@PageIndex", SqlDbType.Int),
  317. new SqlParameter("@IsReCount", SqlDbType.Bit),
  318. new SqlParameter("@OrderType", SqlDbType.Bit),
  319. new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
  320. };
  321. parameters[0].Value = "T_Cus_CustomerBase";
  322. parameters[1].Value = "F_CustomerId";
  323. parameters[2].Value = PageSize;
  324. parameters[3].Value = PageIndex;
  325. parameters[4].Value = 0;
  326. parameters[5].Value = 0;
  327. parameters[6].Value = strWhere;
  328. return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
  329. }*/
  330. #endregion BasicMethod
  331. #region ExtensionMethod
  332. #endregion ExtensionMethod
  333. // public T_Cus_CustomerBase()
  334. // { }
  335. // #region BasicMethod
  336. // /// <summary>
  337. // /// 得到最大ID
  338. // /// </summary>
  339. // public int GetMaxId()
  340. // {
  341. // return DbHelperSQL.GetMaxID("F_CustomerId", "T_Cus_CustomerBase");
  342. // }
  343. // /// <summary>
  344. // /// 是否存在该记录
  345. // /// </summary>
  346. // public bool Exists(int F_CustomerId)
  347. // {
  348. // StringBuilder strSql = new StringBuilder();
  349. // strSql.Append("select count(1) from T_Cus_CustomerBase");
  350. // strSql.Append(" where F_CustomerId=@F_CustomerId");
  351. // SqlParameter[] parameters = {
  352. // new SqlParameter("@F_CustomerId", SqlDbType.Int,4)
  353. // };
  354. // parameters[0].Value = F_CustomerId;
  355. // return DbHelperSQL.Exists(strSql.ToString(), parameters);
  356. // }
  357. // /// <summary>
  358. // /// 增加一条数据
  359. // /// </summary>
  360. // public int Add(CallCenterApi.Model.T_Cus_CustomerBase model)
  361. // {
  362. // StringBuilder strSql = new StringBuilder();
  363. // strSql.Append("insert into T_Cus_CustomerBase(");
  364. // strSql.Append("F_CustomerName,F_CustomerCode,F_CustomerEName,F_CustomerPym,F_Layer,F_CustomerLayer,F_CategoryId,F_TradeId,F_RegionId,F_IndustryId,F_Address,F_Url,F_Telephone,F_Mobile,F_Fax,F_Email,F_Website,F_PostCode,F_ScaleResume,F_BusinessProfile,F_BusinessLicenseID,F_TaxID,F_OpeningBank,F_BankAccount,F_LegalRepresentative,F_LegalRepresentativeCardID,F_Nature,F_Kind,F_CustomerType,F_MainProduct,F_CustomerFrom,F_TrackInfo,F_TrackState,F_ImportDegree,F_IntentProduct,F_CreateBy,F_CreatedOn,F_ModifyBy,F_ModifiedOn,F_DeleteFlag,F_StatusCode,F_ServiceDept,F_ChargeName,F_ChargeTelephone,F_Province,F_ProductLine,F_ChargeDept,F_AfterSaleName,F_CustomerNature,F_CustomerClass,F_CustomerIndustry,F_RelationShipClass,F_CurrentVersion,F_SystemStartTime,F_QualityGuaranteeEndTime,F_AfterSaleTelephone,F_Notes,F_SystemType,F_City,F_CustomerStatus,F_DeviceCount,F_MaintenanceType,F_ERPCustomerCode,F_ServiceDeptID,F_ProductLineID,F_AfterSaleNameID,F_CustomerNatureID,F_CustomerClassID,F_RelationShipClassID,F_CityID)");
  365. // strSql.Append(" values (");
  366. // strSql.Append("@F_CustomerName,@F_CustomerCode,@F_CustomerEName,@F_CustomerPym,@F_Layer,@F_CustomerLayer,@F_CategoryId,@F_TradeId,@F_RegionId,@F_IndustryId,@F_Address,@F_Url,@F_Telephone,@F_Mobile,@F_Fax,@F_Email,@F_Website,@F_PostCode,@F_ScaleResume,@F_BusinessProfile,@F_BusinessLicenseID,@F_TaxID,@F_OpeningBank,@F_BankAccount,@F_LegalRepresentative,@F_LegalRepresentativeCardID,@F_Nature,@F_Kind,@F_CustomerType,@F_MainProduct,@F_CustomerFrom,@F_TrackInfo,@F_TrackState,@F_ImportDegree,@F_IntentProduct,@F_CreateBy,@F_CreatedOn,@F_ModifyBy,@F_ModifiedOn,@F_DeleteFlag,@F_StatusCode,@F_ServiceDept,@F_ChargeName,@F_ChargeTelephone,@F_Province,@F_ProductLine,@F_ChargeDept,@F_AfterSaleName,@F_CustomerNature,@F_CustomerClass,@F_CustomerIndustry,@F_RelationShipClass,@F_CurrentVersion,@F_SystemStartTime,@F_QualityGuaranteeEndTime,@F_AfterSaleTelephone,@F_Notes,@F_SystemType,@F_City,@F_CustomerStatus,@F_DeviceCount,@F_MaintenanceType,@F_ERPCustomerCode,@F_ServiceDeptID,@F_ProductLineID,@F_AfterSaleNameID,@F_CustomerNatureID,@F_CustomerClassID,@F_RelationShipClassID,@F_CityID)");
  367. // strSql.Append(";select @@IDENTITY");
  368. // SqlParameter[] parameters = {
  369. // new SqlParameter("@F_CustomerName", SqlDbType.NVarChar,200),
  370. // new SqlParameter("@F_CustomerCode", SqlDbType.VarChar,100),
  371. // new SqlParameter("@F_CustomerEName", SqlDbType.NVarChar,800),
  372. // new SqlParameter("@F_CustomerPym", SqlDbType.NVarChar,50),
  373. // new SqlParameter("@F_Layer", SqlDbType.SmallInt,2),
  374. // new SqlParameter("@F_CustomerLayer", SqlDbType.NVarChar,50),
  375. // new SqlParameter("@F_CategoryId", SqlDbType.Int,4),
  376. // new SqlParameter("@F_TradeId", SqlDbType.Int,4),
  377. // new SqlParameter("@F_RegionId", SqlDbType.Int,4),
  378. // new SqlParameter("@F_IndustryId", SqlDbType.Int,4),
  379. // new SqlParameter("@F_Address", SqlDbType.NVarChar,300),
  380. // new SqlParameter("@F_Url", SqlDbType.NVarChar,200),
  381. // new SqlParameter("@F_Telephone", SqlDbType.NVarChar,200),
  382. // new SqlParameter("@F_Mobile", SqlDbType.NVarChar,200),
  383. // new SqlParameter("@F_Fax", SqlDbType.NVarChar,200),
  384. // new SqlParameter("@F_Email", SqlDbType.VarChar,200),
  385. // new SqlParameter("@F_Website", SqlDbType.VarChar,200),
  386. // new SqlParameter("@F_PostCode", SqlDbType.NVarChar,50),
  387. // new SqlParameter("@F_ScaleResume", SqlDbType.NVarChar,2000),
  388. // new SqlParameter("@F_BusinessProfile", SqlDbType.NVarChar,2000),
  389. // new SqlParameter("@F_BusinessLicenseID", SqlDbType.VarChar,80),
  390. // new SqlParameter("@F_TaxID", SqlDbType.VarChar,80),
  391. // new SqlParameter("@F_OpeningBank", SqlDbType.NVarChar,100),
  392. // new SqlParameter("@F_BankAccount", SqlDbType.VarChar,80),
  393. // new SqlParameter("@F_LegalRepresentative", SqlDbType.VarChar,50),
  394. // new SqlParameter("@F_LegalRepresentativeCardID", SqlDbType.VarChar,30),
  395. // new SqlParameter("@F_Nature", SqlDbType.NVarChar,80),
  396. // new SqlParameter("@F_Kind", SqlDbType.NVarChar,80),
  397. // new SqlParameter("@F_CustomerType", SqlDbType.Int,4),
  398. // new SqlParameter("@F_MainProduct", SqlDbType.Text),
  399. // new SqlParameter("@F_CustomerFrom", SqlDbType.NVarChar,200),
  400. // new SqlParameter("@F_TrackInfo", SqlDbType.NVarChar,200),
  401. // new SqlParameter("@F_TrackState", SqlDbType.NVarChar,50),
  402. // new SqlParameter("@F_ImportDegree", SqlDbType.NVarChar,50),
  403. // new SqlParameter("@F_IntentProduct", SqlDbType.Text),
  404. // new SqlParameter("@F_CreateBy", SqlDbType.Int,4),
  405. // new SqlParameter("@F_CreatedOn", SqlDbType.DateTime),
  406. // new SqlParameter("@F_ModifyBy", SqlDbType.Int,4),
  407. // new SqlParameter("@F_ModifiedOn", SqlDbType.DateTime),
  408. // new SqlParameter("@F_DeleteFlag", SqlDbType.SmallInt,2),
  409. // new SqlParameter("@F_StatusCode", SqlDbType.SmallInt,2),
  410. // new SqlParameter("@F_ServiceDept", SqlDbType.NVarChar,20),
  411. // new SqlParameter("@F_ChargeName", SqlDbType.NVarChar,20),
  412. // new SqlParameter("@F_ChargeTelephone", SqlDbType.VarChar,15),
  413. // new SqlParameter("@F_Province", SqlDbType.NVarChar,20),
  414. // new SqlParameter("@F_ProductLine", SqlDbType.NVarChar,50),
  415. // new SqlParameter("@F_ChargeDept", SqlDbType.NVarChar,20),
  416. // new SqlParameter("@F_AfterSaleName", SqlDbType.NVarChar,20),
  417. // new SqlParameter("@F_CustomerNature", SqlDbType.NVarChar,20),
  418. // new SqlParameter("@F_CustomerClass", SqlDbType.NVarChar,10),
  419. // new SqlParameter("@F_CustomerIndustry", SqlDbType.NVarChar,10),
  420. // new SqlParameter("@F_RelationShipClass", SqlDbType.NVarChar,10),
  421. // new SqlParameter("@F_CurrentVersion", SqlDbType.VarChar,100),
  422. // new SqlParameter("@F_SystemStartTime", SqlDbType.DateTime),
  423. // new SqlParameter("@F_QualityGuaranteeEndTime", SqlDbType.DateTime),
  424. // new SqlParameter("@F_AfterSaleTelephone", SqlDbType.VarChar,15),
  425. // new SqlParameter("@F_Notes", SqlDbType.NVarChar,500),
  426. // new SqlParameter("@F_SystemType", SqlDbType.NVarChar,100),
  427. // new SqlParameter("@F_City", SqlDbType.NVarChar,10),
  428. // new SqlParameter("@F_CustomerStatus", SqlDbType.NVarChar,10),
  429. // new SqlParameter("@F_DeviceCount", SqlDbType.Int,4),
  430. // new SqlParameter("@F_MaintenanceType", SqlDbType.NVarChar,30),
  431. // new SqlParameter("@F_ERPCustomerCode", SqlDbType.VarChar,100),
  432. // new SqlParameter("@F_ServiceDeptID", SqlDbType.Int,4),
  433. // new SqlParameter("@F_ProductLineID", SqlDbType.Int,4),
  434. // new SqlParameter("@F_AfterSaleNameID", SqlDbType.Int,4),
  435. // new SqlParameter("@F_CustomerNatureID", SqlDbType.Int,4),
  436. // new SqlParameter("@F_CustomerClassID", SqlDbType.Int,4),
  437. // new SqlParameter("@F_RelationShipClassID", SqlDbType.Int,4),
  438. // new SqlParameter("@F_CityID", SqlDbType.Int,4)};
  439. // parameters[0].Value = model.F_CustomerName;
  440. // parameters[1].Value = model.F_CustomerCode;
  441. // parameters[2].Value = model.F_CustomerEName;
  442. // parameters[3].Value = model.F_CustomerPym;
  443. // parameters[4].Value = model.F_Layer;
  444. // parameters[5].Value = model.F_CustomerLayer;
  445. // parameters[6].Value = model.F_CategoryId;
  446. // parameters[7].Value = model.F_TradeId;
  447. // parameters[8].Value = model.F_RegionId;
  448. // parameters[9].Value = model.F_IndustryId;
  449. // parameters[10].Value = model.F_Address;
  450. // parameters[11].Value = model.F_Url;
  451. // parameters[12].Value = model.F_Telephone;
  452. // parameters[13].Value = model.F_Mobile;
  453. // parameters[14].Value = model.F_Fax;
  454. // parameters[15].Value = model.F_Email;
  455. // parameters[16].Value = model.F_Website;
  456. // parameters[17].Value = model.F_PostCode;
  457. // parameters[18].Value = model.F_ScaleResume;
  458. // parameters[19].Value = model.F_BusinessProfile;
  459. // parameters[20].Value = model.F_BusinessLicenseID;
  460. // parameters[21].Value = model.F_TaxID;
  461. // parameters[22].Value = model.F_OpeningBank;
  462. // parameters[23].Value = model.F_BankAccount;
  463. // parameters[24].Value = model.F_LegalRepresentative;
  464. // parameters[25].Value = model.F_LegalRepresentativeCardID;
  465. // parameters[26].Value = model.F_Nature;
  466. // parameters[27].Value = model.F_Kind;
  467. // parameters[28].Value = model.F_CustomerType;
  468. // parameters[29].Value = model.F_MainProduct;
  469. // parameters[30].Value = model.F_CustomerFrom;
  470. // parameters[31].Value = model.F_TrackInfo;
  471. // parameters[32].Value = model.F_TrackState;
  472. // parameters[33].Value = model.F_ImportDegree;
  473. // parameters[34].Value = model.F_IntentProduct;
  474. // parameters[35].Value = model.F_CreateBy;
  475. // parameters[36].Value = model.F_CreatedOn;
  476. // parameters[37].Value = model.F_ModifyBy;
  477. // parameters[38].Value = model.F_ModifiedOn;
  478. // parameters[39].Value = model.F_DeleteFlag;
  479. // parameters[40].Value = model.F_StatusCode;
  480. // parameters[41].Value = model.F_ServiceDept;
  481. // parameters[42].Value = model.F_ChargeName;
  482. // parameters[43].Value = model.F_ChargeTelephone;
  483. // parameters[44].Value = model.F_Province;
  484. // parameters[45].Value = model.F_ProductLine;
  485. // parameters[46].Value = model.F_ChargeDept;
  486. // parameters[47].Value = model.F_AfterSaleName;
  487. // parameters[48].Value = model.F_CustomerNature;
  488. // parameters[49].Value = model.F_CustomerClass;
  489. // parameters[50].Value = model.F_CustomerIndustry;
  490. // parameters[51].Value = model.F_RelationShipClass;
  491. // parameters[52].Value = model.F_CurrentVersion;
  492. // parameters[53].Value = model.F_SystemStartTime;
  493. // parameters[54].Value = model.F_QualityGuaranteeEndTime;
  494. // parameters[55].Value = model.F_AfterSaleTelephone;
  495. // parameters[56].Value = model.F_Notes;
  496. // parameters[57].Value = model.F_SystemType;
  497. // parameters[58].Value = model.F_City;
  498. // parameters[59].Value = model.F_CustomerStatus;
  499. // parameters[60].Value = model.F_DeviceCount;
  500. // parameters[61].Value = model.F_MaintenanceType;
  501. // parameters[62].Value = model.F_ERPCustomerCode;
  502. // parameters[63].Value = model.F_ServiceDeptID;
  503. // parameters[64].Value = model.F_ProductLineID;
  504. // parameters[65].Value = model.F_AfterSaleNameID;
  505. // parameters[66].Value = model.F_CustomerNatureID;
  506. // parameters[67].Value = model.F_CustomerClassID;
  507. // parameters[68].Value = model.F_RelationShipClassID;
  508. // parameters[69].Value = model.F_CityID;
  509. // object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
  510. // if (obj == null)
  511. // {
  512. // return 0;
  513. // }
  514. // else
  515. // {
  516. // return Convert.ToInt32(obj);
  517. // }
  518. // }
  519. // /// <summary>
  520. // /// 更新一条数据
  521. // /// </summary>
  522. // public bool Update(CallCenterApi.Model.T_Cus_CustomerBase model)
  523. // {
  524. // StringBuilder strSql = new StringBuilder();
  525. // strSql.Append("update T_Cus_CustomerBase set ");
  526. // strSql.Append("F_CustomerName=@F_CustomerName,");
  527. // strSql.Append("F_CustomerCode=@F_CustomerCode,");
  528. // strSql.Append("F_CustomerEName=@F_CustomerEName,");
  529. // strSql.Append("F_CustomerPym=@F_CustomerPym,");
  530. // strSql.Append("F_Layer=@F_Layer,");
  531. // strSql.Append("F_CustomerLayer=@F_CustomerLayer,");
  532. // strSql.Append("F_CategoryId=@F_CategoryId,");
  533. // strSql.Append("F_TradeId=@F_TradeId,");
  534. // strSql.Append("F_RegionId=@F_RegionId,");
  535. // strSql.Append("F_IndustryId=@F_IndustryId,");
  536. // strSql.Append("F_Address=@F_Address,");
  537. // strSql.Append("F_Url=@F_Url,");
  538. // strSql.Append("F_Telephone=@F_Telephone,");
  539. // strSql.Append("F_Mobile=@F_Mobile,");
  540. // strSql.Append("F_Fax=@F_Fax,");
  541. // strSql.Append("F_Email=@F_Email,");
  542. // strSql.Append("F_Website=@F_Website,");
  543. // strSql.Append("F_PostCode=@F_PostCode,");
  544. // strSql.Append("F_ScaleResume=@F_ScaleResume,");
  545. // strSql.Append("F_BusinessProfile=@F_BusinessProfile,");
  546. // strSql.Append("F_BusinessLicenseID=@F_BusinessLicenseID,");
  547. // strSql.Append("F_TaxID=@F_TaxID,");
  548. // strSql.Append("F_OpeningBank=@F_OpeningBank,");
  549. // strSql.Append("F_BankAccount=@F_BankAccount,");
  550. // strSql.Append("F_LegalRepresentative=@F_LegalRepresentative,");
  551. // strSql.Append("F_LegalRepresentativeCardID=@F_LegalRepresentativeCardID,");
  552. // strSql.Append("F_Nature=@F_Nature,");
  553. // strSql.Append("F_Kind=@F_Kind,");
  554. // strSql.Append("F_CustomerType=@F_CustomerType,");
  555. // strSql.Append("F_MainProduct=@F_MainProduct,");
  556. // strSql.Append("F_CustomerFrom=@F_CustomerFrom,");
  557. // strSql.Append("F_TrackInfo=@F_TrackInfo,");
  558. // strSql.Append("F_TrackState=@F_TrackState,");
  559. // strSql.Append("F_ImportDegree=@F_ImportDegree,");
  560. // strSql.Append("F_IntentProduct=@F_IntentProduct,");
  561. // strSql.Append("F_CreateBy=@F_CreateBy,");
  562. // strSql.Append("F_CreatedOn=@F_CreatedOn,");
  563. // strSql.Append("F_ModifyBy=@F_ModifyBy,");
  564. // strSql.Append("F_ModifiedOn=@F_ModifiedOn,");
  565. // strSql.Append("F_DeleteFlag=@F_DeleteFlag,");
  566. // strSql.Append("F_StatusCode=@F_StatusCode,");
  567. // strSql.Append("F_ServiceDept=@F_ServiceDept,");
  568. // strSql.Append("F_ChargeName=@F_ChargeName,");
  569. // strSql.Append("F_ChargeTelephone=@F_ChargeTelephone,");
  570. // strSql.Append("F_Province=@F_Province,");
  571. // strSql.Append("F_ProductLine=@F_ProductLine,");
  572. // strSql.Append("F_ChargeDept=@F_ChargeDept,");
  573. // strSql.Append("F_AfterSaleName=@F_AfterSaleName,");
  574. // strSql.Append("F_CustomerNature=@F_CustomerNature,");
  575. // strSql.Append("F_CustomerClass=@F_CustomerClass,");
  576. // strSql.Append("F_CustomerIndustry=@F_CustomerIndustry,");
  577. // strSql.Append("F_RelationShipClass=@F_RelationShipClass,");
  578. // strSql.Append("F_CurrentVersion=@F_CurrentVersion,");
  579. // strSql.Append("F_SystemStartTime=@F_SystemStartTime,");
  580. // strSql.Append("F_QualityGuaranteeEndTime=@F_QualityGuaranteeEndTime,");
  581. // strSql.Append("F_AfterSaleTelephone=@F_AfterSaleTelephone,");
  582. // strSql.Append("F_Notes=@F_Notes,");
  583. // strSql.Append("F_SystemType=@F_SystemType,");
  584. // strSql.Append("F_City=@F_City,");
  585. // strSql.Append("F_CustomerStatus=@F_CustomerStatus,");
  586. // strSql.Append("F_DeviceCount=@F_DeviceCount,");
  587. // strSql.Append("F_MaintenanceType=@F_MaintenanceType,");
  588. // strSql.Append("F_ERPCustomerCode=@F_ERPCustomerCode,");
  589. // strSql.Append("F_ServiceDeptID=@F_ServiceDeptID,");
  590. // strSql.Append("F_ProductLineID=@F_ProductLineID,");
  591. // strSql.Append("F_AfterSaleNameID=@F_AfterSaleNameID,");
  592. // strSql.Append("F_CustomerNatureID=@F_CustomerNatureID,");
  593. // strSql.Append("F_CustomerClassID=@F_CustomerClassID,");
  594. // strSql.Append("F_RelationShipClassID=@F_RelationShipClassID,");
  595. // strSql.Append("F_CityID=@F_CityID");
  596. // strSql.Append(" where F_CustomerId=@F_CustomerId");
  597. // SqlParameter[] parameters = {
  598. // new SqlParameter("@F_CustomerName", SqlDbType.NVarChar,200),
  599. // new SqlParameter("@F_CustomerCode", SqlDbType.VarChar,100),
  600. // new SqlParameter("@F_CustomerEName", SqlDbType.NVarChar,800),
  601. // new SqlParameter("@F_CustomerPym", SqlDbType.NVarChar,50),
  602. // new SqlParameter("@F_Layer", SqlDbType.SmallInt,2),
  603. // new SqlParameter("@F_CustomerLayer", SqlDbType.NVarChar,50),
  604. // new SqlParameter("@F_CategoryId", SqlDbType.Int,4),
  605. // new SqlParameter("@F_TradeId", SqlDbType.Int,4),
  606. // new SqlParameter("@F_RegionId", SqlDbType.Int,4),
  607. // new SqlParameter("@F_IndustryId", SqlDbType.Int,4),
  608. // new SqlParameter("@F_Address", SqlDbType.NVarChar,300),
  609. // new SqlParameter("@F_Url", SqlDbType.NVarChar,200),
  610. // new SqlParameter("@F_Telephone", SqlDbType.NVarChar,200),
  611. // new SqlParameter("@F_Mobile", SqlDbType.NVarChar,200),
  612. // new SqlParameter("@F_Fax", SqlDbType.NVarChar,200),
  613. // new SqlParameter("@F_Email", SqlDbType.VarChar,200),
  614. // new SqlParameter("@F_Website", SqlDbType.VarChar,200),
  615. // new SqlParameter("@F_PostCode", SqlDbType.NVarChar,50),
  616. // new SqlParameter("@F_ScaleResume", SqlDbType.NVarChar,2000),
  617. // new SqlParameter("@F_BusinessProfile", SqlDbType.NVarChar,2000),
  618. // new SqlParameter("@F_BusinessLicenseID", SqlDbType.VarChar,80),
  619. // new SqlParameter("@F_TaxID", SqlDbType.VarChar,80),
  620. // new SqlParameter("@F_OpeningBank", SqlDbType.NVarChar,100),
  621. // new SqlParameter("@F_BankAccount", SqlDbType.VarChar,80),
  622. // new SqlParameter("@F_LegalRepresentative", SqlDbType.VarChar,50),
  623. // new SqlParameter("@F_LegalRepresentativeCardID", SqlDbType.VarChar,30),
  624. // new SqlParameter("@F_Nature", SqlDbType.NVarChar,80),
  625. // new SqlParameter("@F_Kind", SqlDbType.NVarChar,80),
  626. // new SqlParameter("@F_CustomerType", SqlDbType.Int,4),
  627. // new SqlParameter("@F_MainProduct", SqlDbType.Text),
  628. // new SqlParameter("@F_CustomerFrom", SqlDbType.NVarChar,200),
  629. // new SqlParameter("@F_TrackInfo", SqlDbType.NVarChar,200),
  630. // new SqlParameter("@F_TrackState", SqlDbType.NVarChar,50),
  631. // new SqlParameter("@F_ImportDegree", SqlDbType.NVarChar,50),
  632. // new SqlParameter("@F_IntentProduct", SqlDbType.Text),
  633. // new SqlParameter("@F_CreateBy", SqlDbType.Int,4),
  634. // new SqlParameter("@F_CreatedOn", SqlDbType.DateTime),
  635. // new SqlParameter("@F_ModifyBy", SqlDbType.Int,4),
  636. // new SqlParameter("@F_ModifiedOn", SqlDbType.DateTime),
  637. // new SqlParameter("@F_DeleteFlag", SqlDbType.SmallInt,2),
  638. // new SqlParameter("@F_StatusCode", SqlDbType.SmallInt,2),
  639. // new SqlParameter("@F_ServiceDept", SqlDbType.NVarChar,20),
  640. // new SqlParameter("@F_ChargeName", SqlDbType.NVarChar,20),
  641. // new SqlParameter("@F_ChargeTelephone", SqlDbType.VarChar,15),
  642. // new SqlParameter("@F_Province", SqlDbType.NVarChar,20),
  643. // new SqlParameter("@F_ProductLine", SqlDbType.NVarChar,50),
  644. // new SqlParameter("@F_ChargeDept", SqlDbType.NVarChar,20),
  645. // new SqlParameter("@F_AfterSaleName", SqlDbType.NVarChar,20),
  646. // new SqlParameter("@F_CustomerNature", SqlDbType.NVarChar,20),
  647. // new SqlParameter("@F_CustomerClass", SqlDbType.NVarChar,10),
  648. // new SqlParameter("@F_CustomerIndustry", SqlDbType.NVarChar,10),
  649. // new SqlParameter("@F_RelationShipClass", SqlDbType.NVarChar,10),
  650. // new SqlParameter("@F_CurrentVersion", SqlDbType.VarChar,100),
  651. // new SqlParameter("@F_SystemStartTime", SqlDbType.DateTime),
  652. // new SqlParameter("@F_QualityGuaranteeEndTime", SqlDbType.DateTime),
  653. // new SqlParameter("@F_AfterSaleTelephone", SqlDbType.VarChar,15),
  654. // new SqlParameter("@F_Notes", SqlDbType.NVarChar,500),
  655. // new SqlParameter("@F_SystemType", SqlDbType.NVarChar,100),
  656. // new SqlParameter("@F_City", SqlDbType.NVarChar,10),
  657. // new SqlParameter("@F_CustomerStatus", SqlDbType.NVarChar,10),
  658. // new SqlParameter("@F_DeviceCount", SqlDbType.Int,4),
  659. // new SqlParameter("@F_MaintenanceType", SqlDbType.NVarChar,30),
  660. // new SqlParameter("@F_ERPCustomerCode", SqlDbType.VarChar,100),
  661. // new SqlParameter("@F_ServiceDeptID", SqlDbType.Int,4),
  662. // new SqlParameter("@F_ProductLineID", SqlDbType.Int,4),
  663. // new SqlParameter("@F_AfterSaleNameID", SqlDbType.Int,4),
  664. // new SqlParameter("@F_CustomerNatureID", SqlDbType.Int,4),
  665. // new SqlParameter("@F_CustomerClassID", SqlDbType.Int,4),
  666. // new SqlParameter("@F_RelationShipClassID", SqlDbType.Int,4),
  667. // new SqlParameter("@F_CityID", SqlDbType.Int,4),
  668. // new SqlParameter("@F_CustomerId", SqlDbType.Int,4)};
  669. // parameters[0].Value = model.F_CustomerName;
  670. // parameters[1].Value = model.F_CustomerCode;
  671. // parameters[2].Value = model.F_CustomerEName;
  672. // parameters[3].Value = model.F_CustomerPym;
  673. // parameters[4].Value = model.F_Layer;
  674. // parameters[5].Value = model.F_CustomerLayer;
  675. // parameters[6].Value = model.F_CategoryId;
  676. // parameters[7].Value = model.F_TradeId;
  677. // parameters[8].Value = model.F_RegionId;
  678. // parameters[9].Value = model.F_IndustryId;
  679. // parameters[10].Value = model.F_Address;
  680. // parameters[11].Value = model.F_Url;
  681. // parameters[12].Value = model.F_Telephone;
  682. // parameters[13].Value = model.F_Mobile;
  683. // parameters[14].Value = model.F_Fax;
  684. // parameters[15].Value = model.F_Email;
  685. // parameters[16].Value = model.F_Website;
  686. // parameters[17].Value = model.F_PostCode;
  687. // parameters[18].Value = model.F_ScaleResume;
  688. // parameters[19].Value = model.F_BusinessProfile;
  689. // parameters[20].Value = model.F_BusinessLicenseID;
  690. // parameters[21].Value = model.F_TaxID;
  691. // parameters[22].Value = model.F_OpeningBank;
  692. // parameters[23].Value = model.F_BankAccount;
  693. // parameters[24].Value = model.F_LegalRepresentative;
  694. // parameters[25].Value = model.F_LegalRepresentativeCardID;
  695. // parameters[26].Value = model.F_Nature;
  696. // parameters[27].Value = model.F_Kind;
  697. // parameters[28].Value = model.F_CustomerType;
  698. // parameters[29].Value = model.F_MainProduct;
  699. // parameters[30].Value = model.F_CustomerFrom;
  700. // parameters[31].Value = model.F_TrackInfo;
  701. // parameters[32].Value = model.F_TrackState;
  702. // parameters[33].Value = model.F_ImportDegree;
  703. // parameters[34].Value = model.F_IntentProduct;
  704. // parameters[35].Value = model.F_CreateBy;
  705. // parameters[36].Value = model.F_CreatedOn;
  706. // parameters[37].Value = model.F_ModifyBy;
  707. // parameters[38].Value = model.F_ModifiedOn;
  708. // parameters[39].Value = model.F_DeleteFlag;
  709. // parameters[40].Value = model.F_StatusCode;
  710. // parameters[41].Value = model.F_ServiceDept;
  711. // parameters[42].Value = model.F_ChargeName;
  712. // parameters[43].Value = model.F_ChargeTelephone;
  713. // parameters[44].Value = model.F_Province;
  714. // parameters[45].Value = model.F_ProductLine;
  715. // parameters[46].Value = model.F_ChargeDept;
  716. // parameters[47].Value = model.F_AfterSaleName;
  717. // parameters[48].Value = model.F_CustomerNature;
  718. // parameters[49].Value = model.F_CustomerClass;
  719. // parameters[50].Value = model.F_CustomerIndustry;
  720. // parameters[51].Value = model.F_RelationShipClass;
  721. // parameters[52].Value = model.F_CurrentVersion;
  722. // parameters[53].Value = model.F_SystemStartTime;
  723. // parameters[54].Value = model.F_QualityGuaranteeEndTime;
  724. // parameters[55].Value = model.F_AfterSaleTelephone;
  725. // parameters[56].Value = model.F_Notes;
  726. // parameters[57].Value = model.F_SystemType;
  727. // parameters[58].Value = model.F_City;
  728. // parameters[59].Value = model.F_CustomerStatus;
  729. // parameters[60].Value = model.F_DeviceCount;
  730. // parameters[61].Value = model.F_MaintenanceType;
  731. // parameters[62].Value = model.F_ERPCustomerCode;
  732. // parameters[63].Value = model.F_ServiceDeptID;
  733. // parameters[64].Value = model.F_ProductLineID;
  734. // parameters[65].Value = model.F_AfterSaleNameID;
  735. // parameters[66].Value = model.F_CustomerNatureID;
  736. // parameters[67].Value = model.F_CustomerClassID;
  737. // parameters[68].Value = model.F_RelationShipClassID;
  738. // parameters[69].Value = model.F_CityID;
  739. // parameters[70].Value = model.F_CustomerId;
  740. // int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
  741. // if (rows > 0)
  742. // {
  743. // return true;
  744. // }
  745. // else
  746. // {
  747. // return false;
  748. // }
  749. // }
  750. // /// <summary>
  751. // /// 删除一条数据
  752. // /// </summary>
  753. // public bool Delete(int F_CustomerId)
  754. // {
  755. // StringBuilder strSql = new StringBuilder();
  756. // //strSql.Append("delete from T_Cus_CustomerBase ");
  757. // strSql.Append("update T_Cus_CustomerBase set F_DeleteFlag=1");
  758. // strSql.Append(" where F_CustomerId=@F_CustomerId");
  759. // SqlParameter[] parameters = {
  760. // new SqlParameter("@F_CustomerId", SqlDbType.Int,4)
  761. // };
  762. // parameters[0].Value = F_CustomerId;
  763. // int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
  764. // if (rows > 0)
  765. // {
  766. // return true;
  767. // }
  768. // else
  769. // {
  770. // return false;
  771. // }
  772. // }
  773. // /// <summary>
  774. // /// 批量删除数据
  775. // /// </summary>
  776. // public bool DeleteList(string F_CustomerIdlist)
  777. // {
  778. // StringBuilder strSql = new StringBuilder();
  779. // //strSql.Append("delete from T_Cus_CustomerBase ");
  780. // strSql.Append("update T_Cus_CustomerBase set F_DeleteFlag=1");
  781. // strSql.Append(" where F_CustomerId in (" + F_CustomerIdlist + ") ");
  782. // int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
  783. // if (rows > 0)
  784. // {
  785. // return true;
  786. // }
  787. // else
  788. // {
  789. // return false;
  790. // }
  791. // }
  792. // /// <summary>
  793. // /// 得到一个对象实体
  794. // /// </summary>
  795. // public CallCenterApi.Model.T_Cus_CustomerBase GetModel(int F_CustomerId)
  796. // {
  797. // StringBuilder strSql = new StringBuilder();
  798. // strSql.Append("select top 1 F_CustomerId,F_CustomerName,F_CustomerCode,F_CustomerEName,F_CustomerPym,F_Layer,F_CustomerLayer,F_CategoryId,F_TradeId,F_RegionId,F_IndustryId,F_Address,F_Url,F_Telephone,F_Mobile,F_Fax,F_Email,F_Website,F_PostCode,F_ScaleResume,F_BusinessProfile,F_BusinessLicenseID,F_TaxID,F_OpeningBank,F_BankAccount,F_LegalRepresentative,F_LegalRepresentativeCardID,F_Nature,F_Kind,F_CustomerType,F_MainProduct,F_CustomerFrom,F_TrackInfo,F_TrackState,F_ImportDegree,F_IntentProduct,F_CreateBy,F_CreatedOn,F_ModifyBy,F_ModifiedOn,F_DeleteFlag,F_StatusCode,F_ServiceDept,F_ChargeName,F_ChargeTelephone,F_Province,F_ProductLine,F_ChargeDept,F_AfterSaleName,F_CustomerNature,F_CustomerClass,F_CustomerIndustry,F_RelationShipClass,F_CurrentVersion,F_SystemStartTime,F_QualityGuaranteeEndTime,F_AfterSaleTelephone,F_Notes,F_SystemType,F_City,F_CustomerStatus,F_DeviceCount,F_MaintenanceType,F_ERPCustomerCode,F_ServiceDeptID,F_ProductLineID,F_AfterSaleNameID,F_CustomerNatureID,F_CustomerClassID,F_RelationShipClassID,F_CityID from T_Cus_CustomerBase ");
  799. // strSql.Append(" where F_CustomerId=@F_CustomerId");
  800. // SqlParameter[] parameters = {
  801. // new SqlParameter("@F_CustomerId", SqlDbType.Int,4)
  802. // };
  803. // parameters[0].Value = F_CustomerId;
  804. // CallCenterApi.Model.T_Cus_CustomerBase model = new CallCenterApi.Model.T_Cus_CustomerBase();
  805. // DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
  806. // if (ds.Tables[0].Rows.Count > 0)
  807. // {
  808. // return DataRowToModel(ds.Tables[0].Rows[0]);
  809. // }
  810. // else
  811. // {
  812. // return null;
  813. // }
  814. // }
  815. // /// <summary>
  816. // /// 得到一个对象实体
  817. // /// </summary>
  818. // public CallCenterApi.Model.T_Cus_CustomerBase DataRowToModel(DataRow row)
  819. // {
  820. // CallCenterApi.Model.T_Cus_CustomerBase model = new CallCenterApi.Model.T_Cus_CustomerBase();
  821. // if (row != null)
  822. // {
  823. // if (row["F_CustomerId"] != null && row["F_CustomerId"].ToString() != "")
  824. // {
  825. // model.F_CustomerId = int.Parse(row["F_CustomerId"].ToString());
  826. // }
  827. // if (row["F_CustomerName"] != null)
  828. // {
  829. // model.F_CustomerName = row["F_CustomerName"].ToString();
  830. // }
  831. // if (row["F_CustomerCode"] != null)
  832. // {
  833. // model.F_CustomerCode = row["F_CustomerCode"].ToString();
  834. // }
  835. // if (row["F_CustomerEName"] != null)
  836. // {
  837. // model.F_CustomerEName = row["F_CustomerEName"].ToString();
  838. // }
  839. // if (row["F_CustomerPym"] != null)
  840. // {
  841. // model.F_CustomerPym = row["F_CustomerPym"].ToString();
  842. // }
  843. // if (row["F_Layer"] != null && row["F_Layer"].ToString() != "")
  844. // {
  845. // model.F_Layer = int.Parse(row["F_Layer"].ToString());
  846. // }
  847. // if (row["F_CustomerLayer"] != null)
  848. // {
  849. // model.F_CustomerLayer = row["F_CustomerLayer"].ToString();
  850. // }
  851. // if (row["F_CategoryId"] != null && row["F_CategoryId"].ToString() != "")
  852. // {
  853. // model.F_CategoryId = int.Parse(row["F_CategoryId"].ToString());
  854. // }
  855. // if (row["F_TradeId"] != null && row["F_TradeId"].ToString() != "")
  856. // {
  857. // model.F_TradeId = int.Parse(row["F_TradeId"].ToString());
  858. // }
  859. // if (row["F_RegionId"] != null && row["F_RegionId"].ToString() != "")
  860. // {
  861. // model.F_RegionId = int.Parse(row["F_RegionId"].ToString());
  862. // }
  863. // if (row["F_IndustryId"] != null && row["F_IndustryId"].ToString() != "")
  864. // {
  865. // model.F_IndustryId = int.Parse(row["F_IndustryId"].ToString());
  866. // }
  867. // if (row["F_Address"] != null)
  868. // {
  869. // model.F_Address = row["F_Address"].ToString();
  870. // }
  871. // if (row["F_Url"] != null)
  872. // {
  873. // model.F_Url = row["F_Url"].ToString();
  874. // }
  875. // if (row["F_Telephone"] != null)
  876. // {
  877. // model.F_Telephone = row["F_Telephone"].ToString();
  878. // }
  879. // if (row["F_Mobile"] != null)
  880. // {
  881. // model.F_Mobile = row["F_Mobile"].ToString();
  882. // }
  883. // if (row["F_Fax"] != null)
  884. // {
  885. // model.F_Fax = row["F_Fax"].ToString();
  886. // }
  887. // if (row["F_Email"] != null)
  888. // {
  889. // model.F_Email = row["F_Email"].ToString();
  890. // }
  891. // if (row["F_Website"] != null)
  892. // {
  893. // model.F_Website = row["F_Website"].ToString();
  894. // }
  895. // if (row["F_PostCode"] != null)
  896. // {
  897. // model.F_PostCode = row["F_PostCode"].ToString();
  898. // }
  899. // if (row["F_ScaleResume"] != null)
  900. // {
  901. // model.F_ScaleResume = row["F_ScaleResume"].ToString();
  902. // }
  903. // if (row["F_BusinessProfile"] != null)
  904. // {
  905. // model.F_BusinessProfile = row["F_BusinessProfile"].ToString();
  906. // }
  907. // if (row["F_BusinessLicenseID"] != null)
  908. // {
  909. // model.F_BusinessLicenseID = row["F_BusinessLicenseID"].ToString();
  910. // }
  911. // if (row["F_TaxID"] != null)
  912. // {
  913. // model.F_TaxID = row["F_TaxID"].ToString();
  914. // }
  915. // if (row["F_OpeningBank"] != null)
  916. // {
  917. // model.F_OpeningBank = row["F_OpeningBank"].ToString();
  918. // }
  919. // if (row["F_BankAccount"] != null)
  920. // {
  921. // model.F_BankAccount = row["F_BankAccount"].ToString();
  922. // }
  923. // if (row["F_LegalRepresentative"] != null)
  924. // {
  925. // model.F_LegalRepresentative = row["F_LegalRepresentative"].ToString();
  926. // }
  927. // if (row["F_LegalRepresentativeCardID"] != null)
  928. // {
  929. // model.F_LegalRepresentativeCardID = row["F_LegalRepresentativeCardID"].ToString();
  930. // }
  931. // if (row["F_Nature"] != null)
  932. // {
  933. // model.F_Nature = row["F_Nature"].ToString();
  934. // }
  935. // if (row["F_Kind"] != null)
  936. // {
  937. // model.F_Kind = row["F_Kind"].ToString();
  938. // }
  939. // if (row["F_CustomerType"] != null && row["F_CustomerType"].ToString() != "")
  940. // {
  941. // model.F_CustomerType = int.Parse(row["F_CustomerType"].ToString());
  942. // }
  943. // if (row["F_MainProduct"] != null)
  944. // {
  945. // model.F_MainProduct = row["F_MainProduct"].ToString();
  946. // }
  947. // if (row["F_CustomerFrom"] != null)
  948. // {
  949. // model.F_CustomerFrom = row["F_CustomerFrom"].ToString();
  950. // }
  951. // if (row["F_TrackInfo"] != null)
  952. // {
  953. // model.F_TrackInfo = row["F_TrackInfo"].ToString();
  954. // }
  955. // if (row["F_TrackState"] != null)
  956. // {
  957. // model.F_TrackState = row["F_TrackState"].ToString();
  958. // }
  959. // if (row["F_ImportDegree"] != null)
  960. // {
  961. // model.F_ImportDegree = row["F_ImportDegree"].ToString();
  962. // }
  963. // if (row["F_IntentProduct"] != null)
  964. // {
  965. // model.F_IntentProduct = row["F_IntentProduct"].ToString();
  966. // }
  967. // if (row["F_CreateBy"] != null && row["F_CreateBy"].ToString() != "")
  968. // {
  969. // model.F_CreateBy = int.Parse(row["F_CreateBy"].ToString());
  970. // }
  971. // if (row["F_CreatedOn"] != null && row["F_CreatedOn"].ToString() != "")
  972. // {
  973. // model.F_CreatedOn = DateTime.Parse(row["F_CreatedOn"].ToString());
  974. // }
  975. // if (row["F_ModifyBy"] != null && row["F_ModifyBy"].ToString() != "")
  976. // {
  977. // model.F_ModifyBy = int.Parse(row["F_ModifyBy"].ToString());
  978. // }
  979. // if (row["F_ModifiedOn"] != null && row["F_ModifiedOn"].ToString() != "")
  980. // {
  981. // model.F_ModifiedOn = DateTime.Parse(row["F_ModifiedOn"].ToString());
  982. // }
  983. // if (row["F_DeleteFlag"] != null && row["F_DeleteFlag"].ToString() != "")
  984. // {
  985. // model.F_DeleteFlag = int.Parse(row["F_DeleteFlag"].ToString());
  986. // }
  987. // if (row["F_StatusCode"] != null && row["F_StatusCode"].ToString() != "")
  988. // {
  989. // model.F_StatusCode = int.Parse(row["F_StatusCode"].ToString());
  990. // }
  991. // if (row["F_ServiceDept"] != null)
  992. // {
  993. // model.F_ServiceDept = row["F_ServiceDept"].ToString();
  994. // }
  995. // if (row["F_ChargeName"] != null)
  996. // {
  997. // model.F_ChargeName = row["F_ChargeName"].ToString();
  998. // }
  999. // if (row["F_ChargeTelephone"] != null)
  1000. // {
  1001. // model.F_ChargeTelephone = row["F_ChargeTelephone"].ToString();
  1002. // }
  1003. // if (row["F_Province"] != null)
  1004. // {
  1005. // model.F_Province = row["F_Province"].ToString();
  1006. // }
  1007. // if (row["F_ProductLine"] != null)
  1008. // {
  1009. // model.F_ProductLine = row["F_ProductLine"].ToString();
  1010. // }
  1011. // if (row["F_ChargeDept"] != null)
  1012. // {
  1013. // model.F_ChargeDept = row["F_ChargeDept"].ToString();
  1014. // }
  1015. // if (row["F_AfterSaleName"] != null)
  1016. // {
  1017. // model.F_AfterSaleName = row["F_AfterSaleName"].ToString();
  1018. // }
  1019. // if (row["F_CustomerNature"] != null)
  1020. // {
  1021. // model.F_CustomerNature = row["F_CustomerNature"].ToString();
  1022. // }
  1023. // if (row["F_CustomerClass"] != null)
  1024. // {
  1025. // model.F_CustomerClass = row["F_CustomerClass"].ToString();
  1026. // }
  1027. // if (row["F_CustomerIndustry"] != null)
  1028. // {
  1029. // model.F_CustomerIndustry = row["F_CustomerIndustry"].ToString();
  1030. // }
  1031. // if (row["F_RelationShipClass"] != null)
  1032. // {
  1033. // model.F_RelationShipClass = row["F_RelationShipClass"].ToString();
  1034. // }
  1035. // if (row["F_CurrentVersion"] != null)
  1036. // {
  1037. // model.F_CurrentVersion = row["F_CurrentVersion"].ToString();
  1038. // }
  1039. // if (row["F_SystemStartTime"] != null && row["F_SystemStartTime"].ToString() != "")
  1040. // {
  1041. // model.F_SystemStartTime = DateTime.Parse(row["F_SystemStartTime"].ToString());
  1042. // }
  1043. // if (row["F_QualityGuaranteeEndTime"] != null && row["F_QualityGuaranteeEndTime"].ToString() != "")
  1044. // {
  1045. // model.F_QualityGuaranteeEndTime = DateTime.Parse(row["F_QualityGuaranteeEndTime"].ToString());
  1046. // }
  1047. // if (row["F_AfterSaleTelephone"] != null)
  1048. // {
  1049. // model.F_AfterSaleTelephone = row["F_AfterSaleTelephone"].ToString();
  1050. // }
  1051. // if (row["F_Notes"] != null)
  1052. // {
  1053. // model.F_Notes = row["F_Notes"].ToString();
  1054. // }
  1055. // if (row["F_SystemType"] != null)
  1056. // {
  1057. // model.F_SystemType = row["F_SystemType"].ToString();
  1058. // }
  1059. // if (row["F_City"] != null)
  1060. // {
  1061. // model.F_City = row["F_City"].ToString();
  1062. // }
  1063. // if (row["F_CustomerStatus"] != null)
  1064. // {
  1065. // model.F_CustomerStatus = row["F_CustomerStatus"].ToString();
  1066. // }
  1067. // if (row["F_DeviceCount"] != null && row["F_DeviceCount"].ToString() != "")
  1068. // {
  1069. // model.F_DeviceCount = int.Parse(row["F_DeviceCount"].ToString());
  1070. // }
  1071. // if (row["F_MaintenanceType"] != null)
  1072. // {
  1073. // model.F_MaintenanceType = row["F_MaintenanceType"].ToString();
  1074. // }
  1075. // if (row["F_ERPCustomerCode"] != null)
  1076. // {
  1077. // model.F_ERPCustomerCode = row["F_ERPCustomerCode"].ToString();
  1078. // }
  1079. // if (row["F_ServiceDeptID"] != null && row["F_ServiceDeptID"].ToString() != "")
  1080. // {
  1081. // model.F_ServiceDeptID = int.Parse(row["F_ServiceDeptID"].ToString());
  1082. // }
  1083. // if (row["F_ProductLineID"] != null && row["F_ProductLineID"].ToString() != "")
  1084. // {
  1085. // model.F_ProductLineID = int.Parse(row["F_ProductLineID"].ToString());
  1086. // }
  1087. // if (row["F_AfterSaleNameID"] != null && row["F_AfterSaleNameID"].ToString() != "")
  1088. // {
  1089. // model.F_AfterSaleNameID = int.Parse(row["F_AfterSaleNameID"].ToString());
  1090. // }
  1091. // if (row["F_CustomerNatureID"] != null && row["F_CustomerNatureID"].ToString() != "")
  1092. // {
  1093. // model.F_CustomerNatureID = int.Parse(row["F_CustomerNatureID"].ToString());
  1094. // }
  1095. // if (row["F_CustomerClassID"] != null && row["F_CustomerClassID"].ToString() != "")
  1096. // {
  1097. // model.F_CustomerClassID = int.Parse(row["F_CustomerClassID"].ToString());
  1098. // }
  1099. // if (row["F_RelationShipClassID"] != null && row["F_RelationShipClassID"].ToString() != "")
  1100. // {
  1101. // model.F_RelationShipClassID = int.Parse(row["F_RelationShipClassID"].ToString());
  1102. // }
  1103. // if (row["F_CityID"] != null && row["F_CityID"].ToString() != "")
  1104. // {
  1105. // model.F_CityID = int.Parse(row["F_CityID"].ToString());
  1106. // }
  1107. // }
  1108. // return model;
  1109. // }
  1110. // /// <summary>
  1111. // /// 获得数据列表
  1112. // /// </summary>
  1113. // public DataSet GetList(string strWhere)
  1114. // {
  1115. // StringBuilder strSql = new StringBuilder();
  1116. // strSql.Append("select F_CustomerId,F_CustomerName,F_CustomerCode,F_CustomerEName,F_CustomerPym,F_Layer,F_CustomerLayer,F_CategoryId,F_TradeId,F_RegionId,F_IndustryId,F_Address,F_Url,F_Telephone,F_Mobile,F_Fax,F_Email,F_Website,F_PostCode,F_ScaleResume,F_BusinessProfile,F_BusinessLicenseID,F_TaxID,F_OpeningBank,F_BankAccount,F_LegalRepresentative,F_LegalRepresentativeCardID,F_Nature,F_Kind,F_CustomerType,F_MainProduct,F_CustomerFrom,F_TrackInfo,F_TrackState,F_ImportDegree,F_IntentProduct,F_CreateBy,F_CreatedOn,F_ModifyBy,F_ModifiedOn,F_DeleteFlag,F_StatusCode,F_ServiceDept,F_ChargeName,F_ChargeTelephone,F_Province,F_ProductLine,F_ChargeDept,F_AfterSaleName,F_CustomerNature,F_CustomerClass,F_CustomerIndustry,F_RelationShipClass,F_CurrentVersion,F_SystemStartTime,F_QualityGuaranteeEndTime,F_AfterSaleTelephone,F_Notes,F_SystemType,F_City,F_CustomerStatus,F_DeviceCount,F_MaintenanceType,F_ERPCustomerCode,F_ServiceDeptID,F_ProductLineID,F_AfterSaleNameID,F_CustomerNatureID,F_CustomerClassID,F_RelationShipClassID,F_CityID ");
  1117. // strSql.Append(" FROM T_Cus_CustomerBase ");
  1118. // if (strWhere.Trim() != "")
  1119. // {
  1120. // strSql.Append(" where " + strWhere);
  1121. // }
  1122. // return DbHelperSQL.Query(strSql.ToString());
  1123. // }
  1124. // /// <summary>
  1125. // /// 获得前几行数据
  1126. // /// </summary>
  1127. // public DataSet GetList(int Top, string strWhere, string filedOrder)
  1128. // {
  1129. // StringBuilder strSql = new StringBuilder();
  1130. // strSql.Append("select ");
  1131. // if (Top > 0)
  1132. // {
  1133. // strSql.Append(" top " + Top.ToString());
  1134. // }
  1135. // strSql.Append(" F_CustomerId,F_CustomerName,F_CustomerCode,F_CustomerEName,F_CustomerPym,F_Layer,F_CustomerLayer,F_CategoryId,F_TradeId,F_RegionId,F_IndustryId,F_Address,F_Url,F_Telephone,F_Mobile,F_Fax,F_Email,F_Website,F_PostCode,F_ScaleResume,F_BusinessProfile,F_BusinessLicenseID,F_TaxID,F_OpeningBank,F_BankAccount,F_LegalRepresentative,F_LegalRepresentativeCardID,F_Nature,F_Kind,F_CustomerType,F_MainProduct,F_CustomerFrom,F_TrackInfo,F_TrackState,F_ImportDegree,F_IntentProduct,F_CreateBy,F_CreatedOn,F_ModifyBy,F_ModifiedOn,F_DeleteFlag,F_StatusCode,F_ServiceDept,F_ChargeName,F_ChargeTelephone,F_Province,F_ProductLine,F_ChargeDept,F_AfterSaleName,F_CustomerNature,F_CustomerClass,F_CustomerIndustry,F_RelationShipClass,F_CurrentVersion,F_SystemStartTime,F_QualityGuaranteeEndTime,F_AfterSaleTelephone,F_Notes,F_SystemType,F_City,F_CustomerStatus,F_DeviceCount,F_MaintenanceType,F_ERPCustomerCode,F_ServiceDeptID,F_ProductLineID,F_AfterSaleNameID,F_CustomerNatureID,F_CustomerClassID,F_RelationShipClassID,F_CityID ");
  1136. // strSql.Append(" FROM T_Cus_CustomerBase ");
  1137. // if (strWhere.Trim() != "")
  1138. // {
  1139. // strSql.Append(" where " + strWhere);
  1140. // }
  1141. // strSql.Append(" order by " + filedOrder);
  1142. // return DbHelperSQL.Query(strSql.ToString());
  1143. // }
  1144. // /// <summary>
  1145. // /// 获取记录总数
  1146. // /// </summary>
  1147. // public int GetRecordCount(string strWhere)
  1148. // {
  1149. // StringBuilder strSql = new StringBuilder();
  1150. // strSql.Append("select count(1) FROM T_Cus_CustomerBase ");
  1151. // if (strWhere.Trim() != "")
  1152. // {
  1153. // strSql.Append(" where " + strWhere);
  1154. // }
  1155. // object obj = DbHelperSQL.GetSingle(strSql.ToString());
  1156. // if (obj == null)
  1157. // {
  1158. // return 0;
  1159. // }
  1160. // else
  1161. // {
  1162. // return Convert.ToInt32(obj);
  1163. // }
  1164. // }
  1165. // /// <summary>
  1166. // /// 分页获取数据列表
  1167. // /// </summary>
  1168. // public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
  1169. // {
  1170. // StringBuilder strSql = new StringBuilder();
  1171. // strSql.Append("SELECT * FROM ( ");
  1172. // strSql.Append(" SELECT ROW_NUMBER() OVER (");
  1173. // if (!string.IsNullOrEmpty(orderby.Trim()))
  1174. // {
  1175. // strSql.Append("order by T." + orderby);
  1176. // }
  1177. // else
  1178. // {
  1179. // strSql.Append("order by T.F_CustomerId desc");
  1180. // }
  1181. // strSql.Append(")AS Row, T.* from T_Cus_CustomerBase T ");
  1182. // if (!string.IsNullOrEmpty(strWhere.Trim()))
  1183. // {
  1184. // strSql.Append(" WHERE " + strWhere);
  1185. // }
  1186. // strSql.Append(" ) TT");
  1187. // strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
  1188. // return DbHelperSQL.Query(strSql.ToString());
  1189. // }
  1190. // /*
  1191. ///// <summary>
  1192. ///// 分页获取数据列表
  1193. ///// </summary>
  1194. //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
  1195. //{
  1196. // SqlParameter[] parameters = {
  1197. // new SqlParameter("@tblName", SqlDbType.VarChar, 255),
  1198. // new SqlParameter("@fldName", SqlDbType.VarChar, 255),
  1199. // new SqlParameter("@PageSize", SqlDbType.Int),
  1200. // new SqlParameter("@PageIndex", SqlDbType.Int),
  1201. // new SqlParameter("@IsReCount", SqlDbType.Bit),
  1202. // new SqlParameter("@OrderType", SqlDbType.Bit),
  1203. // new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
  1204. // };
  1205. // parameters[0].Value = "T_Cus_CustomerBase";
  1206. // parameters[1].Value = "F_CustomerId";
  1207. // parameters[2].Value = PageSize;
  1208. // parameters[3].Value = PageIndex;
  1209. // parameters[4].Value = 0;
  1210. // parameters[5].Value = 0;
  1211. // parameters[6].Value = strWhere;
  1212. // return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
  1213. //}*/
  1214. // #endregion BasicMethod
  1215. // #region ExtensionMethod
  1216. // #endregion ExtensionMethod
  1217. }
  1218. }