|
|
@@ -0,0 +1,583 @@
|
|
|
1
|
+using System;
|
|
|
2
|
+using System.Data;
|
|
|
3
|
+using System.Text;
|
|
|
4
|
+using System.Data.SqlClient;
|
|
|
5
|
+using CallCenterApi.DB;
|
|
|
6
|
+
|
|
|
7
|
+namespace CallCenterApi.DAL
|
|
|
8
|
+{
|
|
|
9
|
+ /// <summary>
|
|
|
10
|
+ /// 数据访问类:T_Wo_WorkOrderNew
|
|
|
11
|
+ /// </summary>
|
|
|
12
|
+ public partial class T_Wo_WorkOrderNew
|
|
|
13
|
+ {
|
|
|
14
|
+ public T_Wo_WorkOrderNew()
|
|
|
15
|
+ { }
|
|
|
16
|
+ #region BasicMethod
|
|
|
17
|
+
|
|
|
18
|
+
|
|
|
19
|
+
|
|
|
20
|
+ /// <summary>
|
|
|
21
|
+ /// 增加一条数据
|
|
|
22
|
+ /// </summary>
|
|
|
23
|
+ public int Add(CallCenterApi.Model.T_Wo_WorkOrderNew model)
|
|
|
24
|
+ {
|
|
|
25
|
+ StringBuilder strSql = new StringBuilder();
|
|
|
26
|
+ strSql.Append("insert into T_Wo_WorkOrderNew(");
|
|
|
27
|
+ strSql.Append("WorkOrderID,CustomerName,CustomerTel,Gender,Location,Reservation,IDnumber,Department,Expert,AppointmentTime,IsMedical,Project,TranDepartment,DriveoutTime,AboutcarMan,CarTel,Condition,IsCar,TreatmentAddress,ComplaintDepartment,ComplaintTarget,IsRelevant,Remarks,Problem,IsOver,DealContents,DealTime,F_State,Files,CreateTime,Createby,CallID,IsDelete,DelTime,TypeClass,DealBy)");
|
|
|
28
|
+ strSql.Append(" values (");
|
|
|
29
|
+ strSql.Append("@WorkOrderID,@CustomerName,@CustomerTel,@Gender,@Location,@Reservation,@IDnumber,@Department,@Expert,@AppointmentTime,@IsMedical,@Project,@TranDepartment,@DriveoutTime,@AboutcarMan,@CarTel,@Condition,@IsCar,@TreatmentAddress,@ComplaintDepartment,@ComplaintTarget,@IsRelevant,@Remarks,@Problem,@IsOver,@DealContents,@DealTime,@F_State,@Files,@CreateTime,@Createby,@CallID,@IsDelete,@DelTime,@TypeClass,@DealBy)");
|
|
|
30
|
+ strSql.Append(";select @@IDENTITY");
|
|
|
31
|
+ SqlParameter[] parameters = {
|
|
|
32
|
+
|
|
|
33
|
+ new SqlParameter("@WorkOrderID", SqlDbType.VarChar,-1),
|
|
|
34
|
+ new SqlParameter("@CustomerName", SqlDbType.VarChar,200),
|
|
|
35
|
+ new SqlParameter("@CustomerTel", SqlDbType.VarChar,200),
|
|
|
36
|
+ new SqlParameter("@Gender", SqlDbType.Int,4),
|
|
|
37
|
+ new SqlParameter("@Location", SqlDbType.VarChar,-1),
|
|
|
38
|
+ new SqlParameter("@Reservation", SqlDbType.VarChar,200),
|
|
|
39
|
+ new SqlParameter("@IDnumber", SqlDbType.VarChar,-1),
|
|
|
40
|
+ new SqlParameter("@Department", SqlDbType.VarChar,200),
|
|
|
41
|
+ new SqlParameter("@Expert", SqlDbType.VarChar,-1),
|
|
|
42
|
+ new SqlParameter("@AppointmentTime", SqlDbType.DateTime),
|
|
|
43
|
+ new SqlParameter("@IsMedical", SqlDbType.Int,4),
|
|
|
44
|
+ new SqlParameter("@Project", SqlDbType.VarChar,-1),
|
|
|
45
|
+ new SqlParameter("@TranDepartment", SqlDbType.VarChar,200),
|
|
|
46
|
+ new SqlParameter("@DriveoutTime", SqlDbType.DateTime),
|
|
|
47
|
+ new SqlParameter("@AboutcarMan", SqlDbType.VarChar,-1),
|
|
|
48
|
+ new SqlParameter("@CarTel", SqlDbType.VarChar,-1),
|
|
|
49
|
+ new SqlParameter("@Condition", SqlDbType.VarChar,-1),
|
|
|
50
|
+ new SqlParameter("@IsCar", SqlDbType.Int,4),
|
|
|
51
|
+ new SqlParameter("@TreatmentAddress", SqlDbType.VarChar,-1),
|
|
|
52
|
+ new SqlParameter("@ComplaintDepartment", SqlDbType.VarChar,200),
|
|
|
53
|
+ new SqlParameter("@ComplaintTarget", SqlDbType.VarChar,200),
|
|
|
54
|
+ new SqlParameter("@IsRelevant", SqlDbType.Int,4),
|
|
|
55
|
+ new SqlParameter("@Remarks", SqlDbType.VarChar,-1),
|
|
|
56
|
+ new SqlParameter("@Problem", SqlDbType.VarChar,-1),
|
|
|
57
|
+ new SqlParameter("@IsOver", SqlDbType.Int,4),
|
|
|
58
|
+ new SqlParameter("@DealContents", SqlDbType.VarChar,-1),
|
|
|
59
|
+ new SqlParameter("@DealTime", SqlDbType.DateTime),
|
|
|
60
|
+ new SqlParameter("@F_State", SqlDbType.Int,4),
|
|
|
61
|
+ new SqlParameter("@Files", SqlDbType.VarChar,-1),
|
|
|
62
|
+ new SqlParameter("@CreateTime", SqlDbType.DateTime),
|
|
|
63
|
+ new SqlParameter("@Createby", SqlDbType.VarChar,100),
|
|
|
64
|
+ new SqlParameter("@CallID", SqlDbType.VarChar,100),
|
|
|
65
|
+ new SqlParameter("@IsDelete", SqlDbType.Int,4),
|
|
|
66
|
+ new SqlParameter("@DelTime", SqlDbType.DateTime),
|
|
|
67
|
+ new SqlParameter("@TypeClass", SqlDbType.NVarChar,200),
|
|
|
68
|
+ new SqlParameter("@DealBy", SqlDbType.NVarChar,200)};
|
|
|
69
|
+ parameters[0].Value = model.WorkOrderID;
|
|
|
70
|
+ parameters[1].Value = model.CustomerName;
|
|
|
71
|
+ parameters[2].Value = model.CustomerTel;
|
|
|
72
|
+ parameters[3].Value = model.Gender;
|
|
|
73
|
+ parameters[4].Value = model.Location;
|
|
|
74
|
+ parameters[5].Value = model.Reservation;
|
|
|
75
|
+ parameters[6].Value = model.IDnumber;
|
|
|
76
|
+ parameters[7].Value = model.Department;
|
|
|
77
|
+ parameters[8].Value = model.Expert;
|
|
|
78
|
+ parameters[9].Value = model.AppointmentTime;
|
|
|
79
|
+ parameters[10].Value = model.IsMedical;
|
|
|
80
|
+ parameters[11].Value = model.Project;
|
|
|
81
|
+ parameters[12].Value = model.TranDepartment;
|
|
|
82
|
+ parameters[13].Value = model.DriveoutTime;
|
|
|
83
|
+ parameters[14].Value = model.AboutcarMan;
|
|
|
84
|
+ parameters[15].Value = model.CarTel;
|
|
|
85
|
+ parameters[16].Value = model.Condition;
|
|
|
86
|
+ parameters[17].Value = model.IsCar;
|
|
|
87
|
+ parameters[18].Value = model.TreatmentAddress;
|
|
|
88
|
+ parameters[19].Value = model.ComplaintDepartment;
|
|
|
89
|
+ parameters[20].Value = model.ComplaintTarget;
|
|
|
90
|
+ parameters[21].Value = model.IsRelevant;
|
|
|
91
|
+ parameters[22].Value = model.Remarks;
|
|
|
92
|
+ parameters[23].Value = model.Problem;
|
|
|
93
|
+ parameters[24].Value = model.IsOver;
|
|
|
94
|
+ parameters[25].Value = model.DealContents;
|
|
|
95
|
+ parameters[26].Value = model.DealTime;
|
|
|
96
|
+ parameters[27].Value = model.F_State;
|
|
|
97
|
+ parameters[28].Value = model.Files;
|
|
|
98
|
+ parameters[29].Value = model.CreateTime;
|
|
|
99
|
+ parameters[30].Value = model.Createby;
|
|
|
100
|
+ parameters[31].Value = model.CallID;
|
|
|
101
|
+ parameters[32].Value = model.IsDelete;
|
|
|
102
|
+ parameters[33].Value = model.DelTime;
|
|
|
103
|
+ parameters[34].Value = model.TypeClass;
|
|
|
104
|
+ parameters[35].Value = model.DealBy;
|
|
|
105
|
+ int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
|
|
|
106
|
+ return rows;
|
|
|
107
|
+
|
|
|
108
|
+ }
|
|
|
109
|
+ /// <summary>
|
|
|
110
|
+ /// 更新一条数据
|
|
|
111
|
+ /// </summary>
|
|
|
112
|
+ public bool Update(CallCenterApi.Model.T_Wo_WorkOrderNew model)
|
|
|
113
|
+ {
|
|
|
114
|
+ StringBuilder strSql = new StringBuilder();
|
|
|
115
|
+ strSql.Append("update T_Wo_WorkOrderNew set ");
|
|
|
116
|
+
|
|
|
117
|
+ strSql.Append("WorkOrderID=@WorkOrderID,");
|
|
|
118
|
+ strSql.Append("CustomerName=@CustomerName,");
|
|
|
119
|
+ strSql.Append("CustomerTel=@CustomerTel,");
|
|
|
120
|
+ strSql.Append("Gender=@Gender,");
|
|
|
121
|
+ strSql.Append("Location=@Location,");
|
|
|
122
|
+ strSql.Append("Reservation=@Reservation,");
|
|
|
123
|
+ strSql.Append("IDnumber=@IDnumber,");
|
|
|
124
|
+ strSql.Append("Department=@Department,");
|
|
|
125
|
+ strSql.Append("Expert=@Expert,");
|
|
|
126
|
+ strSql.Append("AppointmentTime=@AppointmentTime,");
|
|
|
127
|
+ strSql.Append("IsMedical=@IsMedical,");
|
|
|
128
|
+ strSql.Append("Project=@Project,");
|
|
|
129
|
+ strSql.Append("TranDepartment=@TranDepartment,");
|
|
|
130
|
+ strSql.Append("DriveoutTime=@DriveoutTime,");
|
|
|
131
|
+ strSql.Append("AboutcarMan=@AboutcarMan,");
|
|
|
132
|
+ strSql.Append("CarTel=@CarTel,");
|
|
|
133
|
+ strSql.Append("Condition=@Condition,");
|
|
|
134
|
+ strSql.Append("IsCar=@IsCar,");
|
|
|
135
|
+ strSql.Append("TreatmentAddress=@TreatmentAddress,");
|
|
|
136
|
+ strSql.Append("ComplaintDepartment=@ComplaintDepartment,");
|
|
|
137
|
+ strSql.Append("ComplaintTarget=@ComplaintTarget,");
|
|
|
138
|
+ strSql.Append("IsRelevant=@IsRelevant,");
|
|
|
139
|
+ strSql.Append("Remarks=@Remarks,");
|
|
|
140
|
+ strSql.Append("Problem=@Problem,");
|
|
|
141
|
+ strSql.Append("IsOver=@IsOver,");
|
|
|
142
|
+ strSql.Append("DealContents=@DealContents,");
|
|
|
143
|
+ strSql.Append("DealTime=@DealTime,");
|
|
|
144
|
+ strSql.Append("F_State=@F_State,");
|
|
|
145
|
+ strSql.Append("Files=@Files,");
|
|
|
146
|
+ strSql.Append("CreateTime=@CreateTime,");
|
|
|
147
|
+ strSql.Append("Createby=@Createby,");
|
|
|
148
|
+ strSql.Append("CallID=@CallID,");
|
|
|
149
|
+ strSql.Append("IsDelete=@IsDelete,");
|
|
|
150
|
+ strSql.Append("DelTime=@DelTime,");
|
|
|
151
|
+ strSql.Append("TypeClass=@TypeClass,");
|
|
|
152
|
+ strSql.Append("DealBy=@DealBy");
|
|
|
153
|
+ strSql.Append(" where ID=@ID");
|
|
|
154
|
+ SqlParameter[] parameters = {
|
|
|
155
|
+
|
|
|
156
|
+ new SqlParameter("@WorkOrderID", SqlDbType.VarChar,-1),
|
|
|
157
|
+ new SqlParameter("@CustomerName", SqlDbType.VarChar,200),
|
|
|
158
|
+ new SqlParameter("@CustomerTel", SqlDbType.VarChar,200),
|
|
|
159
|
+ new SqlParameter("@Gender", SqlDbType.Int,4),
|
|
|
160
|
+ new SqlParameter("@Location", SqlDbType.VarChar,-1),
|
|
|
161
|
+ new SqlParameter("@Reservation", SqlDbType.VarChar,200),
|
|
|
162
|
+ new SqlParameter("@IDnumber", SqlDbType.VarChar,-1),
|
|
|
163
|
+ new SqlParameter("@Department", SqlDbType.VarChar,200),
|
|
|
164
|
+ new SqlParameter("@Expert", SqlDbType.VarChar,-1),
|
|
|
165
|
+ new SqlParameter("@AppointmentTime", SqlDbType.DateTime),
|
|
|
166
|
+ new SqlParameter("@IsMedical", SqlDbType.Int,4),
|
|
|
167
|
+ new SqlParameter("@Project", SqlDbType.VarChar,-1),
|
|
|
168
|
+ new SqlParameter("@TranDepartment", SqlDbType.VarChar,200),
|
|
|
169
|
+ new SqlParameter("@DriveoutTime", SqlDbType.DateTime),
|
|
|
170
|
+ new SqlParameter("@AboutcarMan", SqlDbType.VarChar,-1),
|
|
|
171
|
+ new SqlParameter("@CarTel", SqlDbType.VarChar,-1),
|
|
|
172
|
+ new SqlParameter("@Condition", SqlDbType.VarChar,-1),
|
|
|
173
|
+ new SqlParameter("@IsCar", SqlDbType.Int,4),
|
|
|
174
|
+ new SqlParameter("@TreatmentAddress", SqlDbType.VarChar,-1),
|
|
|
175
|
+ new SqlParameter("@ComplaintDepartment", SqlDbType.VarChar,200),
|
|
|
176
|
+ new SqlParameter("@ComplaintTarget", SqlDbType.VarChar,200),
|
|
|
177
|
+ new SqlParameter("@IsRelevant", SqlDbType.Int,4),
|
|
|
178
|
+ new SqlParameter("@Remarks", SqlDbType.VarChar,-1),
|
|
|
179
|
+ new SqlParameter("@Problem", SqlDbType.VarChar,-1),
|
|
|
180
|
+ new SqlParameter("@IsOver", SqlDbType.Int,4),
|
|
|
181
|
+ new SqlParameter("@DealContents", SqlDbType.VarChar,-1),
|
|
|
182
|
+ new SqlParameter("@DealTime", SqlDbType.DateTime),
|
|
|
183
|
+ new SqlParameter("@F_State", SqlDbType.Int,4),
|
|
|
184
|
+ new SqlParameter("@Files", SqlDbType.VarChar,-1),
|
|
|
185
|
+ new SqlParameter("@CreateTime", SqlDbType.DateTime),
|
|
|
186
|
+ new SqlParameter("@Createby", SqlDbType.VarChar,100),
|
|
|
187
|
+ new SqlParameter("@CallID", SqlDbType.VarChar,100),
|
|
|
188
|
+ new SqlParameter("@IsDelete", SqlDbType.Int,4),
|
|
|
189
|
+ new SqlParameter("@DelTime", SqlDbType.DateTime),
|
|
|
190
|
+ new SqlParameter("@TypeClass", SqlDbType.NVarChar,200),
|
|
|
191
|
+ new SqlParameter("@DealBy", SqlDbType.NVarChar,200),
|
|
|
192
|
+ new SqlParameter("@ID", SqlDbType.BigInt,8)};
|
|
|
193
|
+
|
|
|
194
|
+ parameters[0].Value = model.WorkOrderID;
|
|
|
195
|
+ parameters[1].Value = model.CustomerName;
|
|
|
196
|
+ parameters[2].Value = model.CustomerTel;
|
|
|
197
|
+ parameters[3].Value = model.Gender;
|
|
|
198
|
+ parameters[4].Value = model.Location;
|
|
|
199
|
+ parameters[5].Value = model.Reservation;
|
|
|
200
|
+ parameters[6].Value = model.IDnumber;
|
|
|
201
|
+ parameters[7].Value = model.Department;
|
|
|
202
|
+ parameters[8].Value = model.Expert;
|
|
|
203
|
+ parameters[9].Value = model.AppointmentTime;
|
|
|
204
|
+ parameters[10].Value = model.IsMedical;
|
|
|
205
|
+ parameters[11].Value = model.Project;
|
|
|
206
|
+ parameters[12].Value = model.TranDepartment;
|
|
|
207
|
+ parameters[13].Value = model.DriveoutTime;
|
|
|
208
|
+ parameters[14].Value = model.AboutcarMan;
|
|
|
209
|
+ parameters[15].Value = model.CarTel;
|
|
|
210
|
+ parameters[16].Value = model.Condition;
|
|
|
211
|
+ parameters[17].Value = model.IsCar;
|
|
|
212
|
+ parameters[18].Value = model.TreatmentAddress;
|
|
|
213
|
+ parameters[19].Value = model.ComplaintDepartment;
|
|
|
214
|
+ parameters[20].Value = model.ComplaintTarget;
|
|
|
215
|
+ parameters[21].Value = model.IsRelevant;
|
|
|
216
|
+ parameters[22].Value = model.Remarks;
|
|
|
217
|
+ parameters[23].Value = model.Problem;
|
|
|
218
|
+ parameters[24].Value = model.IsOver;
|
|
|
219
|
+ parameters[25].Value = model.DealContents;
|
|
|
220
|
+ parameters[26].Value = model.DealTime;
|
|
|
221
|
+ parameters[27].Value = model.F_State;
|
|
|
222
|
+ parameters[28].Value = model.Files;
|
|
|
223
|
+ parameters[29].Value = model.CreateTime;
|
|
|
224
|
+ parameters[30].Value = model.Createby;
|
|
|
225
|
+ parameters[31].Value = model.CallID;
|
|
|
226
|
+ parameters[32].Value = model.IsDelete;
|
|
|
227
|
+ parameters[33].Value = model.DelTime;
|
|
|
228
|
+ parameters[34].Value = model.TypeClass;
|
|
|
229
|
+ parameters[35].Value = model.DealBy;
|
|
|
230
|
+ parameters[36].Value = model.ID;
|
|
|
231
|
+ int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
|
|
|
232
|
+ if (rows > 0)
|
|
|
233
|
+ {
|
|
|
234
|
+ return true;
|
|
|
235
|
+ }
|
|
|
236
|
+ else
|
|
|
237
|
+ {
|
|
|
238
|
+ return false;
|
|
|
239
|
+ }
|
|
|
240
|
+ }
|
|
|
241
|
+
|
|
|
242
|
+ /// <summary>
|
|
|
243
|
+ /// 删除一条数据
|
|
|
244
|
+ /// </summary>
|
|
|
245
|
+ public bool Delete()
|
|
|
246
|
+ {
|
|
|
247
|
+ //该表无主键信息,请自定义主键/条件字段
|
|
|
248
|
+ StringBuilder strSql = new StringBuilder();
|
|
|
249
|
+ strSql.Append("delete from T_Wo_WorkOrderNew ");
|
|
|
250
|
+ strSql.Append(" where ");
|
|
|
251
|
+ SqlParameter[] parameters = {
|
|
|
252
|
+ };
|
|
|
253
|
+
|
|
|
254
|
+ int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
|
|
|
255
|
+ if (rows > 0)
|
|
|
256
|
+ {
|
|
|
257
|
+ return true;
|
|
|
258
|
+ }
|
|
|
259
|
+ else
|
|
|
260
|
+ {
|
|
|
261
|
+ return false;
|
|
|
262
|
+ }
|
|
|
263
|
+ }
|
|
|
264
|
+ /// <summary>
|
|
|
265
|
+ /// 批量删除数据
|
|
|
266
|
+ /// </summary>
|
|
|
267
|
+ public bool DeleteList(string IDlist)
|
|
|
268
|
+ {
|
|
|
269
|
+ StringBuilder strSql = new StringBuilder();
|
|
|
270
|
+ strSql.Append("update T_Wo_WorkOrderNew set IsDelete=1 ");
|
|
|
271
|
+ // strSql.Append("delete from T_Wo_WorkOrder ");
|
|
|
272
|
+ strSql.Append(" where ID in (" + IDlist + ") ");
|
|
|
273
|
+ int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
|
|
|
274
|
+ if (rows > 0)
|
|
|
275
|
+ {
|
|
|
276
|
+ return true;
|
|
|
277
|
+ }
|
|
|
278
|
+ else
|
|
|
279
|
+ {
|
|
|
280
|
+ return false;
|
|
|
281
|
+ }
|
|
|
282
|
+ }
|
|
|
283
|
+
|
|
|
284
|
+ /// <summary>
|
|
|
285
|
+ /// 得到一个对象实体
|
|
|
286
|
+ /// </summary>
|
|
|
287
|
+ public CallCenterApi.Model.T_Wo_WorkOrderNew GetModel(long ID)
|
|
|
288
|
+ {
|
|
|
289
|
+ //该表无主键信息,请自定义主键/条件字段
|
|
|
290
|
+ StringBuilder strSql = new StringBuilder();
|
|
|
291
|
+ strSql.Append("select top 1 ID,WorkOrderID,CustomerName,CustomerTel,Gender,Location,Reservation,IDnumber,Department,Expert,AppointmentTime,IsMedical,Project,TranDepartment,DriveoutTime,AboutcarMan,CarTel,Condition,IsCar,TreatmentAddress,ComplaintDepartment,ComplaintTarget,IsRelevant,Remarks,Problem,IsOver,DealContents,DealTime,F_State,Files,CreateTime,Createby,CallID,IsDelete,DelTime,TypeClass,DealBy from T_Wo_WorkOrderNew ");
|
|
|
292
|
+ strSql.Append(" where ID=@ID");
|
|
|
293
|
+ SqlParameter[] parameters = {
|
|
|
294
|
+ new SqlParameter("@ID", SqlDbType.BigInt)
|
|
|
295
|
+ };
|
|
|
296
|
+ parameters[0].Value = ID;
|
|
|
297
|
+ CallCenterApi.Model.T_Wo_WorkOrderNew model = new CallCenterApi.Model.T_Wo_WorkOrderNew();
|
|
|
298
|
+ DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
|
|
|
299
|
+ if (ds.Tables[0].Rows.Count > 0)
|
|
|
300
|
+ {
|
|
|
301
|
+ return DataRowToModel(ds.Tables[0].Rows[0]);
|
|
|
302
|
+ }
|
|
|
303
|
+ else
|
|
|
304
|
+ {
|
|
|
305
|
+ return null;
|
|
|
306
|
+ }
|
|
|
307
|
+ }
|
|
|
308
|
+
|
|
|
309
|
+
|
|
|
310
|
+ /// <summary>
|
|
|
311
|
+ /// 得到一个对象实体
|
|
|
312
|
+ /// </summary>
|
|
|
313
|
+ public CallCenterApi.Model.T_Wo_WorkOrderNew DataRowToModel(DataRow row)
|
|
|
314
|
+ {
|
|
|
315
|
+ CallCenterApi.Model.T_Wo_WorkOrderNew model = new CallCenterApi.Model.T_Wo_WorkOrderNew();
|
|
|
316
|
+ if (row != null)
|
|
|
317
|
+ {
|
|
|
318
|
+ if (row["ID"] != null && row["ID"].ToString() != "")
|
|
|
319
|
+ {
|
|
|
320
|
+ model.ID = long.Parse(row["ID"].ToString());
|
|
|
321
|
+ }
|
|
|
322
|
+ if (row["WorkOrderID"] != null)
|
|
|
323
|
+ {
|
|
|
324
|
+ model.WorkOrderID = row["WorkOrderID"].ToString();
|
|
|
325
|
+ }
|
|
|
326
|
+ if (row["CustomerName"] != null)
|
|
|
327
|
+ {
|
|
|
328
|
+ model.CustomerName = row["CustomerName"].ToString();
|
|
|
329
|
+ }
|
|
|
330
|
+ if (row["CustomerTel"] != null)
|
|
|
331
|
+ {
|
|
|
332
|
+ model.CustomerTel = row["CustomerTel"].ToString();
|
|
|
333
|
+ }
|
|
|
334
|
+ if (row["Gender"] != null && row["Gender"].ToString() != "")
|
|
|
335
|
+ {
|
|
|
336
|
+ model.Gender = int.Parse(row["Gender"].ToString());
|
|
|
337
|
+ }
|
|
|
338
|
+ if (row["Location"] != null)
|
|
|
339
|
+ {
|
|
|
340
|
+ model.Location = row["Location"].ToString();
|
|
|
341
|
+ }
|
|
|
342
|
+ if (row["Reservation"] != null)
|
|
|
343
|
+ {
|
|
|
344
|
+ model.Reservation = row["Reservation"].ToString();
|
|
|
345
|
+ }
|
|
|
346
|
+ if (row["IDnumber"] != null)
|
|
|
347
|
+ {
|
|
|
348
|
+ model.IDnumber = row["IDnumber"].ToString();
|
|
|
349
|
+ }
|
|
|
350
|
+ if (row["Department"] != null)
|
|
|
351
|
+ {
|
|
|
352
|
+ model.Department = row["Department"].ToString();
|
|
|
353
|
+ }
|
|
|
354
|
+ if (row["Expert"] != null)
|
|
|
355
|
+ {
|
|
|
356
|
+ model.Expert = row["Expert"].ToString();
|
|
|
357
|
+ }
|
|
|
358
|
+ if (row["AppointmentTime"] != null && row["AppointmentTime"].ToString() != "")
|
|
|
359
|
+ {
|
|
|
360
|
+ model.AppointmentTime = DateTime.Parse(row["AppointmentTime"].ToString());
|
|
|
361
|
+ }
|
|
|
362
|
+ if (row["IsMedical"] != null && row["IsMedical"].ToString() != "")
|
|
|
363
|
+ {
|
|
|
364
|
+ model.IsMedical = int.Parse(row["IsMedical"].ToString());
|
|
|
365
|
+ }
|
|
|
366
|
+ if (row["Project"] != null)
|
|
|
367
|
+ {
|
|
|
368
|
+ model.Project = row["Project"].ToString();
|
|
|
369
|
+ }
|
|
|
370
|
+ if (row["TranDepartment"] != null)
|
|
|
371
|
+ {
|
|
|
372
|
+ model.TranDepartment = row["TranDepartment"].ToString();
|
|
|
373
|
+ }
|
|
|
374
|
+ if (row["DriveoutTime"] != null && row["DriveoutTime"].ToString() != "")
|
|
|
375
|
+ {
|
|
|
376
|
+ model.DriveoutTime = DateTime.Parse(row["DriveoutTime"].ToString());
|
|
|
377
|
+ }
|
|
|
378
|
+ if (row["AboutcarMan"] != null)
|
|
|
379
|
+ {
|
|
|
380
|
+ model.AboutcarMan = row["AboutcarMan"].ToString();
|
|
|
381
|
+ }
|
|
|
382
|
+ if (row["CarTel"] != null)
|
|
|
383
|
+ {
|
|
|
384
|
+ model.CarTel = row["CarTel"].ToString();
|
|
|
385
|
+ }
|
|
|
386
|
+ if (row["Condition"] != null)
|
|
|
387
|
+ {
|
|
|
388
|
+ model.Condition = row["Condition"].ToString();
|
|
|
389
|
+ }
|
|
|
390
|
+ if (row["IsCar"] != null && row["IsCar"].ToString() != "")
|
|
|
391
|
+ {
|
|
|
392
|
+ model.IsCar = int.Parse(row["IsCar"].ToString());
|
|
|
393
|
+ }
|
|
|
394
|
+ if (row["TreatmentAddress"] != null)
|
|
|
395
|
+ {
|
|
|
396
|
+ model.TreatmentAddress = row["TreatmentAddress"].ToString();
|
|
|
397
|
+ }
|
|
|
398
|
+ if (row["ComplaintDepartment"] != null)
|
|
|
399
|
+ {
|
|
|
400
|
+ model.ComplaintDepartment = row["ComplaintDepartment"].ToString();
|
|
|
401
|
+ }
|
|
|
402
|
+ if (row["ComplaintTarget"] != null)
|
|
|
403
|
+ {
|
|
|
404
|
+ model.ComplaintTarget = row["ComplaintTarget"].ToString();
|
|
|
405
|
+ }
|
|
|
406
|
+ if (row["IsRelevant"] != null && row["IsRelevant"].ToString() != "")
|
|
|
407
|
+ {
|
|
|
408
|
+ model.IsRelevant = int.Parse(row["IsRelevant"].ToString());
|
|
|
409
|
+ }
|
|
|
410
|
+ if (row["Remarks"] != null)
|
|
|
411
|
+ {
|
|
|
412
|
+ model.Remarks = row["Remarks"].ToString();
|
|
|
413
|
+ }
|
|
|
414
|
+ if (row["Problem"] != null)
|
|
|
415
|
+ {
|
|
|
416
|
+ model.Problem = row["Problem"].ToString();
|
|
|
417
|
+ }
|
|
|
418
|
+ if (row["IsOver"] != null && row["IsOver"].ToString() != "")
|
|
|
419
|
+ {
|
|
|
420
|
+ model.IsOver = int.Parse(row["IsOver"].ToString());
|
|
|
421
|
+ }
|
|
|
422
|
+ if (row["DealContents"] != null)
|
|
|
423
|
+ {
|
|
|
424
|
+ model.DealContents = row["DealContents"].ToString();
|
|
|
425
|
+ }
|
|
|
426
|
+ if (row["DealTime"] != null && row["DealTime"].ToString() != "")
|
|
|
427
|
+ {
|
|
|
428
|
+ model.DealTime = DateTime.Parse(row["DealTime"].ToString());
|
|
|
429
|
+ }
|
|
|
430
|
+ if (row["F_State"] != null && row["F_State"].ToString() != "")
|
|
|
431
|
+ {
|
|
|
432
|
+ model.F_State = int.Parse(row["F_State"].ToString());
|
|
|
433
|
+ }
|
|
|
434
|
+ if (row["Files"] != null)
|
|
|
435
|
+ {
|
|
|
436
|
+ model.Files = row["Files"].ToString();
|
|
|
437
|
+ }
|
|
|
438
|
+ if (row["CreateTime"] != null && row["CreateTime"].ToString() != "")
|
|
|
439
|
+ {
|
|
|
440
|
+ model.CreateTime = DateTime.Parse(row["CreateTime"].ToString());
|
|
|
441
|
+ }
|
|
|
442
|
+ if (row["Createby"] != null)
|
|
|
443
|
+ {
|
|
|
444
|
+ model.Createby = row["Createby"].ToString();
|
|
|
445
|
+ }
|
|
|
446
|
+ if (row["CallID"] != null)
|
|
|
447
|
+ {
|
|
|
448
|
+ model.CallID = row["CallID"].ToString();
|
|
|
449
|
+ }
|
|
|
450
|
+ if (row["IsDelete"] != null && row["IsDelete"].ToString() != "")
|
|
|
451
|
+ {
|
|
|
452
|
+ model.IsDelete = int.Parse(row["IsDelete"].ToString());
|
|
|
453
|
+ }
|
|
|
454
|
+ if (row["DelTime"] != null && row["DelTime"].ToString() != "")
|
|
|
455
|
+ {
|
|
|
456
|
+ model.DelTime = DateTime.Parse(row["DelTime"].ToString());
|
|
|
457
|
+ }
|
|
|
458
|
+ if (row["TypeClass"] != null)
|
|
|
459
|
+ {
|
|
|
460
|
+ model.TypeClass = row["TypeClass"].ToString();
|
|
|
461
|
+ }
|
|
|
462
|
+ if (row["DealBy"] != null)
|
|
|
463
|
+ {
|
|
|
464
|
+ model.DealBy = row["DealBy"].ToString();
|
|
|
465
|
+ }
|
|
|
466
|
+ }
|
|
|
467
|
+ return model;
|
|
|
468
|
+ }
|
|
|
469
|
+
|
|
|
470
|
+ /// <summary>
|
|
|
471
|
+ /// 获得数据列表
|
|
|
472
|
+ /// </summary>
|
|
|
473
|
+ public DataSet GetList(string strWhere)
|
|
|
474
|
+ {
|
|
|
475
|
+ StringBuilder strSql = new StringBuilder();
|
|
|
476
|
+ strSql.Append("select ID,WorkOrderID,CustomerName,CustomerTel,Gender,Location,Reservation,IDnumber,Department,Expert,AppointmentTime,IsMedical,Project,TranDepartment,DriveoutTime,AboutcarMan,CarTel,Condition,IsCar,TreatmentAddress,ComplaintDepartment,ComplaintTarget,IsRelevant,Remarks,Problem,IsOver,DealContents,DealTime,F_State,Files,CreateTime,Createby,CallID,IsDelete,DelTime,TypeClass ");
|
|
|
477
|
+ strSql.Append(" FROM T_Wo_WorkOrderNew ");
|
|
|
478
|
+ if (strWhere.Trim() != "")
|
|
|
479
|
+ {
|
|
|
480
|
+ strSql.Append(" where " + strWhere);
|
|
|
481
|
+ }
|
|
|
482
|
+ return DbHelperSQL.Query(strSql.ToString());
|
|
|
483
|
+ }
|
|
|
484
|
+
|
|
|
485
|
+ /// <summary>
|
|
|
486
|
+ /// 获得前几行数据
|
|
|
487
|
+ /// </summary>
|
|
|
488
|
+ public DataSet GetList(int Top, string strWhere, string filedOrder)
|
|
|
489
|
+ {
|
|
|
490
|
+ StringBuilder strSql = new StringBuilder();
|
|
|
491
|
+ strSql.Append("select ");
|
|
|
492
|
+ if (Top > 0)
|
|
|
493
|
+ {
|
|
|
494
|
+ strSql.Append(" top " + Top.ToString());
|
|
|
495
|
+ }
|
|
|
496
|
+ strSql.Append(" ID,WorkOrderID,CustomerName,CustomerTel,Gender,Location,Reservation,IDnumber,Department,Expert,AppointmentTime,IsMedical,Project,TranDepartment,DriveoutTime,AboutcarMan,CarTel,Condition,IsCar,TreatmentAddress,ComplaintDepartment,ComplaintTarget,IsRelevant,Remarks,Problem,IsOver,DealContents,DealTime,F_State,Files,CreateTime,Createby,CallID,IsDelete,DelTime,TypeClass ");
|
|
|
497
|
+ strSql.Append(" FROM T_Wo_WorkOrderNew ");
|
|
|
498
|
+ if (strWhere.Trim() != "")
|
|
|
499
|
+ {
|
|
|
500
|
+ strSql.Append(" where " + strWhere);
|
|
|
501
|
+ }
|
|
|
502
|
+ strSql.Append(" order by " + filedOrder);
|
|
|
503
|
+ return DbHelperSQL.Query(strSql.ToString());
|
|
|
504
|
+ }
|
|
|
505
|
+
|
|
|
506
|
+ /// <summary>
|
|
|
507
|
+ /// 获取记录总数
|
|
|
508
|
+ /// </summary>
|
|
|
509
|
+ public int GetRecordCount(string strWhere)
|
|
|
510
|
+ {
|
|
|
511
|
+ StringBuilder strSql = new StringBuilder();
|
|
|
512
|
+ strSql.Append("select count(1) FROM T_Wo_WorkOrderNew ");
|
|
|
513
|
+ if (strWhere.Trim() != "")
|
|
|
514
|
+ {
|
|
|
515
|
+ strSql.Append(" where " + strWhere);
|
|
|
516
|
+ }
|
|
|
517
|
+ object obj = DbHelperSQL.GetSingle(strSql.ToString());
|
|
|
518
|
+ if (obj == null)
|
|
|
519
|
+ {
|
|
|
520
|
+ return 0;
|
|
|
521
|
+ }
|
|
|
522
|
+ else
|
|
|
523
|
+ {
|
|
|
524
|
+ return Convert.ToInt32(obj);
|
|
|
525
|
+ }
|
|
|
526
|
+ }
|
|
|
527
|
+ /// <summary>
|
|
|
528
|
+ /// 分页获取数据列表
|
|
|
529
|
+ /// </summary>
|
|
|
530
|
+ public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
|
|
|
531
|
+ {
|
|
|
532
|
+ StringBuilder strSql = new StringBuilder();
|
|
|
533
|
+ strSql.Append("SELECT * FROM ( ");
|
|
|
534
|
+ strSql.Append(" SELECT ROW_NUMBER() OVER (");
|
|
|
535
|
+ if (!string.IsNullOrEmpty(orderby.Trim()))
|
|
|
536
|
+ {
|
|
|
537
|
+ strSql.Append("order by T." + orderby);
|
|
|
538
|
+ }
|
|
|
539
|
+ else
|
|
|
540
|
+ {
|
|
|
541
|
+ strSql.Append("order by T. desc");
|
|
|
542
|
+ }
|
|
|
543
|
+ strSql.Append(")AS Row, T.* from T_Wo_WorkOrderNew T ");
|
|
|
544
|
+ if (!string.IsNullOrEmpty(strWhere.Trim()))
|
|
|
545
|
+ {
|
|
|
546
|
+ strSql.Append(" WHERE " + strWhere);
|
|
|
547
|
+ }
|
|
|
548
|
+ strSql.Append(" ) TT");
|
|
|
549
|
+ strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
|
|
|
550
|
+ return DbHelperSQL.Query(strSql.ToString());
|
|
|
551
|
+ }
|
|
|
552
|
+
|
|
|
553
|
+ /*
|
|
|
554
|
+ /// <summary>
|
|
|
555
|
+ /// 分页获取数据列表
|
|
|
556
|
+ /// </summary>
|
|
|
557
|
+ public DataSet GetList(int PageSize,int PageIndex,string strWhere)
|
|
|
558
|
+ {
|
|
|
559
|
+ SqlParameter[] parameters = {
|
|
|
560
|
+ new SqlParameter("@tblName", SqlDbType.VarChar, 255),
|
|
|
561
|
+ new SqlParameter("@fldName", SqlDbType.VarChar, 255),
|
|
|
562
|
+ new SqlParameter("@PageSize", SqlDbType.Int),
|
|
|
563
|
+ new SqlParameter("@PageIndex", SqlDbType.Int),
|
|
|
564
|
+ new SqlParameter("@IsReCount", SqlDbType.Bit),
|
|
|
565
|
+ new SqlParameter("@OrderType", SqlDbType.Bit),
|
|
|
566
|
+ new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
|
|
|
567
|
+ };
|
|
|
568
|
+ parameters[0].Value = "T_Wo_WorkOrderNew";
|
|
|
569
|
+ parameters[1].Value = "";
|
|
|
570
|
+ parameters[2].Value = PageSize;
|
|
|
571
|
+ parameters[3].Value = PageIndex;
|
|
|
572
|
+ parameters[4].Value = 0;
|
|
|
573
|
+ parameters[5].Value = 0;
|
|
|
574
|
+ parameters[6].Value = strWhere;
|
|
|
575
|
+ return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
|
|
|
576
|
+ }*/
|
|
|
577
|
+
|
|
|
578
|
+ #endregion BasicMethod
|
|
|
579
|
+ #region ExtensionMethod
|
|
|
580
|
+
|
|
|
581
|
+ #endregion ExtensionMethod
|
|
|
582
|
+ }
|
|
|
583
|
+}
|