|
|
@@ -32,15 +32,15 @@ namespace CallCenterApi.DAL
|
|
32
|
32
|
|
|
33
|
33
|
|
|
34
|
34
|
/// <summary>
|
|
35
|
|
- /// 增加一条数据
|
|
36
|
|
- /// </summary>
|
|
37
|
|
- public int Add(CallCenterApi.Model.T_Sys_Department model)
|
|
|
35
|
+ /// 增加一条数据
|
|
|
36
|
+ /// </summary>
|
|
|
37
|
+ public int Add(CallCenterApi.Model.T_Sys_Department model)
|
|
38
|
38
|
{
|
|
39
|
39
|
StringBuilder strSql = new StringBuilder();
|
|
40
|
40
|
strSql.Append("insert into T_Sys_Department(");
|
|
41
|
|
- strSql.Append("F_DeptName,F_DeptNameSpell,F_DeptNameSpells,F_DeptPhone,F_DeptPhone2,F_DeptTelphone,F_PartentId,F_layer,F_Sort,F_Type,F_Address,F_Remark,F_LeaderUser,F_LeaderUserName,F_TopSplitUser,F_TopSplitUserName,F_TopLeaderUser,F_TopLeaderUserName,F_State,F_CreateUser,F_CreateDate,F_IsDept)");
|
|
|
41
|
+ strSql.Append("F_DeptName,F_DeptNameSpell,F_DeptNameSpells,F_DeptPhone,F_DeptPhone2,F_DeptTelphone,F_PartentId,F_layer,F_Sort,F_Type,F_Address,F_Remark,F_LeaderUser,F_LeaderUserName,F_TopSplitUser,F_TopSplitUserName,F_TopLeaderUser,F_TopLeaderUserName,F_State,F_CreateUser,F_CreateDate,F_IsDept,F_IsDealDept)");
|
|
42
|
42
|
strSql.Append(" values (");
|
|
43
|
|
- strSql.Append("@F_DeptName,@F_DeptNameSpell,@F_DeptNameSpells,@F_DeptPhone,@F_DeptPhone2,@F_DeptTelphone,@F_PartentId,@F_layer,@F_Sort,@F_Type,@F_Address,@F_Remark,@F_LeaderUser,@F_LeaderUserName,@F_TopSplitUser,@F_TopSplitUserName,@F_TopLeaderUser,@F_TopLeaderUserName,@F_State,@F_CreateUser,@F_CreateDate,@F_IsDept)");
|
|
|
43
|
+ strSql.Append("@F_DeptName,@F_DeptNameSpell,@F_DeptNameSpells,@F_DeptPhone,@F_DeptPhone2,@F_DeptTelphone,@F_PartentId,@F_layer,@F_Sort,@F_Type,@F_Address,@F_Remark,@F_LeaderUser,@F_LeaderUserName,@F_TopSplitUser,@F_TopSplitUserName,@F_TopLeaderUser,@F_TopLeaderUserName,@F_State,@F_CreateUser,@F_CreateDate,@F_IsDept,@F_IsDealDept)");
|
|
44
|
44
|
strSql.Append(";select @@IDENTITY");
|
|
45
|
45
|
SqlParameter[] parameters = {
|
|
46
|
46
|
new SqlParameter("@F_DeptName", SqlDbType.NVarChar,100),
|
|
|
@@ -64,7 +64,8 @@ namespace CallCenterApi.DAL
|
|
64
|
64
|
new SqlParameter("@F_State", SqlDbType.Int,4),
|
|
65
|
65
|
new SqlParameter("@F_CreateUser", SqlDbType.VarChar,50),
|
|
66
|
66
|
new SqlParameter("@F_CreateDate", SqlDbType.DateTime),
|
|
67
|
|
- new SqlParameter("@F_IsDept", SqlDbType.Int,4)};
|
|
|
67
|
+ new SqlParameter("@F_IsDept", SqlDbType.Int,4),
|
|
|
68
|
+ new SqlParameter("@F_IsDealDept", SqlDbType.Int,4)};
|
|
68
|
69
|
parameters[0].Value = model.F_DeptName;
|
|
69
|
70
|
parameters[1].Value = model.F_DeptNameSpell;
|
|
70
|
71
|
parameters[2].Value = model.F_DeptNameSpells;
|
|
|
@@ -87,6 +88,7 @@ namespace CallCenterApi.DAL
|
|
87
|
88
|
parameters[19].Value = model.F_CreateUser;
|
|
88
|
89
|
parameters[20].Value = model.F_CreateDate;
|
|
89
|
90
|
parameters[21].Value = model.F_IsDept;
|
|
|
91
|
+ parameters[22].Value = model.F_IsDealDept;
|
|
90
|
92
|
|
|
91
|
93
|
object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
|
|
92
|
94
|
if (obj == null)
|
|
|
@@ -126,7 +128,8 @@ namespace CallCenterApi.DAL
|
|
126
|
128
|
strSql.Append("F_State=@F_State,");
|
|
127
|
129
|
strSql.Append("F_CreateUser=@F_CreateUser,");
|
|
128
|
130
|
strSql.Append("F_CreateDate=@F_CreateDate,");
|
|
129
|
|
- strSql.Append("F_IsDept=@F_IsDept");
|
|
|
131
|
+ strSql.Append("F_IsDept=@F_IsDept,");
|
|
|
132
|
+ strSql.Append("F_IsDealDept=@F_IsDealDept");
|
|
130
|
133
|
strSql.Append(" where F_DeptId=@F_DeptId");
|
|
131
|
134
|
SqlParameter[] parameters = {
|
|
132
|
135
|
new SqlParameter("@F_DeptName", SqlDbType.NVarChar,100),
|
|
|
@@ -151,6 +154,7 @@ namespace CallCenterApi.DAL
|
|
151
|
154
|
new SqlParameter("@F_CreateUser", SqlDbType.VarChar,50),
|
|
152
|
155
|
new SqlParameter("@F_CreateDate", SqlDbType.DateTime),
|
|
153
|
156
|
new SqlParameter("@F_IsDept", SqlDbType.Int,4),
|
|
|
157
|
+ new SqlParameter("@F_IsDealDept", SqlDbType.Int,4),
|
|
154
|
158
|
new SqlParameter("@F_DeptId", SqlDbType.Int,4)};
|
|
155
|
159
|
parameters[0].Value = model.F_DeptName;
|
|
156
|
160
|
parameters[1].Value = model.F_DeptNameSpell;
|
|
|
@@ -174,7 +178,8 @@ namespace CallCenterApi.DAL
|
|
174
|
178
|
parameters[19].Value = model.F_CreateUser;
|
|
175
|
179
|
parameters[20].Value = model.F_CreateDate;
|
|
176
|
180
|
parameters[21].Value = model.F_IsDept;
|
|
177
|
|
- parameters[22].Value = model.F_DeptId;
|
|
|
181
|
+ parameters[22].Value = model.F_IsDealDept;
|
|
|
182
|
+ parameters[23].Value = model.F_DeptId;
|
|
178
|
183
|
|
|
179
|
184
|
int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
|
|
180
|
185
|
if (rows > 0)
|
|
|
@@ -238,7 +243,7 @@ namespace CallCenterApi.DAL
|
|
238
|
243
|
{
|
|
239
|
244
|
|
|
240
|
245
|
StringBuilder strSql = new StringBuilder();
|
|
241
|
|
- strSql.Append("select top 1 * from T_Sys_Department ");
|
|
|
246
|
+ strSql.Append("select top 1 F_DeptId,F_DeptName,F_DeptNameSpell,F_DeptNameSpells,F_DeptPhone,F_DeptPhone2,F_DeptTelphone,F_PartentId,F_layer,F_Sort,F_Type,F_Address,F_Remark,F_LeaderUser,F_LeaderUserName,F_TopSplitUser,F_TopSplitUserName,F_TopLeaderUser,F_TopLeaderUserName,F_State,F_CreateUser,F_CreateDate,F_IsDept,F_IsDealDept from T_Sys_Department ");
|
|
242
|
247
|
strSql.Append(" where F_DeptId=@F_DeptId");
|
|
243
|
248
|
SqlParameter[] parameters = {
|
|
244
|
249
|
new SqlParameter("@F_DeptId", SqlDbType.Int,4)
|
|
|
@@ -259,9 +264,9 @@ namespace CallCenterApi.DAL
|
|
259
|
264
|
|
|
260
|
265
|
|
|
261
|
266
|
/// <summary>
|
|
262
|
|
- /// 得到一个对象实体
|
|
263
|
|
- /// </summary>
|
|
264
|
|
- public CallCenterApi.Model.T_Sys_Department DataRowToModel(DataRow row)
|
|
|
267
|
+ /// 得到一个对象实体
|
|
|
268
|
+ /// </summary>
|
|
|
269
|
+ public CallCenterApi.Model.T_Sys_Department DataRowToModel(DataRow row)
|
|
265
|
270
|
{
|
|
266
|
271
|
CallCenterApi.Model.T_Sys_Department model = new CallCenterApi.Model.T_Sys_Department();
|
|
267
|
272
|
if (row != null)
|
|
|
@@ -358,6 +363,10 @@ namespace CallCenterApi.DAL
|
|
358
|
363
|
{
|
|
359
|
364
|
model.F_IsDept = int.Parse(row["F_IsDept"].ToString());
|
|
360
|
365
|
}
|
|
|
366
|
+ if (row["F_IsDealDept"] != null && row["F_IsDealDept"].ToString() != "")
|
|
|
367
|
+ {
|
|
|
368
|
+ model.F_IsDealDept = int.Parse(row["F_IsDealDept"].ToString());
|
|
|
369
|
+ }
|
|
361
|
370
|
}
|
|
362
|
371
|
return model;
|
|
363
|
372
|
}
|
|
|
@@ -368,7 +377,8 @@ namespace CallCenterApi.DAL
|
|
368
|
377
|
public DataSet GetList(string strWhere)
|
|
369
|
378
|
{
|
|
370
|
379
|
StringBuilder strSql = new StringBuilder();
|
|
371
|
|
- strSql.Append("select * FROM T_Sys_Department ");
|
|
|
380
|
+ strSql.Append("select F_DeptId,F_DeptName,F_DeptNameSpell,F_DeptNameSpells,F_DeptPhone,F_DeptPhone2,F_DeptTelphone,F_PartentId,F_layer,F_Sort,F_Type,F_Address,F_Remark,F_LeaderUser,F_LeaderUserName,F_TopSplitUser,F_TopSplitUserName,F_TopLeaderUser,F_TopLeaderUserName,F_State,F_CreateUser,F_CreateDate,F_IsDept,F_IsDealDept ");
|
|
|
381
|
+ strSql.Append(" FROM T_Sys_Department ");
|
|
372
|
382
|
if (strWhere.Trim() != "")
|
|
373
|
383
|
{
|
|
374
|
384
|
strSql.Append(" where " + strWhere);
|
|
|
@@ -387,8 +397,8 @@ namespace CallCenterApi.DAL
|
|
387
|
397
|
{
|
|
388
|
398
|
strSql.Append(" top " + Top.ToString());
|
|
389
|
399
|
}
|
|
390
|
|
-
|
|
391
|
|
- strSql.Append(" * FROM T_Sys_Department ");
|
|
|
400
|
+ strSql.Append(" F_DeptId,F_DeptName,F_DeptNameSpell,F_DeptNameSpells,F_DeptPhone,F_DeptPhone2,F_DeptTelphone,F_PartentId,F_layer,F_Sort,F_Type,F_Address,F_Remark,F_LeaderUser,F_LeaderUserName,F_TopSplitUser,F_TopSplitUserName,F_TopLeaderUser,F_TopLeaderUserName,F_State,F_CreateUser,F_CreateDate,F_IsDept,F_IsDealDept ");
|
|
|
401
|
+ strSql.Append(" FROM T_Sys_Department ");
|
|
392
|
402
|
if (strWhere.Trim() != "")
|
|
393
|
403
|
{
|
|
394
|
404
|
strSql.Append(" where " + strWhere);
|