|
|
@@ -38,22 +38,23 @@ namespace CallCenterApi.DAL
|
|
38
|
38
|
{
|
|
39
|
39
|
StringBuilder strSql = new StringBuilder();
|
|
40
|
40
|
strSql.Append("insert into T_Sys_Users(");
|
|
41
|
|
- strSql.Append("F_OpenId,F_CreateTime,F_Type,F_Password,F_Name,F_Telphone,F_Sex,F_Province,F_City,F_County,F_Address)");
|
|
|
41
|
+ strSql.Append("F_OpenId,F_CreateTime,F_Type,F_Password,F_Name,F_Telphone,F_Sex,F_Province,F_City,F_County,F_Address,F_ImgUrl)");
|
|
42
|
42
|
strSql.Append(" values (");
|
|
43
|
|
- strSql.Append("@F_OpenId,@F_CreateTime,@F_Type,@F_Password,@F_Name,@F_Telphone,@F_Sex,@F_Province,@F_City,@F_County,@F_Address)");
|
|
|
43
|
+ strSql.Append("@F_OpenId,@F_CreateTime,@F_Type,@F_Password,@F_Name,@F_Telphone,@F_Sex,@F_Province,@F_City,@F_County,@F_Address,@F_ImgUrl)");
|
|
44
|
44
|
strSql.Append(";select @@IDENTITY");
|
|
45
|
45
|
SqlParameter[] parameters = {
|
|
46
|
46
|
new SqlParameter("@F_OpenId", SqlDbType.VarChar,100),
|
|
47
|
47
|
new SqlParameter("@F_CreateTime", SqlDbType.DateTime),
|
|
48
|
48
|
new SqlParameter("@F_Type", SqlDbType.Int,4),
|
|
49
|
49
|
new SqlParameter("@F_Password", SqlDbType.VarChar,50),
|
|
50
|
|
- new SqlParameter("@F_Name", SqlDbType.VarChar,50),
|
|
|
50
|
+ new SqlParameter("@F_Name", SqlDbType.NVarChar,500),
|
|
51
|
51
|
new SqlParameter("@F_Telphone", SqlDbType.VarChar,50),
|
|
52
|
52
|
new SqlParameter("@F_Sex", SqlDbType.Int,4),
|
|
53
|
53
|
new SqlParameter("@F_Province", SqlDbType.VarChar,50),
|
|
54
|
54
|
new SqlParameter("@F_City", SqlDbType.VarChar,50),
|
|
55
|
55
|
new SqlParameter("@F_County", SqlDbType.VarChar,50),
|
|
56
|
|
- new SqlParameter("@F_Address", SqlDbType.VarChar,500)};
|
|
|
56
|
+ new SqlParameter("@F_Address", SqlDbType.VarChar,500),
|
|
|
57
|
+ new SqlParameter("@F_ImgUrl", SqlDbType.VarChar,500)};
|
|
57
|
58
|
parameters[0].Value = model.F_OpenId;
|
|
58
|
59
|
parameters[1].Value = model.F_CreateTime;
|
|
59
|
60
|
parameters[2].Value = model.F_Type;
|
|
|
@@ -65,6 +66,7 @@ namespace CallCenterApi.DAL
|
|
65
|
66
|
parameters[8].Value = model.F_City;
|
|
66
|
67
|
parameters[9].Value = model.F_County;
|
|
67
|
68
|
parameters[10].Value = model.F_Address;
|
|
|
69
|
+ parameters[11].Value = model.F_ImgUrl;
|
|
68
|
70
|
|
|
69
|
71
|
object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
|
|
70
|
72
|
if (obj == null)
|
|
|
@@ -93,20 +95,22 @@ namespace CallCenterApi.DAL
|
|
93
|
95
|
strSql.Append("F_Province=@F_Province,");
|
|
94
|
96
|
strSql.Append("F_City=@F_City,");
|
|
95
|
97
|
strSql.Append("F_County=@F_County,");
|
|
96
|
|
- strSql.Append("F_Address=@F_Address");
|
|
|
98
|
+ strSql.Append("F_Address=@F_Address,");
|
|
|
99
|
+ strSql.Append("F_ImgUrl=@F_ImgUrl");
|
|
97
|
100
|
strSql.Append(" where F_Id=@F_Id");
|
|
98
|
101
|
SqlParameter[] parameters = {
|
|
99
|
102
|
new SqlParameter("@F_OpenId", SqlDbType.VarChar,100),
|
|
100
|
103
|
new SqlParameter("@F_CreateTime", SqlDbType.DateTime),
|
|
101
|
104
|
new SqlParameter("@F_Type", SqlDbType.Int,4),
|
|
102
|
105
|
new SqlParameter("@F_Password", SqlDbType.VarChar,50),
|
|
103
|
|
- new SqlParameter("@F_Name", SqlDbType.VarChar,50),
|
|
|
106
|
+ new SqlParameter("@F_Name", SqlDbType.NVarChar,500),
|
|
104
|
107
|
new SqlParameter("@F_Telphone", SqlDbType.VarChar,50),
|
|
105
|
108
|
new SqlParameter("@F_Sex", SqlDbType.Int,4),
|
|
106
|
109
|
new SqlParameter("@F_Province", SqlDbType.VarChar,50),
|
|
107
|
110
|
new SqlParameter("@F_City", SqlDbType.VarChar,50),
|
|
108
|
111
|
new SqlParameter("@F_County", SqlDbType.VarChar,50),
|
|
109
|
112
|
new SqlParameter("@F_Address", SqlDbType.VarChar,500),
|
|
|
113
|
+ new SqlParameter("@F_ImgUrl", SqlDbType.VarChar,500),
|
|
110
|
114
|
new SqlParameter("@F_Id", SqlDbType.BigInt,8)};
|
|
111
|
115
|
parameters[0].Value = model.F_OpenId;
|
|
112
|
116
|
parameters[1].Value = model.F_CreateTime;
|
|
|
@@ -119,7 +123,8 @@ namespace CallCenterApi.DAL
|
|
119
|
123
|
parameters[8].Value = model.F_City;
|
|
120
|
124
|
parameters[9].Value = model.F_County;
|
|
121
|
125
|
parameters[10].Value = model.F_Address;
|
|
122
|
|
- parameters[11].Value = model.F_Id;
|
|
|
126
|
+ parameters[11].Value = model.F_ImgUrl;
|
|
|
127
|
+ parameters[12].Value = model.F_Id;
|
|
123
|
128
|
|
|
124
|
129
|
int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
|
|
125
|
130
|
if (rows > 0)
|
|
|
@@ -179,16 +184,16 @@ namespace CallCenterApi.DAL
|
|
179
|
184
|
/// <summary>
|
|
180
|
185
|
/// 得到一个对象实体
|
|
181
|
186
|
/// </summary>
|
|
182
|
|
- public CallCenterApi.Model.T_Sys_Users GetModel(long F_Id)
|
|
|
187
|
+ public CallCenterApi.Model.T_Sys_Users GetModel(string usercode)
|
|
183
|
188
|
{
|
|
184
|
189
|
|
|
185
|
190
|
StringBuilder strSql = new StringBuilder();
|
|
186
|
|
- strSql.Append("select top 1 F_Id,F_OpenId,F_CreateTime,F_Type,F_Password,F_Name,F_Telphone,F_Sex,F_Province,F_City,F_County,F_Address from T_Sys_Users ");
|
|
187
|
|
- strSql.Append(" where F_Id=@F_Id");
|
|
|
191
|
+ strSql.Append("select top 1 F_Id,F_OpenId,F_CreateTime,F_Type,F_Password,F_Name,F_Telphone,F_Sex,F_Province,F_City,F_County,F_Address,F_ImgUrl from T_Sys_Users ");
|
|
|
192
|
+ strSql.Append(" where F_OpenId=@F_OpenId");
|
|
188
|
193
|
SqlParameter[] parameters = {
|
|
189
|
|
- new SqlParameter("@F_Id", SqlDbType.BigInt)
|
|
|
194
|
+ new SqlParameter("@F_OpenId", SqlDbType.VarChar,100)
|
|
190
|
195
|
};
|
|
191
|
|
- parameters[0].Value = F_Id;
|
|
|
196
|
+ parameters[0].Value = usercode;
|
|
192
|
197
|
|
|
193
|
198
|
CallCenterApi.Model.T_Sys_Users model = new CallCenterApi.Model.T_Sys_Users();
|
|
194
|
199
|
DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
|
|
|
@@ -205,16 +210,16 @@ namespace CallCenterApi.DAL
|
|
205
|
210
|
/// <summary>
|
|
206
|
211
|
/// 得到一个对象实体
|
|
207
|
212
|
/// </summary>
|
|
208
|
|
- public CallCenterApi.Model.T_Sys_Users GetModel(string openid)
|
|
|
213
|
+ public CallCenterApi.Model.T_Sys_Users GetModel(long F_Id)
|
|
209
|
214
|
{
|
|
210
|
215
|
|
|
211
|
216
|
StringBuilder strSql = new StringBuilder();
|
|
212
|
|
- strSql.Append("select top 1 F_Id,F_OpenId,F_CreateTime,F_Type,F_Password,F_Name,F_Telphone,F_Sex,F_Province,F_City,F_County,F_Address from T_Sys_Users ");
|
|
213
|
|
- strSql.Append(" where F_OpenId=@F_OpenId");
|
|
|
217
|
+ strSql.Append("select top 1 F_Id,F_OpenId,F_CreateTime,F_Type,F_Password,F_Name,F_Telphone,F_Sex,F_Province,F_City,F_County,F_Address,F_ImgUrl from T_Sys_Users ");
|
|
|
218
|
+ strSql.Append(" where F_Id=@F_Id");
|
|
214
|
219
|
SqlParameter[] parameters = {
|
|
215
|
|
- new SqlParameter("@F_OpenId", SqlDbType.VarChar,100)
|
|
|
220
|
+ new SqlParameter("@F_Id", SqlDbType.BigInt)
|
|
216
|
221
|
};
|
|
217
|
|
- parameters[0].Value = openid;
|
|
|
222
|
+ parameters[0].Value = F_Id;
|
|
218
|
223
|
|
|
219
|
224
|
CallCenterApi.Model.T_Sys_Users model = new CallCenterApi.Model.T_Sys_Users();
|
|
220
|
225
|
DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
|
|
|
@@ -285,6 +290,10 @@ namespace CallCenterApi.DAL
|
|
285
|
290
|
{
|
|
286
|
291
|
model.F_Address = row["F_Address"].ToString();
|
|
287
|
292
|
}
|
|
|
293
|
+ if (row["F_ImgUrl"] != null)
|
|
|
294
|
+ {
|
|
|
295
|
+ model.F_ImgUrl = row["F_ImgUrl"].ToString();
|
|
|
296
|
+ }
|
|
288
|
297
|
}
|
|
289
|
298
|
return model;
|
|
290
|
299
|
}
|
|
|
@@ -295,7 +304,7 @@ namespace CallCenterApi.DAL
|
|
295
|
304
|
public DataSet GetList(string strWhere)
|
|
296
|
305
|
{
|
|
297
|
306
|
StringBuilder strSql = new StringBuilder();
|
|
298
|
|
- strSql.Append("select F_Id,F_OpenId,F_CreateTime,F_Type,F_Password,F_Name,F_Telphone,F_Sex,F_Province,F_City,F_County,F_Address ");
|
|
|
307
|
+ strSql.Append("select F_Id,F_OpenId,F_CreateTime,F_Type,F_Password,F_Name,F_Telphone,F_Sex,F_Province,F_City,F_County,F_Address,F_ImgUrl ");
|
|
299
|
308
|
strSql.Append(" FROM T_Sys_Users ");
|
|
300
|
309
|
if (strWhere.Trim() != "")
|
|
301
|
310
|
{
|
|
|
@@ -315,7 +324,7 @@ namespace CallCenterApi.DAL
|
|
315
|
324
|
{
|
|
316
|
325
|
strSql.Append(" top " + Top.ToString());
|
|
317
|
326
|
}
|
|
318
|
|
- strSql.Append(" F_Id,F_OpenId,F_CreateTime,F_Type,F_Password,F_Name,F_Telphone,F_Sex,F_Province,F_City,F_County,F_Address ");
|
|
|
327
|
+ strSql.Append(" F_Id,F_OpenId,F_CreateTime,F_Type,F_Password,F_Name,F_Telphone,F_Sex,F_Province,F_City,F_County,F_Address,F_ImgUrl ");
|
|
319
|
328
|
strSql.Append(" FROM T_Sys_Users ");
|
|
320
|
329
|
if (strWhere.Trim() != "")
|
|
321
|
330
|
{
|