zhupei %!s(int64=4) %!d(string=hace) años
padre
commit
cbca96b4e2

+ 2 - 0
RMYY_CallCenter_Api.Bll/RMYY_CallCenter_Api.Bll.csproj

@@ -53,6 +53,8 @@
53 53
     <Compile Include="T_Dev_Operate.cs" />
54 54
     <Compile Include="T_Dev_WorkOrder.cs" />
55 55
     <Compile Include="T_Dev_WorkOrderItem.cs" />
56
+    <Compile Include="T_Dis_WorkOrder.cs" />
57
+    <Compile Include="T_Dis_WorkOrderItem.cs" />
56 58
     <Compile Include="T_Hos_WorkOrder.cs" />
57 59
     <Compile Include="T_Hos_WorkOrderItem.cs" />
58 60
     <Compile Include="T_Mat_WorkOrder.cs" />

+ 147 - 0
RMYY_CallCenter_Api.Bll/T_Dis_WorkOrder.cs

@@ -0,0 +1,147 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Data;
4
+using System.Linq;
5
+using System.Text;
6
+using System.Threading.Tasks;
7
+
8
+namespace RMYY_CallCenter_Api.Bll
9
+{
10
+    /// <summary>
11
+    /// T_Dis_WorkOrder
12
+    /// </summary>
13
+    public partial class T_Dis_WorkOrder
14
+    {
15
+        private readonly RMYY_CallCenter_Api.Dal.T_Dis_WorkOrder dal = new RMYY_CallCenter_Api.Dal.T_Dis_WorkOrder();
16
+        public T_Dis_WorkOrder()
17
+        { }
18
+        #region  BasicMethod
19
+        /// <summary>
20
+        /// 是否存在该记录
21
+        /// </summary>
22
+        public bool Exists(int F_Id)
23
+        {
24
+            return dal.Exists(F_Id);
25
+        }
26
+
27
+        /// <summary>
28
+        /// 增加一条数据
29
+        /// </summary>
30
+        public int Add(RMYY_CallCenter_Api.Model.T_Dis_WorkOrder model)
31
+        {
32
+            return dal.Add(model);
33
+        }
34
+
35
+        /// <summary>
36
+        /// 更新一条数据
37
+        /// </summary>
38
+        public bool Update(RMYY_CallCenter_Api.Model.T_Dis_WorkOrder model)
39
+        {
40
+            return dal.Update(model);
41
+        }
42
+
43
+        /// <summary>
44
+        /// 删除一条数据
45
+        /// </summary>
46
+        public bool Delete(int F_Id)
47
+        {
48
+
49
+            return dal.Delete(F_Id);
50
+        }
51
+        /// <summary>
52
+        /// 删除一条数据
53
+        /// </summary>
54
+        public bool DeleteList(string F_Idlist)
55
+        {
56
+            return dal.DeleteList(F_Idlist);
57
+        }
58
+
59
+        /// <summary>
60
+        /// 得到一个对象实体
61
+        /// </summary>
62
+        public RMYY_CallCenter_Api.Model.T_Dis_WorkOrder GetModel(int F_Id)
63
+        {
64
+
65
+            return dal.GetModel(F_Id);
66
+        }
67
+
68
+        /// <summary>
69
+        /// 获得数据列表
70
+        /// </summary>
71
+        public DataSet GetList(string strWhere)
72
+        {
73
+            return dal.GetList(strWhere);
74
+        }
75
+        /// <summary>
76
+        /// 获得前几行数据
77
+        /// </summary>
78
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
79
+        {
80
+            return dal.GetList(Top, strWhere, filedOrder);
81
+        }
82
+        /// <summary>
83
+        /// 获得数据列表
84
+        /// </summary>
85
+        public List<RMYY_CallCenter_Api.Model.T_Dis_WorkOrder> GetModelList(string strWhere)
86
+        {
87
+            DataSet ds = dal.GetList(strWhere);
88
+            return DataTableToList(ds.Tables[0]);
89
+        }
90
+        /// <summary>
91
+        /// 获得数据列表
92
+        /// </summary>
93
+        public List<RMYY_CallCenter_Api.Model.T_Dis_WorkOrder> DataTableToList(DataTable dt)
94
+        {
95
+            List<RMYY_CallCenter_Api.Model.T_Dis_WorkOrder> modelList = new List<RMYY_CallCenter_Api.Model.T_Dis_WorkOrder>();
96
+            int rowsCount = dt.Rows.Count;
97
+            if (rowsCount > 0)
98
+            {
99
+                RMYY_CallCenter_Api.Model.T_Dis_WorkOrder model;
100
+                for (int n = 0; n < rowsCount; n++)
101
+                {
102
+                    model = dal.DataRowToModel(dt.Rows[n]);
103
+                    if (model != null)
104
+                    {
105
+                        modelList.Add(model);
106
+                    }
107
+                }
108
+            }
109
+            return modelList;
110
+        }
111
+
112
+        /// <summary>
113
+        /// 获得数据列表
114
+        /// </summary>
115
+        public DataSet GetAllList()
116
+        {
117
+            return GetList("");
118
+        }
119
+
120
+        /// <summary>
121
+        /// 分页获取数据列表
122
+        /// </summary>
123
+        public int GetRecordCount(string strWhere)
124
+        {
125
+            return dal.GetRecordCount(strWhere);
126
+        }
127
+        /// <summary>
128
+        /// 分页获取数据列表
129
+        /// </summary>
130
+        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
131
+        {
132
+            return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
133
+        }
134
+        /// <summary>
135
+        /// 分页获取数据列表
136
+        /// </summary>
137
+        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
138
+        //{
139
+        //return dal.GetList(PageSize,PageIndex,strWhere);
140
+        //}
141
+
142
+        #endregion  BasicMethod
143
+        #region  ExtensionMethod
144
+
145
+        #endregion  ExtensionMethod
146
+    }
147
+}

+ 140 - 0
RMYY_CallCenter_Api.Bll/T_Dis_WorkOrderItem.cs

@@ -0,0 +1,140 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Data;
4
+using System.Linq;
5
+using System.Text;
6
+using System.Threading.Tasks;
7
+
8
+namespace RMYY_CallCenter_Api.Bll
9
+{
10
+    /// <summary>
11
+    /// T_Dis_WorkOrderItem
12
+    /// </summary>
13
+    public partial class T_Dis_WorkOrderItem
14
+    {
15
+        private readonly RMYY_CallCenter_Api.Dal.T_Dis_WorkOrderItem dal = new RMYY_CallCenter_Api.Dal.T_Dis_WorkOrderItem();
16
+        public T_Dis_WorkOrderItem()
17
+        { }
18
+        #region  BasicMethod
19
+        /// <summary>
20
+        /// 是否存在该记录
21
+        /// </summary>
22
+        public bool Exists(long F_ID)
23
+        {
24
+            return dal.Exists(F_ID);
25
+        }
26
+
27
+        /// <summary>
28
+        /// 增加一条数据
29
+        /// </summary>
30
+        public long Add(RMYY_CallCenter_Api.Model.T_Dis_WorkOrderItem model)
31
+        {
32
+            return dal.Add(model);
33
+        }
34
+
35
+        /// <summary>
36
+        /// 更新一条数据
37
+        /// </summary>
38
+        public bool Update(RMYY_CallCenter_Api.Model.T_Dis_WorkOrderItem model)
39
+        {
40
+            return dal.Update(model);
41
+        }
42
+
43
+        /// <summary>
44
+        /// 删除一条数据
45
+        /// </summary>
46
+        public bool Delete(long F_ID)
47
+        {
48
+
49
+            return dal.Delete(F_ID);
50
+        }
51
+        /// <summary>
52
+        /// 删除一条数据
53
+        /// </summary>
54
+        public bool DeleteList(string F_IDlist)
55
+        {
56
+            return dal.DeleteList(F_IDlist);
57
+        }
58
+
59
+        /// <summary>
60
+        /// 得到一个对象实体
61
+        /// </summary>
62
+        public RMYY_CallCenter_Api.Model.T_Dis_WorkOrderItem GetModel(long F_ID)
63
+        {
64
+
65
+            return dal.GetModel(F_ID);
66
+        }
67
+
68
+        /// <summary>
69
+        /// 获得数据列表
70
+        /// </summary>
71
+        public DataSet GetList(string strWhere)
72
+        {
73
+            return dal.GetList(strWhere);
74
+        }
75
+        /// <summary>
76
+        /// 获得前几行数据
77
+        /// </summary>
78
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
79
+        {
80
+            return dal.GetList(Top, strWhere, filedOrder);
81
+        }
82
+        /// <summary>
83
+        /// 获得数据列表
84
+        /// </summary>
85
+        public List<RMYY_CallCenter_Api.Model.T_Dis_WorkOrderItem> GetModelList(string strWhere)
86
+        {
87
+            DataSet ds = dal.GetList(strWhere);
88
+            return DataTableToList(ds.Tables[0]);
89
+        }
90
+        /// <summary>
91
+        /// 获得数据列表
92
+        /// </summary>
93
+        public List<RMYY_CallCenter_Api.Model.T_Dis_WorkOrderItem> DataTableToList(DataTable dt)
94
+        {
95
+            List<RMYY_CallCenter_Api.Model.T_Dis_WorkOrderItem> modelList = new List<RMYY_CallCenter_Api.Model.T_Dis_WorkOrderItem>();
96
+            int rowsCount = dt.Rows.Count;
97
+            if (rowsCount > 0)
98
+            {
99
+                RMYY_CallCenter_Api.Model.T_Dis_WorkOrderItem model;
100
+                for (int n = 0; n < rowsCount; n++)
101
+                {
102
+                    model = dal.DataRowToModel(dt.Rows[n]);
103
+                    if (model != null)
104
+                    {
105
+                        modelList.Add(model);
106
+                    }
107
+                }
108
+            }
109
+            return modelList;
110
+        }
111
+
112
+        /// <summary>
113
+        /// 获得数据列表
114
+        /// </summary>
115
+        public DataSet GetAllList()
116
+        {
117
+            return GetList("");
118
+        }
119
+
120
+        /// <summary>
121
+        /// 分页获取数据列表
122
+        /// </summary>
123
+        public int GetRecordCount(string strWhere)
124
+        {
125
+            return dal.GetRecordCount(strWhere);
126
+        }
127
+        /// <summary>
128
+        /// 分页获取数据列表
129
+        /// </summary>
130
+        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
131
+        {
132
+            return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
133
+        }
134
+
135
+        #endregion  BasicMethod
136
+        #region  ExtensionMethod
137
+
138
+        #endregion  ExtensionMethod
139
+    }
140
+}

+ 2 - 0
RMYY_CallCenter_Api.Dal/RMYY_CallCenter_Api.Dal.csproj

@@ -53,6 +53,8 @@
53 53
     <Compile Include="T_Dev_Operate.cs" />
54 54
     <Compile Include="T_Dev_WorkOrder.cs" />
55 55
     <Compile Include="T_Dev_WorkOrderItem.cs" />
56
+    <Compile Include="T_Dis_WorkOrder.cs" />
57
+    <Compile Include="T_Dis_WorkOrderItem.cs" />
56 58
     <Compile Include="T_Hos_WorkOrder.cs" />
57 59
     <Compile Include="T_Hos_WorkOrderItem.cs" />
58 60
     <Compile Include="T_Mat_WorkOrder.cs" />

+ 519 - 0
RMYY_CallCenter_Api.Dal/T_Dis_WorkOrder.cs

@@ -0,0 +1,519 @@
1
+using RMYY_CallCenter_Api.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
+
10
+namespace RMYY_CallCenter_Api.Dal
11
+{
12
+    /// <summary>
13
+    /// 数据访问类:T_Dis_WorkOrder
14
+    /// </summary>
15
+    public partial class T_Dis_WorkOrder
16
+    {
17
+        public T_Dis_WorkOrder()
18
+        { }
19
+        #region  BasicMethod
20
+        /// <summary>
21
+        /// 是否存在该记录
22
+        /// </summary>
23
+        public bool Exists(int F_Id)
24
+        {
25
+            StringBuilder strSql = new StringBuilder();
26
+            strSql.Append("select count(1) from T_Dis_WorkOrder");
27
+            strSql.Append(" where F_Id=@F_Id");
28
+            SqlParameter[] parameters = {
29
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)
30
+            };
31
+            parameters[0].Value = F_Id;
32
+
33
+            return DbHelperSQL.Exists(strSql.ToString(), parameters);
34
+        }
35
+
36
+
37
+        /// <summary>
38
+        /// 增加一条数据
39
+        /// </summary>
40
+        public int Add(RMYY_CallCenter_Api.Model.T_Dis_WorkOrder model)
41
+        {
42
+            StringBuilder strSql = new StringBuilder();
43
+            strSql.Append("insert into T_Dis_WorkOrder(");
44
+            strSql.Append("F_Type,F_WorkOrderCode,F_ProposerDeptId,F_ProposerDeptName,F_ProposerCode,F_ProposerName,F_ProposerPhon,F_Source,F_CallID,F_DisNum,F_ItemMessages,F_ItemContents,F_Remark,F_CreateTime,F_CreateCode,F_CreateName,F_State,F_ControlManCode,F_ControlManName,F_TransPersonCode,F_TransPerson,F_BedPosition,F_SureMan,F_SureManName,F_SureManPhon,F_IsDel,F_DeleteBy,F_DeleteTime,F_FinishTime)");
45
+            strSql.Append(" values (");
46
+            strSql.Append("@F_Type,@F_WorkOrderCode,@F_ProposerDeptId,@F_ProposerDeptName,@F_ProposerCode,@F_ProposerName,@F_ProposerPhon,@F_Source,@F_CallID,@F_DisNum,@F_ItemMessages,@F_ItemContents,@F_Remark,@F_CreateTime,@F_CreateCode,@F_CreateName,@F_State,@F_ControlManCode,@F_ControlManName,@F_TransPersonCode,@F_TransPerson,@F_BedPosition,@F_SureMan,@F_SureManName,@F_SureManPhon,@F_IsDel,@F_DeleteBy,@F_DeleteTime,@F_FinishTime)");
47
+            strSql.Append(";select @@IDENTITY");
48
+            SqlParameter[] parameters = {
49
+                    new SqlParameter("@F_Type", SqlDbType.Int,4),
50
+                    new SqlParameter("@F_WorkOrderCode", SqlDbType.VarChar,50),
51
+                    new SqlParameter("@F_ProposerDeptId", SqlDbType.Int,4),
52
+                    new SqlParameter("@F_ProposerDeptName", SqlDbType.VarChar,50),
53
+                    new SqlParameter("@F_ProposerCode", SqlDbType.VarChar,50),
54
+                    new SqlParameter("@F_ProposerName", SqlDbType.VarChar,50),
55
+                    new SqlParameter("@F_ProposerPhon", SqlDbType.VarChar,20),
56
+                    new SqlParameter("@F_Source", SqlDbType.NVarChar,200),
57
+                    new SqlParameter("@F_CallID", SqlDbType.VarChar,50),
58
+                    new SqlParameter("@F_DisNum", SqlDbType.Int,4),
59
+                    new SqlParameter("@F_ItemMessages", SqlDbType.NText),
60
+                    new SqlParameter("@F_ItemContents", SqlDbType.NText),
61
+                    new SqlParameter("@F_Remark", SqlDbType.NText),
62
+                    new SqlParameter("@F_CreateTime", SqlDbType.DateTime),
63
+                    new SqlParameter("@F_CreateCode", SqlDbType.VarChar,50),
64
+                    new SqlParameter("@F_CreateName", SqlDbType.VarChar,50),
65
+                    new SqlParameter("@F_State", SqlDbType.Int,4),
66
+                    new SqlParameter("@F_ControlManCode", SqlDbType.VarChar,50),
67
+                    new SqlParameter("@F_ControlManName", SqlDbType.VarChar,50),
68
+                    new SqlParameter("@F_TransPersonCode", SqlDbType.NText),
69
+                    new SqlParameter("@F_TransPerson", SqlDbType.NText),
70
+                    new SqlParameter("@F_BedPosition", SqlDbType.VarChar,100),
71
+                    new SqlParameter("@F_SureMan", SqlDbType.VarChar,50),
72
+                    new SqlParameter("@F_SureManName", SqlDbType.VarChar,50),
73
+                    new SqlParameter("@F_SureManPhon", SqlDbType.VarChar,20),
74
+                    new SqlParameter("@F_IsDel", SqlDbType.Int,4),
75
+                    new SqlParameter("@F_DeleteBy", SqlDbType.VarChar,50),
76
+                    new SqlParameter("@F_DeleteTime", SqlDbType.DateTime),
77
+                    new SqlParameter("@F_FinishTime", SqlDbType.DateTime)};
78
+            parameters[0].Value = model.F_Type;
79
+            parameters[1].Value = model.F_WorkOrderCode;
80
+            parameters[2].Value = model.F_ProposerDeptId;
81
+            parameters[3].Value = model.F_ProposerDeptName;
82
+            parameters[4].Value = model.F_ProposerCode;
83
+            parameters[5].Value = model.F_ProposerName;
84
+            parameters[6].Value = model.F_ProposerPhon;
85
+            parameters[7].Value = model.F_Source;
86
+            parameters[8].Value = model.F_CallID;
87
+            parameters[9].Value = model.F_DisNum;
88
+            parameters[10].Value = model.F_ItemMessages;
89
+            parameters[11].Value = model.F_ItemContents;
90
+            parameters[12].Value = model.F_Remark;
91
+            parameters[13].Value = model.F_CreateTime;
92
+            parameters[14].Value = model.F_CreateCode;
93
+            parameters[15].Value = model.F_CreateName;
94
+            parameters[16].Value = model.F_State;
95
+            parameters[17].Value = model.F_ControlManCode;
96
+            parameters[18].Value = model.F_ControlManName;
97
+            parameters[19].Value = model.F_TransPersonCode;
98
+            parameters[20].Value = model.F_TransPerson;
99
+            parameters[21].Value = model.F_BedPosition;
100
+            parameters[22].Value = model.F_SureMan;
101
+            parameters[23].Value = model.F_SureManName;
102
+            parameters[24].Value = model.F_SureManPhon;
103
+            parameters[25].Value = model.F_IsDel;
104
+            parameters[26].Value = model.F_DeleteBy;
105
+            parameters[27].Value = model.F_DeleteTime;
106
+            parameters[28].Value = model.F_FinishTime;
107
+
108
+            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
109
+            if (obj == null)
110
+            {
111
+                return 0;
112
+            }
113
+            else
114
+            {
115
+                return Convert.ToInt32(obj);
116
+            }
117
+        }
118
+        /// <summary>
119
+        /// 更新一条数据
120
+        /// </summary>
121
+        public bool Update(RMYY_CallCenter_Api.Model.T_Dis_WorkOrder model)
122
+        {
123
+            StringBuilder strSql = new StringBuilder();
124
+            strSql.Append("update T_Dis_WorkOrder set ");
125
+            strSql.Append("F_Type=@F_Type,");
126
+            strSql.Append("F_WorkOrderCode=@F_WorkOrderCode,");
127
+            strSql.Append("F_ProposerDeptId=@F_ProposerDeptId,");
128
+            strSql.Append("F_ProposerDeptName=@F_ProposerDeptName,");
129
+            strSql.Append("F_ProposerCode=@F_ProposerCode,");
130
+            strSql.Append("F_ProposerName=@F_ProposerName,");
131
+            strSql.Append("F_ProposerPhon=@F_ProposerPhon,");
132
+            strSql.Append("F_Source=@F_Source,");
133
+            strSql.Append("F_CallID=@F_CallID,");
134
+            strSql.Append("F_DisNum=@F_DisNum,");
135
+            strSql.Append("F_ItemMessages=@F_ItemMessages,");
136
+            strSql.Append("F_ItemContents=@F_ItemContents,");
137
+            strSql.Append("F_Remark=@F_Remark,");
138
+            strSql.Append("F_CreateTime=@F_CreateTime,");
139
+            strSql.Append("F_CreateCode=@F_CreateCode,");
140
+            strSql.Append("F_CreateName=@F_CreateName,");
141
+            strSql.Append("F_State=@F_State,");
142
+            strSql.Append("F_ControlManCode=@F_ControlManCode,");
143
+            strSql.Append("F_ControlManName=@F_ControlManName,");
144
+            strSql.Append("F_TransPersonCode=@F_TransPersonCode,");
145
+            strSql.Append("F_TransPerson=@F_TransPerson,");
146
+            strSql.Append("F_BedPosition=@F_BedPosition,");
147
+            strSql.Append("F_SureMan=@F_SureMan,");
148
+            strSql.Append("F_SureManName=@F_SureManName,");
149
+            strSql.Append("F_SureManPhon=@F_SureManPhon,");
150
+            strSql.Append("F_IsDel=@F_IsDel,");
151
+            strSql.Append("F_DeleteBy=@F_DeleteBy,");
152
+            strSql.Append("F_DeleteTime=@F_DeleteTime,");
153
+            strSql.Append("F_FinishTime=@F_FinishTime");
154
+            strSql.Append(" where F_Id=@F_Id");
155
+            SqlParameter[] parameters = {
156
+                    new SqlParameter("@F_Type", SqlDbType.Int,4),
157
+                    new SqlParameter("@F_WorkOrderCode", SqlDbType.VarChar,50),
158
+                    new SqlParameter("@F_ProposerDeptId", SqlDbType.Int,4),
159
+                    new SqlParameter("@F_ProposerDeptName", SqlDbType.VarChar,50),
160
+                    new SqlParameter("@F_ProposerCode", SqlDbType.VarChar,50),
161
+                    new SqlParameter("@F_ProposerName", SqlDbType.VarChar,50),
162
+                    new SqlParameter("@F_ProposerPhon", SqlDbType.VarChar,20),
163
+                    new SqlParameter("@F_Source", SqlDbType.NVarChar,200),
164
+                    new SqlParameter("@F_CallID", SqlDbType.VarChar,50),
165
+                    new SqlParameter("@F_DisNum", SqlDbType.Int,4),
166
+                    new SqlParameter("@F_ItemMessages", SqlDbType.NText),
167
+                    new SqlParameter("@F_ItemContents", SqlDbType.NText),
168
+                    new SqlParameter("@F_Remark", SqlDbType.NText),
169
+                    new SqlParameter("@F_CreateTime", SqlDbType.DateTime),
170
+                    new SqlParameter("@F_CreateCode", SqlDbType.VarChar,50),
171
+                    new SqlParameter("@F_CreateName", SqlDbType.VarChar,50),
172
+                    new SqlParameter("@F_State", SqlDbType.Int,4),
173
+                    new SqlParameter("@F_ControlManCode", SqlDbType.VarChar,50),
174
+                    new SqlParameter("@F_ControlManName", SqlDbType.VarChar,50),
175
+                    new SqlParameter("@F_TransPersonCode", SqlDbType.NText),
176
+                    new SqlParameter("@F_TransPerson", SqlDbType.NText),
177
+                    new SqlParameter("@F_BedPosition", SqlDbType.VarChar,100),
178
+                    new SqlParameter("@F_SureMan", SqlDbType.VarChar,50),
179
+                    new SqlParameter("@F_SureManName", SqlDbType.VarChar,50),
180
+                    new SqlParameter("@F_SureManPhon", SqlDbType.VarChar,20),
181
+                    new SqlParameter("@F_IsDel", SqlDbType.Int,4),
182
+                    new SqlParameter("@F_DeleteBy", SqlDbType.VarChar,50),
183
+                    new SqlParameter("@F_DeleteTime", SqlDbType.DateTime),
184
+                    new SqlParameter("@F_FinishTime", SqlDbType.DateTime),
185
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)};
186
+            parameters[0].Value = model.F_Type;
187
+            parameters[1].Value = model.F_WorkOrderCode;
188
+            parameters[2].Value = model.F_ProposerDeptId;
189
+            parameters[3].Value = model.F_ProposerDeptName;
190
+            parameters[4].Value = model.F_ProposerCode;
191
+            parameters[5].Value = model.F_ProposerName;
192
+            parameters[6].Value = model.F_ProposerPhon;
193
+            parameters[7].Value = model.F_Source;
194
+            parameters[8].Value = model.F_CallID;
195
+            parameters[9].Value = model.F_DisNum;
196
+            parameters[10].Value = model.F_ItemMessages;
197
+            parameters[11].Value = model.F_ItemContents;
198
+            parameters[12].Value = model.F_Remark;
199
+            parameters[13].Value = model.F_CreateTime;
200
+            parameters[14].Value = model.F_CreateCode;
201
+            parameters[15].Value = model.F_CreateName;
202
+            parameters[16].Value = model.F_State;
203
+            parameters[17].Value = model.F_ControlManCode;
204
+            parameters[18].Value = model.F_ControlManName;
205
+            parameters[19].Value = model.F_TransPersonCode;
206
+            parameters[20].Value = model.F_TransPerson;
207
+            parameters[21].Value = model.F_BedPosition;
208
+            parameters[22].Value = model.F_SureMan;
209
+            parameters[23].Value = model.F_SureManName;
210
+            parameters[24].Value = model.F_SureManPhon;
211
+            parameters[25].Value = model.F_IsDel;
212
+            parameters[26].Value = model.F_DeleteBy;
213
+            parameters[27].Value = model.F_DeleteTime;
214
+            parameters[28].Value = model.F_FinishTime;
215
+            parameters[29].Value = model.F_Id;
216
+
217
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
218
+            if (rows > 0)
219
+            {
220
+                return true;
221
+            }
222
+            else
223
+            {
224
+                return false;
225
+            }
226
+        }
227
+
228
+        /// <summary>
229
+        /// 删除一条数据
230
+        /// </summary>
231
+        public bool Delete(int F_Id)
232
+        {
233
+
234
+            StringBuilder strSql = new StringBuilder();
235
+            strSql.Append("delete from T_Dis_WorkOrder ");
236
+            strSql.Append(" where F_Id=@F_Id");
237
+            SqlParameter[] parameters = {
238
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)
239
+            };
240
+            parameters[0].Value = F_Id;
241
+
242
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
243
+            if (rows > 0)
244
+            {
245
+                return true;
246
+            }
247
+            else
248
+            {
249
+                return false;
250
+            }
251
+        }
252
+        /// <summary>
253
+        /// 批量删除数据
254
+        /// </summary>
255
+        public bool DeleteList(string F_Idlist)
256
+        {
257
+            StringBuilder strSql = new StringBuilder();
258
+            strSql.Append("delete from T_Dis_WorkOrder ");
259
+            strSql.Append(" where F_Id in (" + F_Idlist + ")  ");
260
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
261
+            if (rows > 0)
262
+            {
263
+                return true;
264
+            }
265
+            else
266
+            {
267
+                return false;
268
+            }
269
+        }
270
+
271
+
272
+        /// <summary>
273
+        /// 得到一个对象实体
274
+        /// </summary>
275
+        public RMYY_CallCenter_Api.Model.T_Dis_WorkOrder GetModel(int F_Id)
276
+        {
277
+
278
+            StringBuilder strSql = new StringBuilder();
279
+            strSql.Append("select  top 1 F_Id,F_Type,F_WorkOrderCode,F_ProposerDeptId,F_ProposerDeptName,F_ProposerCode,F_ProposerName,F_ProposerPhon,F_Source,F_CallID,F_DisNum,F_ItemMessages,F_ItemContents,F_Remark,F_CreateTime,F_CreateCode,F_CreateName,F_State,F_ControlManCode,F_ControlManName,F_TransPersonCode,F_TransPerson,F_BedPosition,F_SureMan,F_SureManName,F_SureManPhon,F_IsDel,F_DeleteBy,F_DeleteTime,F_FinishTime from T_Dis_WorkOrder ");
280
+            strSql.Append(" where F_Id=@F_Id");
281
+            SqlParameter[] parameters = {
282
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)
283
+            };
284
+            parameters[0].Value = F_Id;
285
+
286
+            RMYY_CallCenter_Api.Model.T_Dis_WorkOrder model = new RMYY_CallCenter_Api.Model.T_Dis_WorkOrder();
287
+            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
288
+            if (ds.Tables[0].Rows.Count > 0)
289
+            {
290
+                return DataRowToModel(ds.Tables[0].Rows[0]);
291
+            }
292
+            else
293
+            {
294
+                return null;
295
+            }
296
+        }
297
+
298
+
299
+        /// <summary>
300
+        /// 得到一个对象实体
301
+        /// </summary>
302
+        public RMYY_CallCenter_Api.Model.T_Dis_WorkOrder DataRowToModel(DataRow row)
303
+        {
304
+            RMYY_CallCenter_Api.Model.T_Dis_WorkOrder model = new RMYY_CallCenter_Api.Model.T_Dis_WorkOrder();
305
+            if (row != null)
306
+            {
307
+                if (row["F_Id"] != null && row["F_Id"].ToString() != "")
308
+                {
309
+                    model.F_Id = int.Parse(row["F_Id"].ToString());
310
+                }
311
+                if (row["F_Type"] != null && row["F_Type"].ToString() != "")
312
+                {
313
+                    model.F_Type = int.Parse(row["F_Type"].ToString());
314
+                }
315
+                if (row["F_WorkOrderCode"] != null)
316
+                {
317
+                    model.F_WorkOrderCode = row["F_WorkOrderCode"].ToString();
318
+                }
319
+                if (row["F_ProposerDeptId"] != null && row["F_ProposerDeptId"].ToString() != "")
320
+                {
321
+                    model.F_ProposerDeptId = int.Parse(row["F_ProposerDeptId"].ToString());
322
+                }
323
+                if (row["F_ProposerDeptName"] != null)
324
+                {
325
+                    model.F_ProposerDeptName = row["F_ProposerDeptName"].ToString();
326
+                }
327
+                if (row["F_ProposerCode"] != null)
328
+                {
329
+                    model.F_ProposerCode = row["F_ProposerCode"].ToString();
330
+                }
331
+                if (row["F_ProposerName"] != null)
332
+                {
333
+                    model.F_ProposerName = row["F_ProposerName"].ToString();
334
+                }
335
+                if (row["F_ProposerPhon"] != null)
336
+                {
337
+                    model.F_ProposerPhon = row["F_ProposerPhon"].ToString();
338
+                }
339
+                if (row["F_Source"] != null)
340
+                {
341
+                    model.F_Source = row["F_Source"].ToString();
342
+                }
343
+                if (row["F_CallID"] != null)
344
+                {
345
+                    model.F_CallID = row["F_CallID"].ToString();
346
+                }
347
+                if (row["F_DisNum"] != null && row["F_DisNum"].ToString() != "")
348
+                {
349
+                    model.F_DisNum = int.Parse(row["F_DisNum"].ToString());
350
+                }
351
+                if (row["F_ItemMessages"] != null)
352
+                {
353
+                    model.F_ItemMessages = row["F_ItemMessages"].ToString();
354
+                }
355
+                if (row["F_ItemContents"] != null)
356
+                {
357
+                    model.F_ItemContents = row["F_ItemContents"].ToString();
358
+                }
359
+                if (row["F_Remark"] != null)
360
+                {
361
+                    model.F_Remark = row["F_Remark"].ToString();
362
+                }
363
+                if (row["F_CreateTime"] != null && row["F_CreateTime"].ToString() != "")
364
+                {
365
+                    model.F_CreateTime = DateTime.Parse(row["F_CreateTime"].ToString());
366
+                }
367
+                if (row["F_CreateCode"] != null)
368
+                {
369
+                    model.F_CreateCode = row["F_CreateCode"].ToString();
370
+                }
371
+                if (row["F_CreateName"] != null)
372
+                {
373
+                    model.F_CreateName = row["F_CreateName"].ToString();
374
+                }
375
+                if (row["F_State"] != null && row["F_State"].ToString() != "")
376
+                {
377
+                    model.F_State = int.Parse(row["F_State"].ToString());
378
+                }
379
+                if (row["F_ControlManCode"] != null)
380
+                {
381
+                    model.F_ControlManCode = row["F_ControlManCode"].ToString();
382
+                }
383
+                if (row["F_ControlManName"] != null)
384
+                {
385
+                    model.F_ControlManName = row["F_ControlManName"].ToString();
386
+                }
387
+                if (row["F_TransPersonCode"] != null)
388
+                {
389
+                    model.F_TransPersonCode = row["F_TransPersonCode"].ToString();
390
+                }
391
+                if (row["F_TransPerson"] != null)
392
+                {
393
+                    model.F_TransPerson = row["F_TransPerson"].ToString();
394
+                }
395
+                if (row["F_BedPosition"] != null)
396
+                {
397
+                    model.F_BedPosition = row["F_BedPosition"].ToString();
398
+                }
399
+                if (row["F_SureMan"] != null)
400
+                {
401
+                    model.F_SureMan = row["F_SureMan"].ToString();
402
+                }
403
+                if (row["F_SureManName"] != null)
404
+                {
405
+                    model.F_SureManName = row["F_SureManName"].ToString();
406
+                }
407
+                if (row["F_SureManPhon"] != null)
408
+                {
409
+                    model.F_SureManPhon = row["F_SureManPhon"].ToString();
410
+                }
411
+                if (row["F_IsDel"] != null && row["F_IsDel"].ToString() != "")
412
+                {
413
+                    model.F_IsDel = int.Parse(row["F_IsDel"].ToString());
414
+                }
415
+                if (row["F_DeleteBy"] != null)
416
+                {
417
+                    model.F_DeleteBy = row["F_DeleteBy"].ToString();
418
+                }
419
+                if (row["F_DeleteTime"] != null && row["F_DeleteTime"].ToString() != "")
420
+                {
421
+                    model.F_DeleteTime = DateTime.Parse(row["F_DeleteTime"].ToString());
422
+                }
423
+                if (row["F_FinishTime"] != null && row["F_FinishTime"].ToString() != "")
424
+                {
425
+                    model.F_FinishTime = DateTime.Parse(row["F_FinishTime"].ToString());
426
+                }
427
+            }
428
+            return model;
429
+        }
430
+
431
+        /// <summary>
432
+        /// 获得数据列表
433
+        /// </summary>
434
+        public DataSet GetList(string strWhere)
435
+        {
436
+            StringBuilder strSql = new StringBuilder();
437
+            strSql.Append("select F_Id,F_Type,F_WorkOrderCode,F_ProposerDeptId,F_ProposerDeptName,F_ProposerCode,F_ProposerName,F_ProposerPhon,F_Source,F_CallID,F_DisNum,F_ItemMessages,F_ItemContents,F_Remark,F_CreateTime,F_CreateCode,F_CreateName,F_State,F_ControlManCode,F_ControlManName,F_TransPersonCode,F_TransPerson,F_BedPosition,F_SureMan,F_SureManName,F_SureManPhon,F_IsDel,F_DeleteBy,F_DeleteTime,F_FinishTime ");
438
+            strSql.Append(" FROM T_Dis_WorkOrder ");
439
+            if (strWhere.Trim() != "")
440
+            {
441
+                strSql.Append(" where " + strWhere);
442
+            }
443
+            return DbHelperSQL.Query(strSql.ToString());
444
+        }
445
+
446
+        /// <summary>
447
+        /// 获得前几行数据
448
+        /// </summary>
449
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
450
+        {
451
+            StringBuilder strSql = new StringBuilder();
452
+            strSql.Append("select ");
453
+            if (Top > 0)
454
+            {
455
+                strSql.Append(" top " + Top.ToString());
456
+            }
457
+            strSql.Append(" F_Id,F_Type,F_WorkOrderCode,F_ProposerDeptId,F_ProposerDeptName,F_ProposerCode,F_ProposerName,F_ProposerPhon,F_Source,F_CallID,F_DisNum,F_ItemMessages,F_ItemContents,F_Remark,F_CreateTime,F_CreateCode,F_CreateName,F_State,F_ControlManCode,F_ControlManName,F_TransPersonCode,F_TransPerson,F_BedPosition,F_SureMan,F_SureManName,F_SureManPhon,F_IsDel,F_DeleteBy,F_DeleteTime,F_FinishTime ");
458
+            strSql.Append(" FROM T_Dis_WorkOrder ");
459
+            if (strWhere.Trim() != "")
460
+            {
461
+                strSql.Append(" where " + strWhere);
462
+            }
463
+            strSql.Append(" order by " + filedOrder);
464
+            return DbHelperSQL.Query(strSql.ToString());
465
+        }
466
+
467
+        /// <summary>
468
+        /// 获取记录总数
469
+        /// </summary>
470
+        public int GetRecordCount(string strWhere)
471
+        {
472
+            StringBuilder strSql = new StringBuilder();
473
+            strSql.Append("select count(1) FROM T_Dis_WorkOrder ");
474
+            if (strWhere.Trim() != "")
475
+            {
476
+                strSql.Append(" where " + strWhere);
477
+            }
478
+            object obj = DbHelperSQL.GetSingle(strSql.ToString());
479
+            if (obj == null)
480
+            {
481
+                return 0;
482
+            }
483
+            else
484
+            {
485
+                return Convert.ToInt32(obj);
486
+            }
487
+        }
488
+        /// <summary>
489
+        /// 分页获取数据列表
490
+        /// </summary>
491
+        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
492
+        {
493
+            StringBuilder strSql = new StringBuilder();
494
+            strSql.Append("SELECT * FROM ( ");
495
+            strSql.Append(" SELECT ROW_NUMBER() OVER (");
496
+            if (!string.IsNullOrEmpty(orderby.Trim()))
497
+            {
498
+                strSql.Append("order by T." + orderby);
499
+            }
500
+            else
501
+            {
502
+                strSql.Append("order by T.F_Id desc");
503
+            }
504
+            strSql.Append(")AS Row, T.*  from T_Dis_WorkOrder T ");
505
+            if (!string.IsNullOrEmpty(strWhere.Trim()))
506
+            {
507
+                strSql.Append(" WHERE " + strWhere);
508
+            }
509
+            strSql.Append(" ) TT");
510
+            strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
511
+            return DbHelperSQL.Query(strSql.ToString());
512
+        }
513
+
514
+        #endregion  BasicMethod
515
+        #region  ExtensionMethod
516
+
517
+        #endregion  ExtensionMethod
518
+    }
519
+}

+ 383 - 0
RMYY_CallCenter_Api.Dal/T_Dis_WorkOrderItem.cs

@@ -0,0 +1,383 @@
1
+using RMYY_CallCenter_Api.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
+
10
+namespace RMYY_CallCenter_Api.Dal
11
+{
12
+    /// <summary>
13
+    /// 数据访问类:T_Dis_WorkOrderItem
14
+    /// </summary>
15
+    public partial class T_Dis_WorkOrderItem
16
+    {
17
+        public T_Dis_WorkOrderItem()
18
+        { }
19
+        #region  BasicMethod
20
+        /// <summary>
21
+        /// 是否存在该记录
22
+        /// </summary>
23
+        public bool Exists(long F_ID)
24
+        {
25
+            StringBuilder strSql = new StringBuilder();
26
+            strSql.Append("select count(1) from T_Dis_WorkOrderItem");
27
+            strSql.Append(" where F_ID=@F_ID");
28
+            SqlParameter[] parameters = {
29
+                    new SqlParameter("@F_ID", SqlDbType.BigInt)
30
+            };
31
+            parameters[0].Value = F_ID;
32
+
33
+            return DbHelperSQL.Exists(strSql.ToString(), parameters);
34
+        }
35
+
36
+
37
+        /// <summary>
38
+        /// 增加一条数据
39
+        /// </summary>
40
+        public long Add(RMYY_CallCenter_Api.Model.T_Dis_WorkOrderItem model)
41
+        {
42
+            StringBuilder strSql = new StringBuilder();
43
+            strSql.Append("insert into T_Dis_WorkOrderItem(");
44
+            strSql.Append("F_WoID,F_WoType,F_WoState,F_ItemType,F_OptType,F_OptContent,F_NextUser,F_NextUserName,F_NexUserPhon,F_NextUserTalkie,F_NextDept,F_IsUsed,F_CreateUser,F_CreateTime)");
45
+            strSql.Append(" values (");
46
+            strSql.Append("@F_WoID,@F_WoType,@F_WoState,@F_ItemType,@F_OptType,@F_OptContent,@F_NextUser,@F_NextUserName,@F_NexUserPhon,@F_NextUserTalkie,@F_NextDept,@F_IsUsed,@F_CreateUser,@F_CreateTime)");
47
+            strSql.Append(";select @@IDENTITY");
48
+            SqlParameter[] parameters = {
49
+                    new SqlParameter("@F_WoID", SqlDbType.BigInt,8),
50
+                    new SqlParameter("@F_WoType", SqlDbType.Int,4),
51
+                    new SqlParameter("@F_WoState", SqlDbType.Int,4),
52
+                    new SqlParameter("@F_ItemType", SqlDbType.Int,4),
53
+                    new SqlParameter("@F_OptType", SqlDbType.Int,4),
54
+                    new SqlParameter("@F_OptContent", SqlDbType.NVarChar,-1),
55
+                    new SqlParameter("@F_NextUser", SqlDbType.VarChar,50),
56
+                    new SqlParameter("@F_NextUserName", SqlDbType.VarChar,50),
57
+                    new SqlParameter("@F_NexUserPhon", SqlDbType.VarChar,20),
58
+                    new SqlParameter("@F_NextUserTalkie", SqlDbType.VarChar,20),
59
+                    new SqlParameter("@F_NextDept", SqlDbType.Int,4),
60
+                    new SqlParameter("@F_IsUsed", SqlDbType.Int,4),
61
+                    new SqlParameter("@F_CreateUser", SqlDbType.VarChar,50),
62
+                    new SqlParameter("@F_CreateTime", SqlDbType.DateTime)};
63
+            parameters[0].Value = model.F_WoID;
64
+            parameters[1].Value = model.F_WoType;
65
+            parameters[2].Value = model.F_WoState;
66
+            parameters[3].Value = model.F_ItemType;
67
+            parameters[4].Value = model.F_OptType;
68
+            parameters[5].Value = model.F_OptContent;
69
+            parameters[6].Value = model.F_NextUser;
70
+            parameters[7].Value = model.F_NextUserName;
71
+            parameters[8].Value = model.F_NexUserPhon;
72
+            parameters[9].Value = model.F_NextUserTalkie;
73
+            parameters[10].Value = model.F_NextDept;
74
+            parameters[11].Value = model.F_IsUsed;
75
+            parameters[12].Value = model.F_CreateUser;
76
+            parameters[13].Value = model.F_CreateTime;
77
+
78
+            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
79
+            if (obj == null)
80
+            {
81
+                return 0;
82
+            }
83
+            else
84
+            {
85
+                return Convert.ToInt64(obj);
86
+            }
87
+        }
88
+        /// <summary>
89
+        /// 更新一条数据
90
+        /// </summary>
91
+        public bool Update(RMYY_CallCenter_Api.Model.T_Dis_WorkOrderItem model)
92
+        {
93
+            StringBuilder strSql = new StringBuilder();
94
+            strSql.Append("update T_Dis_WorkOrderItem set ");
95
+            strSql.Append("F_WoID=@F_WoID,");
96
+            strSql.Append("F_WoType=@F_WoType,");
97
+            strSql.Append("F_WoState=@F_WoState,");
98
+            strSql.Append("F_ItemType=@F_ItemType,");
99
+            strSql.Append("F_OptType=@F_OptType,");
100
+            strSql.Append("F_OptContent=@F_OptContent,");
101
+            strSql.Append("F_NextUser=@F_NextUser,");
102
+            strSql.Append("F_NextUserName=@F_NextUserName,");
103
+            strSql.Append("F_NexUserPhon=@F_NexUserPhon,");
104
+            strSql.Append("F_NextUserTalkie=@F_NextUserTalkie,");
105
+            strSql.Append("F_NextDept=@F_NextDept,");
106
+            strSql.Append("F_IsUsed=@F_IsUsed,");
107
+            strSql.Append("F_CreateUser=@F_CreateUser,");
108
+            strSql.Append("F_CreateTime=@F_CreateTime");
109
+            strSql.Append(" where F_ID=@F_ID");
110
+            SqlParameter[] parameters = {
111
+                    new SqlParameter("@F_WoID", SqlDbType.BigInt,8),
112
+                    new SqlParameter("@F_WoType", SqlDbType.Int,4),
113
+                    new SqlParameter("@F_WoState", SqlDbType.Int,4),
114
+                    new SqlParameter("@F_ItemType", SqlDbType.Int,4),
115
+                    new SqlParameter("@F_OptType", SqlDbType.Int,4),
116
+                    new SqlParameter("@F_OptContent", SqlDbType.NVarChar,-1),
117
+                    new SqlParameter("@F_NextUser", SqlDbType.VarChar,50),
118
+                    new SqlParameter("@F_NextUserName", SqlDbType.VarChar,50),
119
+                    new SqlParameter("@F_NexUserPhon", SqlDbType.VarChar,20),
120
+                    new SqlParameter("@F_NextUserTalkie", SqlDbType.VarChar,20),
121
+                    new SqlParameter("@F_NextDept", SqlDbType.Int,4),
122
+                    new SqlParameter("@F_IsUsed", SqlDbType.Int,4),
123
+                    new SqlParameter("@F_CreateUser", SqlDbType.VarChar,50),
124
+                    new SqlParameter("@F_CreateTime", SqlDbType.DateTime),
125
+                    new SqlParameter("@F_ID", SqlDbType.BigInt,8)};
126
+            parameters[0].Value = model.F_WoID;
127
+            parameters[1].Value = model.F_WoType;
128
+            parameters[2].Value = model.F_WoState;
129
+            parameters[3].Value = model.F_ItemType;
130
+            parameters[4].Value = model.F_OptType;
131
+            parameters[5].Value = model.F_OptContent;
132
+            parameters[6].Value = model.F_NextUser;
133
+            parameters[7].Value = model.F_NextUserName;
134
+            parameters[8].Value = model.F_NexUserPhon;
135
+            parameters[9].Value = model.F_NextUserTalkie;
136
+            parameters[10].Value = model.F_NextDept;
137
+            parameters[11].Value = model.F_IsUsed;
138
+            parameters[12].Value = model.F_CreateUser;
139
+            parameters[13].Value = model.F_CreateTime;
140
+            parameters[14].Value = model.F_ID;
141
+
142
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
143
+            if (rows > 0)
144
+            {
145
+                return true;
146
+            }
147
+            else
148
+            {
149
+                return false;
150
+            }
151
+        }
152
+
153
+        /// <summary>
154
+        /// 删除一条数据
155
+        /// </summary>
156
+        public bool Delete(long F_ID)
157
+        {
158
+
159
+            StringBuilder strSql = new StringBuilder();
160
+            strSql.Append("delete from T_Dis_WorkOrderItem ");
161
+            strSql.Append(" where F_ID=@F_ID");
162
+            SqlParameter[] parameters = {
163
+                    new SqlParameter("@F_ID", SqlDbType.BigInt)
164
+            };
165
+            parameters[0].Value = F_ID;
166
+
167
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
168
+            if (rows > 0)
169
+            {
170
+                return true;
171
+            }
172
+            else
173
+            {
174
+                return false;
175
+            }
176
+        }
177
+        /// <summary>
178
+        /// 批量删除数据
179
+        /// </summary>
180
+        public bool DeleteList(string F_IDlist)
181
+        {
182
+            StringBuilder strSql = new StringBuilder();
183
+            strSql.Append("delete from T_Dis_WorkOrderItem ");
184
+            strSql.Append(" where F_ID in (" + F_IDlist + ")  ");
185
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
186
+            if (rows > 0)
187
+            {
188
+                return true;
189
+            }
190
+            else
191
+            {
192
+                return false;
193
+            }
194
+        }
195
+
196
+
197
+        /// <summary>
198
+        /// 得到一个对象实体
199
+        /// </summary>
200
+        public RMYY_CallCenter_Api.Model.T_Dis_WorkOrderItem GetModel(long F_ID)
201
+        {
202
+
203
+            StringBuilder strSql = new StringBuilder();
204
+            strSql.Append("select  top 1 F_ID,F_WoID,F_WoType,F_WoState,F_ItemType,F_OptType,F_OptContent,F_NextUser,F_NextUserName,F_NexUserPhon,F_NextUserTalkie,F_NextDept,F_IsUsed,F_CreateUser,F_CreateTime from T_Dis_WorkOrderItem ");
205
+            strSql.Append(" where F_ID=@F_ID");
206
+            SqlParameter[] parameters = {
207
+                    new SqlParameter("@F_ID", SqlDbType.BigInt)
208
+            };
209
+            parameters[0].Value = F_ID;
210
+
211
+            RMYY_CallCenter_Api.Model.T_Dis_WorkOrderItem model = new RMYY_CallCenter_Api.Model.T_Dis_WorkOrderItem();
212
+            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
213
+            if (ds.Tables[0].Rows.Count > 0)
214
+            {
215
+                return DataRowToModel(ds.Tables[0].Rows[0]);
216
+            }
217
+            else
218
+            {
219
+                return null;
220
+            }
221
+        }
222
+
223
+
224
+        /// <summary>
225
+        /// 得到一个对象实体
226
+        /// </summary>
227
+        public RMYY_CallCenter_Api.Model.T_Dis_WorkOrderItem DataRowToModel(DataRow row)
228
+        {
229
+            RMYY_CallCenter_Api.Model.T_Dis_WorkOrderItem model = new RMYY_CallCenter_Api.Model.T_Dis_WorkOrderItem();
230
+            if (row != null)
231
+            {
232
+                if (row["F_ID"] != null && row["F_ID"].ToString() != "")
233
+                {
234
+                    model.F_ID = long.Parse(row["F_ID"].ToString());
235
+                }
236
+                if (row["F_WoID"] != null && row["F_WoID"].ToString() != "")
237
+                {
238
+                    model.F_WoID = long.Parse(row["F_WoID"].ToString());
239
+                }
240
+                if (row["F_WoType"] != null && row["F_WoType"].ToString() != "")
241
+                {
242
+                    model.F_WoType = int.Parse(row["F_WoType"].ToString());
243
+                }
244
+                if (row["F_WoState"] != null && row["F_WoState"].ToString() != "")
245
+                {
246
+                    model.F_WoState = int.Parse(row["F_WoState"].ToString());
247
+                }
248
+                if (row["F_ItemType"] != null && row["F_ItemType"].ToString() != "")
249
+                {
250
+                    model.F_ItemType = int.Parse(row["F_ItemType"].ToString());
251
+                }
252
+                if (row["F_OptType"] != null && row["F_OptType"].ToString() != "")
253
+                {
254
+                    model.F_OptType = int.Parse(row["F_OptType"].ToString());
255
+                }
256
+                if (row["F_OptContent"] != null)
257
+                {
258
+                    model.F_OptContent = row["F_OptContent"].ToString();
259
+                }
260
+                if (row["F_NextUser"] != null)
261
+                {
262
+                    model.F_NextUser = row["F_NextUser"].ToString();
263
+                }
264
+                if (row["F_NextUserName"] != null)
265
+                {
266
+                    model.F_NextUserName = row["F_NextUserName"].ToString();
267
+                }
268
+                if (row["F_NexUserPhon"] != null)
269
+                {
270
+                    model.F_NexUserPhon = row["F_NexUserPhon"].ToString();
271
+                }
272
+                if (row["F_NextUserTalkie"] != null)
273
+                {
274
+                    model.F_NextUserTalkie = row["F_NextUserTalkie"].ToString();
275
+                }
276
+                if (row["F_NextDept"] != null && row["F_NextDept"].ToString() != "")
277
+                {
278
+                    model.F_NextDept = int.Parse(row["F_NextDept"].ToString());
279
+                }
280
+                if (row["F_IsUsed"] != null && row["F_IsUsed"].ToString() != "")
281
+                {
282
+                    model.F_IsUsed = int.Parse(row["F_IsUsed"].ToString());
283
+                }
284
+                if (row["F_CreateUser"] != null)
285
+                {
286
+                    model.F_CreateUser = row["F_CreateUser"].ToString();
287
+                }
288
+                if (row["F_CreateTime"] != null && row["F_CreateTime"].ToString() != "")
289
+                {
290
+                    model.F_CreateTime = DateTime.Parse(row["F_CreateTime"].ToString());
291
+                }
292
+            }
293
+            return model;
294
+        }
295
+
296
+        /// <summary>
297
+        /// 获得数据列表
298
+        /// </summary>
299
+        public DataSet GetList(string strWhere)
300
+        {
301
+            StringBuilder strSql = new StringBuilder();
302
+            strSql.Append("select F_ID,F_WoID,F_WoType,F_WoState,F_ItemType,F_OptType,F_OptContent,F_NextUser,F_NextUserName,F_NexUserPhon,F_NextUserTalkie,F_NextDept,F_IsUsed,F_CreateUser,F_CreateTime ");
303
+            strSql.Append(" FROM T_Dis_WorkOrderItem ");
304
+            if (strWhere.Trim() != "")
305
+            {
306
+                strSql.Append(" where " + strWhere);
307
+            }
308
+            return DbHelperSQL.Query(strSql.ToString());
309
+        }
310
+
311
+        /// <summary>
312
+        /// 获得前几行数据
313
+        /// </summary>
314
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
315
+        {
316
+            StringBuilder strSql = new StringBuilder();
317
+            strSql.Append("select ");
318
+            if (Top > 0)
319
+            {
320
+                strSql.Append(" top " + Top.ToString());
321
+            }
322
+            strSql.Append(" F_ID,F_WoID,F_WoType,F_WoState,F_ItemType,F_OptType,F_OptContent,F_NextUser,F_NextUserName,F_NexUserPhon,F_NextUserTalkie,F_NextDept,F_IsUsed,F_CreateUser,F_CreateTime ");
323
+            strSql.Append(" FROM T_Dis_WorkOrderItem ");
324
+            if (strWhere.Trim() != "")
325
+            {
326
+                strSql.Append(" where " + strWhere);
327
+            }
328
+            strSql.Append(" order by " + filedOrder);
329
+            return DbHelperSQL.Query(strSql.ToString());
330
+        }
331
+
332
+        /// <summary>
333
+        /// 获取记录总数
334
+        /// </summary>
335
+        public int GetRecordCount(string strWhere)
336
+        {
337
+            StringBuilder strSql = new StringBuilder();
338
+            strSql.Append("select count(1) FROM T_Dis_WorkOrderItem ");
339
+            if (strWhere.Trim() != "")
340
+            {
341
+                strSql.Append(" where " + strWhere);
342
+            }
343
+            object obj = DbHelperSQL.GetSingle(strSql.ToString());
344
+            if (obj == null)
345
+            {
346
+                return 0;
347
+            }
348
+            else
349
+            {
350
+                return Convert.ToInt32(obj);
351
+            }
352
+        }
353
+        /// <summary>
354
+        /// 分页获取数据列表
355
+        /// </summary>
356
+        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
357
+        {
358
+            StringBuilder strSql = new StringBuilder();
359
+            strSql.Append("SELECT * FROM ( ");
360
+            strSql.Append(" SELECT ROW_NUMBER() OVER (");
361
+            if (!string.IsNullOrEmpty(orderby.Trim()))
362
+            {
363
+                strSql.Append("order by T." + orderby);
364
+            }
365
+            else
366
+            {
367
+                strSql.Append("order by T.F_ID desc");
368
+            }
369
+            strSql.Append(")AS Row, T.*  from T_Dis_WorkOrderItem T ");
370
+            if (!string.IsNullOrEmpty(strWhere.Trim()))
371
+            {
372
+                strSql.Append(" WHERE " + strWhere);
373
+            }
374
+            strSql.Append(" ) TT");
375
+            strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
376
+            return DbHelperSQL.Query(strSql.ToString());
377
+        }
378
+        #endregion  BasicMethod
379
+        #region  ExtensionMethod
380
+
381
+        #endregion  ExtensionMethod
382
+    }
383
+}

+ 2 - 0
RMYY_CallCenter_Api.Model/RMYY_CallCenter_Api.Model.csproj

@@ -52,6 +52,8 @@
52 52
     <Compile Include="T_Dev_Operate.cs" />
53 53
     <Compile Include="T_Dev_WorkOrder.cs" />
54 54
     <Compile Include="T_Dev_WorkOrderItem.cs" />
55
+    <Compile Include="T_Dis_WorkOrder.cs" />
56
+    <Compile Include="T_Dis_WorkOrderItem.cs" />
55 57
     <Compile Include="T_Hos_WorkOrder.cs" />
56 58
     <Compile Include="T_Hos_WorkOrderItem.cs" />
57 59
     <Compile Include="T_Mat_WorkOrder.cs" />

+ 292 - 0
RMYY_CallCenter_Api.Model/T_Dis_WorkOrder.cs

@@ -0,0 +1,292 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace RMYY_CallCenter_Api.Model
8
+{
9
+
10
+    /// <summary>
11
+    /// T_Dis_WorkOrder:实体类(属性说明自动提取数据库字段的描述信息)
12
+    /// </summary>
13
+    [Serializable]
14
+    public partial class T_Dis_WorkOrder
15
+    {
16
+        public T_Dis_WorkOrder()
17
+        { }
18
+        #region Model
19
+        private int _f_id;
20
+        private int? _f_type;
21
+        private string _f_workordercode;
22
+        private int? _f_proposerdeptid;
23
+        private string _f_proposerdeptname;
24
+        private string _f_proposercode;
25
+        private string _f_proposername;
26
+        private string _f_proposerphon;
27
+        private string _f_source;
28
+        private string _f_callid;
29
+        private int? _f_disnum;
30
+        private string _f_itemmessages;
31
+        private string _f_itemcontents;
32
+        private string _f_remark;
33
+        private DateTime? _f_createtime;
34
+        private string _f_createcode;
35
+        private string _f_createname;
36
+        private int? _f_state;
37
+        private string _f_controlmancode;
38
+        private string _f_controlmanname;
39
+        private string _f_transpersoncode;
40
+        private string _f_transperson;
41
+        private string _f_bedposition;
42
+        private string _f_sureman;
43
+        private string _f_suremanname;
44
+        private string _f_suremanphon;
45
+        private int? _f_isdel;
46
+        private string _f_deleteby;
47
+        private DateTime? _f_deletetime;
48
+        private DateTime? _f_finishtime;
49
+        /// <summary>
50
+        /// 
51
+        /// </summary>
52
+        public int F_Id
53
+        {
54
+            set { _f_id = value; }
55
+            get { return _f_id; }
56
+        }
57
+        /// <summary>
58
+        /// 工单类型
59
+        /// </summary>
60
+        public int? F_Type
61
+        {
62
+            set { _f_type = value; }
63
+            get { return _f_type; }
64
+        }
65
+        /// <summary>
66
+        /// 工单编号
67
+        /// </summary>
68
+        public string F_WorkOrderCode
69
+        {
70
+            set { _f_workordercode = value; }
71
+            get { return _f_workordercode; }
72
+        }
73
+        /// <summary>
74
+        /// 申请科室
75
+        /// </summary>
76
+        public int? F_ProposerDeptId
77
+        {
78
+            set { _f_proposerdeptid = value; }
79
+            get { return _f_proposerdeptid; }
80
+        }
81
+        /// <summary>
82
+        /// 
83
+        /// </summary>
84
+        public string F_ProposerDeptName
85
+        {
86
+            set { _f_proposerdeptname = value; }
87
+            get { return _f_proposerdeptname; }
88
+        }
89
+        /// <summary>
90
+        /// 申请人编号
91
+        /// </summary>
92
+        public string F_ProposerCode
93
+        {
94
+            set { _f_proposercode = value; }
95
+            get { return _f_proposercode; }
96
+        }
97
+        /// <summary>
98
+        /// 申请人姓名
99
+        /// </summary>
100
+        public string F_ProposerName
101
+        {
102
+            set { _f_proposername = value; }
103
+            get { return _f_proposername; }
104
+        }
105
+        /// <summary>
106
+        /// 申请人联系电话
107
+        /// </summary>
108
+        public string F_ProposerPhon
109
+        {
110
+            set { _f_proposerphon = value; }
111
+            get { return _f_proposerphon; }
112
+        }
113
+        /// <summary>
114
+        /// 工单来源:电话、PC端、APP
115
+        /// </summary>
116
+        public string F_Source
117
+        {
118
+            set { _f_source = value; }
119
+            get { return _f_source; }
120
+        }
121
+        /// <summary>
122
+        /// 通话记录ID
123
+        /// </summary>
124
+        public string F_CallID
125
+        {
126
+            set { _f_callid = value; }
127
+            get { return _f_callid; }
128
+        }
129
+        /// <summary>
130
+        /// 红处方数量
131
+        /// </summary>
132
+        public int? F_DisNum
133
+        {
134
+            set { _f_disnum = value; }
135
+            get { return _f_disnum; }
136
+        }
137
+        /// <summary>
138
+        /// 配送信息
139
+        /// </summary>
140
+        public string F_ItemMessages
141
+        {
142
+            set { _f_itemmessages = value; }
143
+            get { return _f_itemmessages; }
144
+        }
145
+        /// <summary>
146
+        /// 工单内容
147
+        /// </summary>
148
+        public string F_ItemContents
149
+        {
150
+            set { _f_itemcontents = value; }
151
+            get { return _f_itemcontents; }
152
+        }
153
+        /// <summary>
154
+        /// 备注
155
+        /// </summary>
156
+        public string F_Remark
157
+        {
158
+            set { _f_remark = value; }
159
+            get { return _f_remark; }
160
+        }
161
+        /// <summary>
162
+        /// 创建时间
163
+        /// </summary>
164
+        public DateTime? F_CreateTime
165
+        {
166
+            set { _f_createtime = value; }
167
+            get { return _f_createtime; }
168
+        }
169
+        /// <summary>
170
+        /// 创建人编码
171
+        /// </summary>
172
+        public string F_CreateCode
173
+        {
174
+            set { _f_createcode = value; }
175
+            get { return _f_createcode; }
176
+        }
177
+        /// <summary>
178
+        /// 姓名
179
+        /// </summary>
180
+        public string F_CreateName
181
+        {
182
+            set { _f_createname = value; }
183
+            get { return _f_createname; }
184
+        }
185
+        /// <summary>
186
+        /// 工单状态
187
+        /// </summary>
188
+        public int? F_State
189
+        {
190
+            set { _f_state = value; }
191
+            get { return _f_state; }
192
+        }
193
+        /// <summary>
194
+        /// 调度人
195
+        /// </summary>
196
+        public string F_ControlManCode
197
+        {
198
+            set { _f_controlmancode = value; }
199
+            get { return _f_controlmancode; }
200
+        }
201
+        /// <summary>
202
+        /// 调度人姓名
203
+        /// </summary>
204
+        public string F_ControlManName
205
+        {
206
+            set { _f_controlmanname = value; }
207
+            get { return _f_controlmanname; }
208
+        }
209
+        /// <summary>
210
+        /// 转运人编号
211
+        /// </summary>
212
+        public string F_TransPersonCode
213
+        {
214
+            set { _f_transpersoncode = value; }
215
+            get { return _f_transpersoncode; }
216
+        }
217
+        /// <summary>
218
+        /// 配送转运人
219
+        /// </summary>
220
+        public string F_TransPerson
221
+        {
222
+            set { _f_transperson = value; }
223
+            get { return _f_transperson; }
224
+        }
225
+        /// <summary>
226
+        /// 病床位置
227
+        /// </summary>
228
+        public string F_BedPosition
229
+        {
230
+            set { _f_bedposition = value; }
231
+            get { return _f_bedposition; }
232
+        }
233
+        /// <summary>
234
+        /// 确认人
235
+        /// </summary>
236
+        public string F_SureMan
237
+        {
238
+            set { _f_sureman = value; }
239
+            get { return _f_sureman; }
240
+        }
241
+        /// <summary>
242
+        /// 确认人姓名
243
+        /// </summary>
244
+        public string F_SureManName
245
+        {
246
+            set { _f_suremanname = value; }
247
+            get { return _f_suremanname; }
248
+        }
249
+        /// <summary>
250
+        /// 电话
251
+        /// </summary>
252
+        public string F_SureManPhon
253
+        {
254
+            set { _f_suremanphon = value; }
255
+            get { return _f_suremanphon; }
256
+        }
257
+        /// <summary>
258
+        /// 是否删除
259
+        /// </summary>
260
+        public int? F_IsDel
261
+        {
262
+            set { _f_isdel = value; }
263
+            get { return _f_isdel; }
264
+        }
265
+        /// <summary>
266
+        /// 删除人
267
+        /// </summary>
268
+        public string F_DeleteBy
269
+        {
270
+            set { _f_deleteby = value; }
271
+            get { return _f_deleteby; }
272
+        }
273
+        /// <summary>
274
+        /// 删除时间
275
+        /// </summary>
276
+        public DateTime? F_DeleteTime
277
+        {
278
+            set { _f_deletetime = value; }
279
+            get { return _f_deletetime; }
280
+        }
281
+        /// <summary>
282
+        /// 完结时间
283
+        /// </summary>
284
+        public DateTime? F_FinishTime
285
+        {
286
+            set { _f_finishtime = value; }
287
+            get { return _f_finishtime; }
288
+        }
289
+        #endregion Model
290
+
291
+    }
292
+}

+ 156 - 0
RMYY_CallCenter_Api.Model/T_Dis_WorkOrderItem.cs

@@ -0,0 +1,156 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace RMYY_CallCenter_Api.Model
8
+{
9
+    /// <summary>
10
+    /// T_Dis_WorkOrderItem:实体类(属性说明自动提取数据库字段的描述信息)
11
+    /// </summary>
12
+    [Serializable]
13
+    public partial class T_Dis_WorkOrderItem
14
+    {
15
+        public T_Dis_WorkOrderItem()
16
+        { }
17
+        #region Model
18
+        private long _f_id;
19
+        private long _f_woid;
20
+        private int? _f_wotype;
21
+        private int? _f_wostate;
22
+        private int? _f_itemtype;
23
+        private int? _f_opttype;
24
+        private string _f_optcontent;
25
+        private string _f_nextuser;
26
+        private string _f_nextusername;
27
+        private string _f_nexuserphon;
28
+        private string _f_nextusertalkie;
29
+        private int? _f_nextdept;
30
+        private int? _f_isused = 0;
31
+        private string _f_createuser;
32
+        private DateTime? _f_createtime;
33
+        /// <summary>
34
+        /// 工单记录ID
35
+        /// </summary>
36
+        public long F_ID
37
+        {
38
+            set { _f_id = value; }
39
+            get { return _f_id; }
40
+        }
41
+        /// <summary>
42
+        /// 工单ID
43
+        /// </summary>
44
+        public long F_WoID
45
+        {
46
+            set { _f_woid = value; }
47
+            get { return _f_woid; }
48
+        }
49
+        /// <summary>
50
+        /// 工单类型
51
+        /// </summary>
52
+        public int? F_WoType
53
+        {
54
+            set { _f_wotype = value; }
55
+            get { return _f_wotype; }
56
+        }
57
+        /// <summary>
58
+        /// 工单状态
59
+        /// </summary>
60
+        public int? F_WoState
61
+        {
62
+            set { _f_wostate = value; }
63
+            get { return _f_wostate; }
64
+        }
65
+        /// <summary>
66
+        /// 记录类型 1工单处理,2工单催办
67
+        /// </summary>
68
+        public int? F_ItemType
69
+        {
70
+            set { _f_itemtype = value; }
71
+            get { return _f_itemtype; }
72
+        }
73
+        /// <summary>
74
+        /// 操作类型
75
+        /// </summary>
76
+        public int? F_OptType
77
+        {
78
+            set { _f_opttype = value; }
79
+            get { return _f_opttype; }
80
+        }
81
+        /// <summary>
82
+        /// 操作内容
83
+        /// </summary>
84
+        public string F_OptContent
85
+        {
86
+            set { _f_optcontent = value; }
87
+            get { return _f_optcontent; }
88
+        }
89
+        /// <summary>
90
+        /// 下一步操作人
91
+        /// </summary>
92
+        public string F_NextUser
93
+        {
94
+            set { _f_nextuser = value; }
95
+            get { return _f_nextuser; }
96
+        }
97
+        /// <summary>
98
+        /// 姓名
99
+        /// </summary>
100
+        public string F_NextUserName
101
+        {
102
+            set { _f_nextusername = value; }
103
+            get { return _f_nextusername; }
104
+        }
105
+        /// <summary>
106
+        /// 电话
107
+        /// </summary>
108
+        public string F_NexUserPhon
109
+        {
110
+            set { _f_nexuserphon = value; }
111
+            get { return _f_nexuserphon; }
112
+        }
113
+        /// <summary>
114
+        /// 对讲机
115
+        /// </summary>
116
+        public string F_NextUserTalkie
117
+        {
118
+            set { _f_nextusertalkie = value; }
119
+            get { return _f_nextusertalkie; }
120
+        }
121
+        /// <summary>
122
+        /// 下一步操作部门
123
+        /// </summary>
124
+        public int? F_NextDept
125
+        {
126
+            set { _f_nextdept = value; }
127
+            get { return _f_nextdept; }
128
+        }
129
+        /// <summary>
130
+        /// 是否在用,0是 1否
131
+        /// </summary>
132
+        public int? F_IsUsed
133
+        {
134
+            set { _f_isused = value; }
135
+            get { return _f_isused; }
136
+        }
137
+        /// <summary>
138
+        /// 创建人
139
+        /// </summary>
140
+        public string F_CreateUser
141
+        {
142
+            set { _f_createuser = value; }
143
+            get { return _f_createuser; }
144
+        }
145
+        /// <summary>
146
+        /// 创建时间
147
+        /// </summary>
148
+        public DateTime? F_CreateTime
149
+        {
150
+            set { _f_createtime = value; }
151
+            get { return _f_createtime; }
152
+        }
153
+        #endregion Model
154
+
155
+    }
156
+}

+ 0 - 644
RMYY_CallCenter_Api.Utility/Request/RequestString.cs

@@ -1,644 +0,0 @@
1
-using System;
2
-using System.Globalization;
3
-using System.Linq;
4
-using System.Text;
5
-using System.Text.RegularExpressions;
6
-using System.Web;
7
-using System.Net;
8
-using System.IO;
9
-
10
-namespace RMYY_CallCenter_Api.Utility
11
-{
12
-    /// <summary>
13
-    /// 页面获取数据类
14
-
15
-    /// </summary>
16
-    public class RequestString
17
-    {
18
-        /// <summary>
19
-        /// 判断当前页面是否接收到了Post请求
20
-        /// </summary>
21
-        /// <returns>是否接收到了Post请求</returns>
22
-        public static bool IsPost()
23
-        {
24
-            return HttpContext.Current.Request.HttpMethod.Equals("POST");
25
-        }
26
-
27
-        /// <summary>
28
-        /// 判断当前页面是否接收到了Get请求
29
-        /// </summary>
30
-        /// <returns>是否接收到了Get请求</returns>
31
-        public static bool IsGet()
32
-        {
33
-            return HttpContext.Current.Request.HttpMethod.Equals("GET");
34
-        }
35
-        /// <summary>
36
-        /// 获取文件
37
-        /// </summary>
38
-        /// <returns></returns>
39
-        public static HttpFileCollection GetFiles()
40
-        {
41
-            return HttpContext.Current.Request.Files;
42
-        }
43
-        /// <summary>
44
-        /// 返回URL中结尾的文件名
45
-        /// </summary>		
46
-        public static string GetFilename(string url)
47
-        {
48
-            if (url == null)
49
-            {
50
-                return "";
51
-            }
52
-            string[] strs1 = url.Split(new[] { '/' });
53
-            return strs1[strs1.Length - 1].Split(new[] { '?' })[0];
54
-        }
55
-
56
-
57
-        /// <summary>
58
-        /// 返回指定的服务器变量信息
59
-        /// </summary>
60
-        /// <param name="strName">服务器变量名</param>
61
-        /// <returns>服务器变量信息</returns>
62
-        public static string GetServerString(string strName)
63
-        {
64
-            if (HttpContext.Current.Request.ServerVariables[strName] == null)
65
-                return "";
66
-
67
-            return HttpContext.Current.Request.ServerVariables[strName];
68
-        }
69
-
70
-        /// <summary>
71
-        /// 返回上一个页面的地址
72
-        /// </summary>
73
-        /// <returns>上一个页面的地址</returns>
74
-        public static string GetUrlReferrer()
75
-        {
76
-            string retVal = null;
77
-
78
-            try
79
-            {
80
-                if (HttpContext.Current.Request.UrlReferrer != null)
81
-                    retVal = HttpContext.Current.Request.UrlReferrer.ToString();
82
-            }
83
-            catch (Exception)
84
-            { }
85
-
86
-            if (retVal == null)
87
-                return "";
88
-
89
-            return retVal;
90
-        }
91
-
92
-        /// <summary>
93
-        /// 得到当前完整主机头
94
-        /// </summary>
95
-        /// <returns></returns>
96
-        public static string GetCurrentFullHost()
97
-        {
98
-            HttpRequest request = HttpContext.Current.Request;
99
-            if (!request.Url.IsDefaultPort)
100
-                return string.Format("{0}:{1}", request.Url.Host, request.Url.Port.ToString(CultureInfo.InvariantCulture));
101
-
102
-            return request.Url.Host;
103
-        }
104
-
105
-        /// <summary>
106
-        /// 得到主机头
107
-        /// </summary>
108
-        /// <returns></returns>
109
-        public static string GetHost()
110
-        {
111
-            return HttpContext.Current.Request.Url.Host;
112
-        }
113
-        /// <summary>
114
-        /// 得到主机名
115
-        /// </summary>
116
-        public static string GetDnsSafeHost()
117
-        {
118
-            return HttpContext.Current.Request.Url.DnsSafeHost;
119
-        }
120
-
121
-        /// <summary>
122
-        /// 获取当前请求的原始 URL(URL 中域信息之后的部分,包括查询字符串(如果存在))
123
-        /// </summary>
124
-        /// <returns>原始 URL</returns>
125
-        public static string GetRawUrl()
126
-        {
127
-            return HttpContext.Current.Request.RawUrl;
128
-        }
129
-
130
-        /// <summary>
131
-        /// 判断当前访问是否来自浏览器软件
132
-        /// </summary>
133
-        /// <returns>当前访问是否来自浏览器软件</returns>
134
-        public static bool IsBrowserGet()
135
-        {
136
-            string[] BrowserName = { "ie", "opera", "netscape", "mozilla", "konqueror", "firefox" };
137
-            string curBrowser = HttpContext.Current.Request.Browser.Type.ToLower();
138
-            return BrowserName.Any(t => curBrowser.IndexOf(t, StringComparison.Ordinal) >= 0);
139
-        }
140
-
141
-        /// <summary>
142
-        /// 判断是否来自搜索引擎链接
143
-        /// </summary>
144
-        /// <returns>是否来自搜索引擎链接</returns>
145
-        public static bool IsSearchEnginesGet()
146
-        {
147
-            if (HttpContext.Current.Request.UrlReferrer == null)
148
-                return false;
149
-
150
-            string[] SearchEngine = { "google", "yahoo", "msn", "baidu", "sogou", "sohu", "sina", "163", "lycos", "tom", "yisou", "iask", "soso", "gougou", "zhongsou" };
151
-            string tmpReferrer = HttpContext.Current.Request.UrlReferrer.ToString().ToLower();
152
-            return SearchEngine.Any(t => tmpReferrer.IndexOf(t, StringComparison.Ordinal) >= 0);
153
-        }
154
-
155
-        /// <summary>
156
-        /// 获得当前完整Url地址
157
-        /// </summary>
158
-        /// <returns>当前完整Url地址</returns>
159
-        public static string GetUrl()
160
-        {
161
-            return HttpContext.Current.Request.Url.ToString();
162
-        }
163
-
164
-        /// <summary>
165
-        /// 获取文件
166
-        /// </summary>
167
-        /// <param name="strName"></param>
168
-        /// <returns></returns>
169
-        public static HttpPostedFile GetFile(string strName)
170
-        {
171
-            return HttpContext.Current.Request.Files[strName];
172
-        }
173
-
174
-        /// <summary>
175
-        /// 获取stream
176
-        /// </summary>
177
-        /// <returns></returns>
178
-        public static Stream GetInputStream()
179
-        {
180
-            return HttpContext.Current.Request.InputStream;
181
-        }
182
-
183
-        /// <summary>
184
-        /// 获得指定Url参数的值
185
-        /// </summary>
186
-        /// <param name="strName">Url参数</param>
187
-        /// <returns>Url参数的值</returns>
188
-        public static string GetQueryString(string strName)
189
-        {
190
-            return GetQueryString(strName, false);
191
-        }
192
-
193
-        /// <summary>
194
-        /// 获得指定Url参数的值
195
-        /// </summary> 
196
-        /// <param name="strName">Url参数</param>
197
-        /// <param name="sqlSafeCheck">是否进行SQL安全检查</param>
198
-        /// <returns>Url参数的值</returns>
199
-        public static string GetQueryString(string strName, bool sqlSafeCheck)
200
-        {
201
-            if (HttpContext.Current.Request.QueryString[strName] == null)
202
-                return "";
203
-
204
-            if (sqlSafeCheck && !IsSafeSqlString(HttpContext.Current.Request.QueryString[strName]))
205
-                return "";
206
-
207
-            return HttpContext.Current.Request.QueryString[strName];
208
-        }
209
-
210
-        /// <summary>
211
-        /// 获得指定Url参数的值
212
-        /// </summary> 
213
-        /// <param name="strName">Url参数</param>
214
-        /// <param name="sqlSafeCheck">是否进行SQL安全检查</param>
215
-        /// <param name="defValue">当SQL安全检查不通过或无值时的默认值</param>
216
-        /// <returns>Url参数的值</returns>
217
-        public static string GetQueryString(string strName, bool sqlSafeCheck, string defValue)
218
-        {
219
-            if (HttpContext.Current.Request.QueryString[strName] == null)
220
-                return defValue;
221
-
222
-            if (sqlSafeCheck && !IsSafeSqlString(HttpContext.Current.Request.QueryString[strName]))
223
-                return defValue;
224
-
225
-            return HttpContext.Current.Request.QueryString[strName];
226
-        }
227
-
228
-        /// <summary>
229
-        /// SQL危险字符过滤
230
-        /// </summary>
231
-        /// <param name="source">要过滤的字符串</param>
232
-        /// <param name="SafeLevel">安全级别{1最高}</param>
233
-        /// <returns></returns>
234
-        public static string FilterSql(string source, int SafeLevel)
235
-        {
236
-
237
-            //单引号替换成两个单引号
238
-            source = source.Replace("'", "''");
239
-            source = source.Replace("--", "--");
240
-
241
-            if (SafeLevel == 1)
242
-            {
243
-                //单引号替换成两个单引号
244
-                source = source.Replace("\"", "“");
245
-                source = source.Replace("|", "|");
246
-
247
-                //半角封号替换为全角封号,防止多语句执行
248
-                source = source.Replace(";", ";");
249
-
250
-                source = source.Replace("=", "=");
251
-                //半角括号替换为全角括号
252
-                source = source.Replace("(", "(");
253
-                source = source.Replace(")", ")");
254
-            }
255
-            return source;
256
-        }
257
-
258
-        /// <summary>
259
-        /// 检测是否有Sql危险字符
260
-        /// </summary>
261
-        /// <param name="str">要判断字符串</param>
262
-        /// <returns>判断结果</returns>
263
-        public static bool IsSafeSqlString(string str)
264
-        {
265
-            return !Regex.IsMatch(str, @"[-|;|,|\/|\(|\)|\[|\]|\}|\{|%|@|\*|!|\']");
266
-        }
267
-
268
-        /// <summary>
269
-        /// 检测是否有危险的可能用于链接的字符串
270
-        /// </summary>
271
-        /// <param name="str">要判断字符串</param>
272
-        /// <returns>判断结果</returns>
273
-        public static bool IsSafeUserInfoString(string str)
274
-        {
275
-            return !Regex.IsMatch(str, @"^\s*$|^c:\\con\\con$|[%,\*" + "\"" + @"\s\t\<\>\&]|游客|^Guest");
276
-        }
277
-
278
-        /// <summary>
279
-        /// 获得当前页面的名称
280
-        /// </summary>
281
-        /// <returns>当前页面的名称</returns>
282
-        public static string GetPageName()
283
-        {
284
-            string[] urlArr = HttpContext.Current.Request.Url.AbsolutePath.Split('/');
285
-            return urlArr[urlArr.Length - 1].ToLower();
286
-        }
287
-
288
-        /// <summary>
289
-        /// 返回表单或Url参数的总个数
290
-        /// </summary>
291
-        /// <returns></returns>
292
-        public static int GetParamCount()
293
-        {
294
-            return HttpContext.Current.Request.Form.Count + HttpContext.Current.Request.QueryString.Count;
295
-        }
296
-
297
-
298
-        /// <summary>
299
-        /// 获得指定表单参数的值
300
-        /// </summary>
301
-        /// <param name="strName">表单参数</param>
302
-        /// <returns>表单参数的值</returns>
303
-        public static string GetFormString(string strName)
304
-        {
305
-            return GetFormString(strName, false);
306
-        }
307
-
308
-        /// <summary>
309
-        /// 获得指定表单参数的值
310
-        /// </summary>
311
-        /// <param name="strName">表单参数</param>
312
-        /// <param name="sqlSafeCheck">是否进行SQL安全检查</param>
313
-        /// <returns>表单参数的值</returns>
314
-        public static string GetFormString(string strName, bool sqlSafeCheck)
315
-        {
316
-            if (HttpContext.Current.Request.Form[strName] == null)
317
-                return "";
318
-
319
-            if (sqlSafeCheck && !IsSafeSqlString(HttpContext.Current.Request.Form[strName]))
320
-                return "";
321
-
322
-            return HttpContext.Current.Request.Form[strName];
323
-        }
324
-
325
-
326
-        /// <summary>
327
-        /// 获得指定表单参数的值
328
-        /// </summary>
329
-        /// <param name="strName">表单参数</param>
330
-        /// <param name="sqlSafeCheck">是否进行SQL安全检查</param>
331
-        /// <param name="defValue">当SQL安全检查不通过或无值时的默认值</param>
332
-        /// <returns>表单参数的值</returns>
333
-        public static string GetFormString(string strName, bool sqlSafeCheck, string defValue)
334
-        {
335
-            if (HttpContext.Current.Request.Form[strName] == null)
336
-                return defValue;
337
-
338
-            if (sqlSafeCheck && !IsSafeSqlString(HttpContext.Current.Request.Form[strName]))
339
-                return defValue;
340
-
341
-            return HttpContext.Current.Request.Form[strName];
342
-        }
343
-
344
-        /// <summary>
345
-        /// 获得Url或表单参数的值, 先判断Url参数是否为空字符串, 如为True则返回表单参数的值
346
-        /// </summary>
347
-        /// <param name="strName">参数</param>
348
-        /// <returns>Url或表单参数的值</returns>
349
-        public static string GetString(string strName)
350
-        {
351
-            return GetString(strName, false);
352
-        }
353
-
354
-        /// <summary>
355
-        /// 获得Url或表单参数的值, 先判断Url参数是否为空字符串, 如为True则返回表单参数的值
356
-        /// </summary>
357
-        /// <param name="strName">参数</param>
358
-        /// <param name="sqlSafeCheck">是否进行SQL安全检查</param>
359
-        /// <returns>Url或表单参数的值</returns>
360
-        public static string GetString(string strName, bool sqlSafeCheck)
361
-        {
362
-            if ("".Equals(GetQueryString(strName)))
363
-                return GetFormString(strName, sqlSafeCheck);
364
-            return GetQueryString(strName, sqlSafeCheck);
365
-        }
366
-
367
-        /// <summary>
368
-        /// 获得Url或表单参数的值, 先判断Url参数是否为空字符串, 如为True则返回表单参数的值
369
-        /// </summary>
370
-        /// <param name="strName">参数</param>
371
-        /// <param name="sqlSafeCheck">是否进行SQL安全检查</param>
372
-        /// <param name="defValue">当SQL安全检查不通过或无值时的默认值</param>
373
-        /// <returns>Url或表单参数的值</returns>
374
-        public static string GetString(string strName, bool sqlSafeCheck, string defValue)
375
-        {
376
-            if ("".Equals(GetQueryString(strName)))
377
-                return GetFormString(strName, sqlSafeCheck, defValue);
378
-            return GetQueryString(strName, sqlSafeCheck, defValue);
379
-        }
380
-
381
-        /// <summary>
382
-        /// 获得指定Url参数的int类型值
383
-        /// </summary>
384
-        /// <param name="strName">Url参数</param>
385
-        /// <returns>Url参数的int类型值</returns>
386
-        public static int GetQueryInt(string strName)
387
-        {
388
-            return TypeConverter.StrToInt(HttpContext.Current.Request.QueryString[strName], 0);
389
-        }
390
-
391
-
392
-        /// <summary>
393
-        /// 获得指定Url参数的int类型值
394
-        /// </summary>
395
-        /// <param name="strName">Url参数</param>
396
-        /// <param name="defValue">缺省值</param>
397
-        /// <returns>Url参数的int类型值</returns>
398
-        public static int GetQueryInt(string strName, int defValue)
399
-        {
400
-            return TypeConverter.StrToInt(HttpContext.Current.Request.QueryString[strName], defValue);
401
-        }
402
-
403
-
404
-        /// <summary>
405
-        /// 获得指定表单参数的int类型值
406
-        /// </summary>
407
-        /// <param name="strName">表单参数</param>
408
-        /// <param name="defValue">缺省值</param>
409
-        /// <returns>表单参数的int类型值</returns>
410
-        public static int GetFormInt(string strName, int defValue)
411
-        {
412
-            return TypeConverter.StrToInt(HttpContext.Current.Request.Form[strName], defValue);
413
-        }
414
-
415
-        /// <summary>
416
-        /// 获得指定Url或表单参数的int类型值, 先判断Url参数是否为缺省值, 如为True则返回表单参数的值
417
-        /// </summary>
418
-        /// <param name="strName">Url或表单参数</param>
419
-        /// <param name="defValue">缺省值</param>
420
-        /// <returns>Url或表单参数的int类型值</returns>
421
-        public static int GetInt(string strName, int defValue)
422
-        {
423
-            if (GetQueryInt(strName, defValue) == defValue)
424
-                return GetFormInt(strName, defValue);
425
-            return GetQueryInt(strName, defValue);
426
-        }
427
-
428
-        /// <summary>
429
-        /// 获得指定Url参数的float类型值
430
-        /// </summary>
431
-        /// <param name="strName">Url参数</param>
432
-        /// <param name="defValue">缺省值</param>
433
-        /// <returns>Url参数的int类型值</returns>
434
-        public static float GetQueryFloat(string strName, float defValue)
435
-        {
436
-            return TypeConverter.StrToFloat(HttpContext.Current.Request.QueryString[strName], defValue);
437
-        }
438
-
439
-
440
-        /// <summary>
441
-        /// 获得指定表单参数的float类型值
442
-        /// </summary>
443
-        /// <param name="strName">表单参数</param>
444
-        /// <param name="defValue">缺省值</param>
445
-        /// <returns>表单参数的float类型值</returns>
446
-        public static float GetFormFloat(string strName, float defValue)
447
-        {
448
-            return TypeConverter.StrToFloat(HttpContext.Current.Request.Form[strName], defValue);
449
-        }
450
-
451
-        /// <summary>
452
-        /// 获得指定Url或表单参数的float类型值, 先判断Url参数是否为缺省值, 如为True则返回表单参数的值
453
-        /// </summary>
454
-        /// <param name="strName">Url或表单参数</param>
455
-        /// <param name="defValue">缺省值</param>
456
-        /// <returns>Url或表单参数的int类型值</returns>
457
-        public static float GetFloat(string strName, float defValue)
458
-        {
459
-            if (GetQueryFloat(strName, defValue) == defValue)
460
-                return GetFormFloat(strName, defValue);
461
-            return GetQueryFloat(strName, defValue);
462
-        }
463
-
464
-        /// <summary>
465
-        /// 获得当前页面客户端的IP
466
-        /// </summary>
467
-        /// <returns>当前页面客户端的IP</returns>
468
-        //public static string GetIP()
469
-        //{
470
-        //    string result = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
471
-        //    if (string.IsNullOrEmpty(result))
472
-        //        result = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
473
-
474
-        //    if (string.IsNullOrEmpty(result))
475
-        //        result = HttpContext.Current.Request.UserHostAddress;
476
-
477
-        //    if (string.IsNullOrEmpty(result) || !ValidateString.IsIP(result))
478
-        //        return "127.0.0.1";
479
-
480
-        //    return result;
481
-        //}
482
-
483
-        /// <summary>
484
-        /// 获取URL地址的网页内容
485
-        /// </summary>
486
-        public class GetUrlText
487
-        {
488
-            /// <summary>
489
-            /// Gets the text.
490
-            /// </summary>
491
-            /// <param name="url">地址 The URL.</param>
492
-            /// <param name="Encoding">编码 The encoding.</param>
493
-            /// <returns></returns>
494
-            public static string GetText(string url, string Encoding)
495
-            {
496
-                WebResponse wr_result = null;
497
-                var txthtml = new StringBuilder();
498
-                try
499
-                {
500
-                    WebRequest wr_req = WebRequest.Create(url);
501
-                    wr_result = wr_req.GetResponse();
502
-                    Stream ReceiveStream = wr_result.GetResponseStream();
503
-                    Encoding encode = System.Text.Encoding.GetEncoding(Encoding);
504
-                    var sr = new StreamReader(ReceiveStream, encode);
505
-                    if (true)
506
-                    {
507
-                        var read = new Char[256];
508
-                        int count = sr.Read(read, 0, 256);
509
-                        while (count > 0)
510
-                        {
511
-                            var str = new String(read, 0, count);
512
-                            txthtml.Append(str);
513
-                            count = sr.Read(read, 0, 256);
514
-                        }
515
-                    }
516
-                }
517
-                catch (Exception)
518
-                {
519
-                    txthtml.Append("err");
520
-                }
521
-                finally
522
-                {
523
-                    if (wr_result != null)
524
-                    {
525
-                        wr_result.Close();
526
-                    }
527
-                }
528
-                return txthtml.ToString();
529
-            }
530
-
531
-            //public static string GetText(string HttpUrl)
532
-            //{
533
-            //    try
534
-            //    {
535
-            //        HttpHelper http = new HttpHelper();
536
-            //        HttpItem item = new HttpItem()
537
-            //        {
538
-            //            URL = HttpUrl,//URL     必需项    
539
-            //            Method = "get",//URL     可选项 默认为Get   
540
-            //            IsToLower = false,//得到的HTML代码是否转成小写     可选项默认转小写   
541
-            //            Cookie = "",//字符串Cookie     可选项   
542
-            //            Referer = "",//来源URL     可选项   
543
-            //            Postdata = "",//Post数据     可选项GET时不需要写   
544
-            //            Timeout = 100000,//连接超时时间     可选项默认为100000    
545
-            //            ReadWriteTimeout = 30000,//写入Post数据超时时间     可选项默认为30000   
546
-            //            ContentType = "text/html",//返回类型    可选项有默认值   
547
-            //            Allowautoredirect = false,//是否根据301跳转     可选项   
548
-            //            //CerPath = "d:\123.cer",//证书绝对路径     可选项不需要证书时可以不写这个参数   
549
-            //            //Connectionlimit = 1024,//最大连接数     可选项 默认为1024    
550
-            //            ProxyIp = "",//代理服务器ID     可选项 不需要代理 时可以不设置这三个参数    
551
-            //            //ProxyPwd = "123456",//代理服务器密码     可选项    
552
-            //            //ProxyUserName = "administrator",//代理服务器账户名     可选项   
553
-            //        };
554
-            //        var result = http.GetHtml(item);
555
-            //        string html = result.Html;
556
-            //        return html;
557
-            //        //var request = (HttpWebRequest)HttpWebRequest.Create(HttpUrl);
558
-            //        //var response = (HttpWebResponse)request.GetResponse();
559
-            //        //var strConfig = String.Empty;
560
-            //        //using (var reader = new StreamReader(response.GetResponseStream()))
561
-            //        //{
562
-            //        //    strConfig = reader.ReadToEnd();
563
-            //        //}
564
-            //        //return strConfig;
565
-            //    }
566
-            //    catch (Exception)
567
-            //    {
568
-
569
-            //        return "";
570
-            //    }
571
-            //}
572
-            
573
-        }
574
-
575
-        /// 转全角的函数(SBC case)
576
-        ///
577
-        ///任意字符串
578
-        ///全角字符串
579
-        ///
580
-        ///全角空格为12288,半角空格为32
581
-        ///其他字符半角(33-126)与全角(65281-65374)的对应关系是:均相差65248
582
-        ///
583
-        public static String ToSBC(String input)
584
-        {
585
-            // 半角转全角:
586
-            char[] c = input.ToCharArray();
587
-            for (int i = 0; i < c.Length; i++)
588
-            {
589
-                if (c[i] == 32)
590
-                {
591
-                    c[i] = (char)12288;
592
-                    continue;
593
-                }
594
-                if (c[i] < 127)
595
-                    c[i] = (char)(c[i] + 65248);
596
-            }
597
-            return new String(c);
598
-        }
599
-
600
-        /**/
601
-        // /
602
-        // / 转半角的函数(DBC case)
603
-        // /
604
-        // /任意字符串
605
-        // /半角字符串
606
-        // /
607
-        // /全角空格为12288,半角空格为32
608
-        // /其他字符半角(33-126)与全角(65281-65374)的对应关系是:均相差65248
609
-        // /
610
-        public static String ToDBC(String input)
611
-        {
612
-            char[] c = input.ToCharArray();
613
-            for (int i = 0; i < c.Length; i++)
614
-            {
615
-                if (c[i] == 12288)
616
-                {
617
-                    c[i] = (char)32;
618
-                    continue;
619
-                }
620
-                if (c[i] > 65280 && c[i] < 65375)
621
-                    c[i] = (char)(c[i] - 65248);
622
-            }
623
-            return new String(c);
624
-        }
625
-        /// <summary>
626
-        /// 去掉所有的非数字
627
-        /// </summary>
628
-        /// <param name="key"></param>
629
-        /// <returns></returns>
630
-        public static string RemoveNotNumber(string key)
631
-        {
632
-            return Regex.Replace(key, @"[^\d]*", "");
633
-        }
634
-        /// <summary>
635
-        /// 去掉所有的数字
636
-        /// </summary>
637
-        /// <param name="key"></param>
638
-        /// <returns></returns>
639
-        public static string RemoveNumber(string key)
640
-        {
641
-            return Regex.Replace(key, @"\d", "");
642
-        }
643
-    }
644
-}

+ 0 - 164
RMYY_CallCenter_Api.Utility/Request/TypeConverter.cs

@@ -1,164 +0,0 @@
1
-using System;
2
-using System.Text.RegularExpressions;
3
-
4
-namespace RMYY_CallCenter_Api.Utility
5
-{
6
-    /// <summary>
7
-    /// 数据转换操作类
8
-    /// </summary>
9
-    public class TypeConverter
10
-    {
11
-        /// <summary>
12
-        /// string型转换为bool型
13
-        /// </summary>
14
-        /// <param name="expression">要转换的字符串</param>
15
-        /// <param name="defValue">缺省值</param>
16
-        /// <returns>转换后的bool类型结果</returns>
17
-        public static bool StrToBool(object expression, bool defValue)
18
-        {
19
-            if (expression != null)
20
-                return StrToBool(expression, defValue);
21
-
22
-            return defValue;
23
-        }
24
-
25
-        /// <summary>
26
-        /// string型转换为bool型
27
-        /// </summary>
28
-        /// <param name="expression">要转换的字符串</param>
29
-        /// <param name="defValue">缺省值</param>
30
-        /// <returns>转换后的bool类型结果</returns>
31
-        public static bool StrToBool(string expression, bool defValue)
32
-        {
33
-            if (expression != null)
34
-            {
35
-                if (String.Compare(expression, "true", StringComparison.OrdinalIgnoreCase) == 0)
36
-                    return true;
37
-                if (String.Compare(expression, "false", StringComparison.OrdinalIgnoreCase) == 0)
38
-                    return false;
39
-            }
40
-            return defValue;
41
-        }
42
-
43
-        /// <summary>
44
-        /// 将对象转换为Int32类型
45
-        /// </summary>
46
-        /// <param name="expression">要转换的字符串</param>
47
-        /// <returns>转换后的int类型结果</returns>
48
-        public static int ObjectToInt(object expression)
49
-        {
50
-            return ObjectToInt(expression, 0);
51
-        }
52
-
53
-        /// <summary>
54
-        /// 将对象转换为Int32类型
55
-        /// </summary>
56
-        /// <param name="expression">要转换的字符串</param>
57
-        /// <param name="defValue">缺省值</param>
58
-        /// <returns>转换后的int类型结果</returns>
59
-        public static int ObjectToInt(object expression, int defValue)
60
-        {
61
-            if (expression != null)
62
-                return StrToInt(expression.ToString(), defValue);
63
-
64
-            return defValue;
65
-        }
66
-
67
-        /// <summary>
68
-        /// 将对象转换为Int32类型,转换失败返回0
69
-        /// </summary>
70
-        /// <param name="str">要转换的字符串</param>
71
-        /// <returns>转换后的int类型结果</returns>
72
-        public static int StrToInt(string str)
73
-        {
74
-            return StrToInt(str, 0);
75
-        }
76
-
77
-        /// <summary>
78
-        /// 将对象转换为Int32类型
79
-        /// </summary>
80
-        /// <param name="str">要转换的字符串</param>
81
-        /// <param name="defValue">缺省值</param>
82
-        /// <returns>转换后的int类型结果</returns>
83
-        public static int StrToInt(string str, int defValue)
84
-        {
85
-            if (string.IsNullOrEmpty(str) || str.Trim().Length >= 11 || !Regex.IsMatch(str.Trim(), @"^([-]|[0-9])[0-9]*(\.\w*)?$"))
86
-                return defValue;
87
-
88
-            int rv;
89
-            if (Int32.TryParse(str, out rv))
90
-                return rv;
91
-
92
-            return Convert.ToInt32(StrToFloat(str, defValue));
93
-        }
94
-
95
-        /// <summary>
96
-        /// string型转换为float型
97
-        /// </summary>
98
-        /// <param name="strValue">要转换的字符串</param>
99
-        /// <param name="defValue">缺省值</param>
100
-        /// <returns>转换后的int类型结果</returns>
101
-        public static float StrToFloat(object strValue, float defValue)
102
-        {
103
-            if ((strValue == null))
104
-                return defValue;
105
-
106
-            return StrToFloat(strValue.ToString(), defValue);
107
-        }
108
-
109
-        /// <summary>
110
-        /// string型转换为float型
111
-        /// </summary>
112
-        /// <param name="strValue">要转换的字符串</param>
113
-        /// <param name="defValue">缺省值</param>
114
-        /// <returns>转换后的int类型结果</returns>
115
-        public static float ObjectToFloat(object strValue, float defValue)
116
-        {
117
-            if ((strValue == null))
118
-                return defValue;
119
-
120
-            return StrToFloat(strValue.ToString(), defValue);
121
-        }
122
-
123
-        /// <summary>
124
-        /// string型转换为float型
125
-        /// </summary>
126
-        /// <param name="strValue">要转换的字符串</param>
127
-        /// <returns>转换后的int类型结果</returns>
128
-        public static float ObjectToFloat(object strValue)
129
-        {
130
-            return ObjectToFloat(strValue.ToString(), 0);
131
-        }
132
-
133
-        /// <summary>
134
-        /// string型转换为float型
135
-        /// </summary>
136
-        /// <param name="strValue">要转换的字符串</param>
137
-        /// <returns>转换后的int类型结果</returns>
138
-        public static float StrToFloat(object strValue)
139
-        {
140
-            if ((strValue == null))
141
-                return 0;
142
-
143
-            return StrToFloat(strValue.ToString(), 0);
144
-        }
145
-
146
-        /// <summary>
147
-        /// string型转换为float型
148
-        /// </summary>
149
-        /// <param name="strValue">要转换的字符串</param>
150
-        /// <param name="defValue">缺省值</param>
151
-        /// <returns>转换后的int类型结果</returns>
152
-        public static float StrToFloat(string strValue, float defValue)
153
-        {
154
-            if ((strValue == null) || (strValue.Length > 10))
155
-                return defValue;
156
-
157
-            float intValue = defValue;
158
-            bool IsFloat = Regex.IsMatch(strValue, @"^([-]|[0-9])[0-9]*(\.\w*)?$");
159
-            if (IsFloat)
160
-                float.TryParse(strValue, out intValue);
161
-            return intValue;
162
-        }
163
-    }
164
-}

+ 0 - 397
RMYY_CallCenter_Api.Utility/Web/WebHelper.cs

@@ -1,397 +0,0 @@
1
-using System;
2
-using System.Collections.Generic;
3
-using System.IO;
4
-using System.Net;
5
-using System.Text;
6
-using System.Text.RegularExpressions;
7
-using System.Web;
8
-namespace RMYY_CallCenter_Api.Utility
9
-{
10
-    public class WebHelper
11
-    {
12
-        #region ResolveUrl(解析相对Url)
13
-        /// <summary>
14
-        /// 解析相对Url
15
-        /// </summary>
16
-        /// <param name="relativeUrl">相对Url</param>
17
-        public static string ResolveUrl(string relativeUrl)
18
-        {
19
-            if (string.IsNullOrWhiteSpace(relativeUrl))
20
-                return string.Empty;
21
-            relativeUrl = relativeUrl.Replace("\\", "/");
22
-            if (relativeUrl.StartsWith("/"))
23
-                return relativeUrl;
24
-            if (relativeUrl.Contains("://"))
25
-                return relativeUrl;
26
-            return VirtualPathUtility.ToAbsolute(relativeUrl);
27
-        }
28
-
29
-        #endregion
30
-
31
-        #region HtmlEncode(对html字符串进行编码)
32
-        /// <summary>
33
-        /// 对html字符串进行编码
34
-        /// </summary>
35
-        /// <param name="html">html字符串</param>
36
-        public static string HtmlEncode(string html)
37
-        {
38
-            return HttpUtility.HtmlEncode(html);
39
-        }
40
-        /// <summary>
41
-        /// 对html字符串进行解码
42
-        /// </summary>
43
-        /// <param name="html">html字符串</param>
44
-        public static string HtmlDecode(string html)
45
-        {
46
-            return HttpUtility.HtmlDecode(html);
47
-        }
48
-
49
-        #endregion
50
-
51
-        #region UrlEncode(对Url进行编码)
52
-
53
-        /// <summary>
54
-        /// 对Url进行编码
55
-        /// </summary>
56
-        /// <param name="url">url</param>
57
-        /// <param name="isUpper">编码字符是否转成大写,范例,"http://"转成"http%3A%2F%2F"</param>
58
-        public static string UrlEncode(string url, bool isUpper = false)
59
-        {
60
-            return UrlEncode(url, Encoding.UTF8, isUpper);
61
-        }
62
-
63
-        /// <summary>
64
-        /// 对Url进行编码
65
-        /// </summary>
66
-        /// <param name="url">url</param>
67
-        /// <param name="encoding">字符编码</param>
68
-        /// <param name="isUpper">编码字符是否转成大写,范例,"http://"转成"http%3A%2F%2F"</param>
69
-        public static string UrlEncode(string url, Encoding encoding, bool isUpper = false)
70
-        {
71
-            var result = HttpUtility.UrlEncode(url, encoding);
72
-            if (!isUpper)
73
-                return result;
74
-            return GetUpperEncode(result);
75
-        }
76
-
77
-        /// <summary>
78
-        /// 获取大写编码字符串
79
-        /// </summary>
80
-        private static string GetUpperEncode(string encode)
81
-        {
82
-            var result = new StringBuilder();
83
-            int index = int.MinValue;
84
-            for (int i = 0; i < encode.Length; i++)
85
-            {
86
-                string character = encode[i].ToString();
87
-                if (character == "%")
88
-                    index = i;
89
-                if (i - index == 1 || i - index == 2)
90
-                    character = character.ToUpper();
91
-                result.Append(character);
92
-            }
93
-            return result.ToString();
94
-        }
95
-
96
-        #endregion
97
-
98
-        #region UrlDecode(对Url进行解码)
99
-
100
-        /// <summary>
101
-        /// 对Url进行解码,对于javascript的encodeURIComponent函数编码参数,应使用utf-8字符编码来解码
102
-        /// </summary>
103
-        /// <param name="url">url</param>
104
-        public static string UrlDecode(string url)
105
-        {
106
-            return HttpUtility.UrlDecode(url);
107
-        }
108
-
109
-        /// <summary>
110
-        /// 对Url进行解码,对于javascript的encodeURIComponent函数编码参数,应使用utf-8字符编码来解码
111
-        /// </summary>
112
-        /// <param name="url">url</param>
113
-        /// <param name="encoding">字符编码,对于javascript的encodeURIComponent函数编码参数,应使用utf-8字符编码来解码</param>
114
-        public static string UrlDecode(string url, Encoding encoding)
115
-        {
116
-            return HttpUtility.UrlDecode(url, encoding);
117
-        }
118
-
119
-        #endregion
120
-
121
-        #region Session操作
122
-        /// <summary>
123
-        /// 写Session
124
-        /// </summary>
125
-        /// <typeparam name="T">Session键值的类型</typeparam>
126
-        /// <param name="key">Session的键名</param>
127
-        /// <param name="value">Session的键值</param>
128
-        public static void WriteSession<T>(string key, T value)
129
-        {
130
-            if (string.IsNullOrWhiteSpace(key))
131
-                return;
132
-            HttpContext.Current.Session[key] = value;
133
-        }
134
-
135
-        /// <summary>
136
-        /// 写Session
137
-        /// </summary>
138
-        /// <param name="key">Session的键名</param>
139
-        /// <param name="value">Session的键值</param>
140
-        public static void WriteSession(string key, string value)
141
-        {
142
-            WriteSession<string>(key, value);
143
-        }
144
-
145
-        /// <summary>
146
-        /// 读取Session的值
147
-        /// </summary>
148
-        /// <param name="key">Session的键名</param>        
149
-        public static string GetSession(string key)
150
-        {
151
-            if (string.IsNullOrWhiteSpace(key))
152
-                return string.Empty;
153
-            return HttpContext.Current.Session[key] as string;
154
-        }
155
-        /// <summary>
156
-        /// 删除指定Session
157
-        /// </summary>
158
-        /// <param name="key">Session的键名</param>
159
-        public static void RemoveSession(string key)
160
-        {
161
-            if (string.IsNullOrWhiteSpace(key))
162
-                return;
163
-            HttpContext.Current.Session.Contents.Remove(key);
164
-        }
165
-
166
-        #endregion
167
-
168
-        #region Cookie操作
169
-        /// <summary>
170
-        /// 写cookie值
171
-        /// </summary>
172
-        /// <param name="strName">名称</param>
173
-        /// <param name="strValue">值</param>
174
-        public static void WriteCookie(string strName, string strValue)
175
-        {
176
-            HttpCookie cookie = HttpContext.Current.Request.Cookies[strName];
177
-            if (cookie == null)
178
-            {
179
-                cookie = new HttpCookie(strName);
180
-            }
181
-            cookie.Value = strValue;
182
-            HttpContext.Current.Response.AppendCookie(cookie);
183
-        }
184
-        /// <summary>
185
-        /// 写cookie值
186
-        /// </summary>
187
-        /// <param name="strName">名称</param>
188
-        /// <param name="strValue">值</param>
189
-        /// <param name="strValue">过期时间(分钟)</param>
190
-        public static void WriteCookie(string strName, string strValue, int expires)
191
-        {
192
-            HttpCookie cookie = HttpContext.Current.Request.Cookies[strName];
193
-            if (cookie == null)
194
-            {
195
-                cookie = new HttpCookie(strName);
196
-            }
197
-            cookie.Value = strValue;
198
-            cookie.Expires = DateTime.Now.AddMinutes(expires);
199
-            HttpContext.Current.Response.AppendCookie(cookie);
200
-        }
201
-        /// <summary>
202
-        /// 读cookie值
203
-        /// </summary>
204
-        /// <param name="strName">名称</param>
205
-        /// <returns>cookie值</returns>
206
-        public static string GetCookie(string strName)
207
-        {
208
-            if (HttpContext.Current.Request.Cookies != null && HttpContext.Current.Request.Cookies[strName] != null)
209
-            {
210
-                return HttpContext.Current.Request.Cookies[strName].Value.ToString();
211
-            }
212
-            return "";
213
-        }
214
-        /// <summary>
215
-        /// 删除Cookie对象
216
-        /// </summary>
217
-        /// <param name="CookiesName">Cookie对象名称</param>
218
-        public static void RemoveCookie(string CookiesName)
219
-        {
220
-            HttpCookie objCookie = new HttpCookie(CookiesName.Trim());
221
-            objCookie.Expires = DateTime.Now.AddYears(-5);
222
-            HttpContext.Current.Response.Cookies.Add(objCookie);
223
-        }
224
-        #endregion
225
-
226
-        #region GetFileControls(获取客户端文件控件集合)
227
-
228
-        /// <summary>
229
-        /// 获取有效客户端文件控件集合,文件控件必须上传了内容,为空将被忽略,
230
-        /// 注意:Form标记必须加入属性 enctype="multipart/form-data",服务器端才能获取客户端file控件.
231
-        /// </summary>
232
-        public static List<HttpPostedFile> GetFileControls()
233
-        {
234
-            var result = new List<HttpPostedFile>();
235
-            var files = HttpContext.Current.Request.Files;
236
-            if (files.Count == 0)
237
-                return result;
238
-            for (int i = 0; i < files.Count; i++)
239
-            {
240
-                var file = files[i];
241
-                if (file.ContentLength == 0)
242
-                    continue;
243
-                result.Add(files[i]);
244
-            }
245
-            return result;
246
-        }
247
-
248
-        #endregion
249
-
250
-        #region GetFileControl(获取第一个有效客户端文件控件)
251
-
252
-        /// <summary>
253
-        /// 获取第一个有效客户端文件控件,文件控件必须上传了内容,为空将被忽略,
254
-        /// 注意:Form标记必须加入属性 enctype="multipart/form-data",服务器端才能获取客户端file控件.
255
-        /// </summary>
256
-        public static HttpPostedFile GetFileControl()
257
-        {
258
-            var files = GetFileControls();
259
-            if (files == null || files.Count == 0)
260
-                return null;
261
-            return files[0];
262
-        }
263
-
264
-        #endregion
265
-
266
-        #region HttpWebRequest(请求网络资源)
267
-
268
-        /// <summary>
269
-        /// 请求网络资源,返回响应的文本
270
-        /// </summary>
271
-        /// <param name="url">网络资源地址</param>
272
-        public static string HttpWebRequest(string url)
273
-        {
274
-            return HttpWebRequest(url, string.Empty, Encoding.GetEncoding("utf-8"));
275
-        }
276
-
277
-        /// <summary>
278
-        /// 请求网络资源,返回响应的文本
279
-        /// </summary>
280
-        /// <param name="url">网络资源Url地址</param>
281
-        /// <param name="parameters">提交的参数,格式:参数1=参数值1&amp;参数2=参数值2</param>
282
-        public static string HttpWebRequest(string url, string parameters)
283
-        {
284
-            return HttpWebRequest(url, parameters, Encoding.GetEncoding("utf-8"), true);
285
-        }
286
-
287
-        /// <summary>
288
-        /// 请求网络资源,返回响应的文本
289
-        /// </summary>
290
-        /// <param name="url">网络资源地址</param>
291
-        /// <param name="parameters">提交的参数,格式:参数1=参数值1&amp;参数2=参数值2</param>
292
-        /// <param name="encoding">字符编码</param>
293
-        /// <param name="isPost">是否Post提交</param>
294
-        /// <param name="contentType">内容类型</param>
295
-        /// <param name="cookie">Cookie容器</param>
296
-        /// <param name="timeout">超时时间</param>
297
-        public static string HttpWebRequest(string url, string parameters, Encoding encoding, bool isPost = false,
298
-             string contentType = "application/x-www-form-urlencoded", CookieContainer cookie = null, int timeout = 120000)
299
-        {
300
-            var request = (HttpWebRequest)WebRequest.Create(url);
301
-            request.Timeout = timeout;
302
-            request.CookieContainer = cookie;
303
-            if (isPost)
304
-            {
305
-                byte[] postData = encoding.GetBytes(parameters);
306
-                request.Method = "POST";
307
-                request.ContentType = contentType;
308
-                request.ContentLength = postData.Length;
309
-                using (Stream stream = request.GetRequestStream())
310
-                {
311
-                    stream.Write(postData, 0, postData.Length);
312
-                }
313
-            }
314
-            var response = (HttpWebResponse)request.GetResponse();
315
-            string result;
316
-            using (Stream stream = response.GetResponseStream())
317
-            {
318
-                if (stream == null)
319
-                    return string.Empty;
320
-                using (var reader = new StreamReader(stream, encoding))
321
-                {
322
-                    result = reader.ReadToEnd();
323
-                }
324
-            }
325
-            return result;
326
-        }
327
-
328
-        #endregion
329
-
330
-        #region 去除HTML标记
331
-        /// <summary>
332
-        /// 去除HTML标记
333
-        /// </summary>
334
-        /// <param name="NoHTML">包括HTML的源码 </param>
335
-        /// <returns>已经去除后的文字</returns>
336
-        public static string NoHtml(string Htmlstring)
337
-        {
338
-            //删除脚本
339
-            Htmlstring = Regex.Replace(Htmlstring, @"<script[^>]*?>.*?</script>", "", RegexOptions.IgnoreCase);
340
-            //删除HTML
341
-            Htmlstring = Regex.Replace(Htmlstring, @"<(.[^>]*)>", "", RegexOptions.IgnoreCase);
342
-            Htmlstring = Regex.Replace(Htmlstring, @"([\r\n])[\s]+", "", RegexOptions.IgnoreCase);
343
-            Htmlstring = Regex.Replace(Htmlstring, @"-->", "", RegexOptions.IgnoreCase);
344
-            Htmlstring = Regex.Replace(Htmlstring, @"<!--.*", "", RegexOptions.IgnoreCase);
345
-            Htmlstring = Regex.Replace(Htmlstring, @"&(quot|#34);", "\"", RegexOptions.IgnoreCase);
346
-            Htmlstring = Regex.Replace(Htmlstring, @"&(amp|#38);", "&", RegexOptions.IgnoreCase);
347
-            Htmlstring = Regex.Replace(Htmlstring, @"&(lt|#60);", "<", RegexOptions.IgnoreCase);
348
-            Htmlstring = Regex.Replace(Htmlstring, @"&(gt|#62);", ">", RegexOptions.IgnoreCase);
349
-            Htmlstring = Regex.Replace(Htmlstring, @"&(nbsp|#160);", " ", RegexOptions.IgnoreCase);
350
-            Htmlstring = Regex.Replace(Htmlstring, @"&(iexcl|#161);", "\xa1", RegexOptions.IgnoreCase);
351
-            Htmlstring = Regex.Replace(Htmlstring, @"&(cent|#162);", "\xa2", RegexOptions.IgnoreCase);
352
-            Htmlstring = Regex.Replace(Htmlstring, @"&(pound|#163);", "\xa3", RegexOptions.IgnoreCase);
353
-            Htmlstring = Regex.Replace(Htmlstring, @"&(copy|#169);", "\xa9", RegexOptions.IgnoreCase);
354
-            Htmlstring = Regex.Replace(Htmlstring, @"&#(\d+);", "", RegexOptions.IgnoreCase);
355
-            Htmlstring = Regex.Replace(Htmlstring, @"&hellip;", "", RegexOptions.IgnoreCase);
356
-            Htmlstring = Regex.Replace(Htmlstring, @"&mdash;", "", RegexOptions.IgnoreCase);
357
-            Htmlstring = Regex.Replace(Htmlstring, @"&ldquo;", "", RegexOptions.IgnoreCase);
358
-            Htmlstring.Replace("<", "");
359
-            Htmlstring = Regex.Replace(Htmlstring, @"&rdquo;", "", RegexOptions.IgnoreCase);
360
-            Htmlstring.Replace(">", "");
361
-            Htmlstring.Replace("\r\n", "");
362
-            Htmlstring = HttpContext.Current.Server.HtmlEncode(Htmlstring).Trim();
363
-            return Htmlstring;
364
-
365
-        }
366
-        #endregion
367
-
368
-        #region 格式化文本(防止SQL注入)
369
-        /// <summary>
370
-        /// 格式化文本(防止SQL注入)
371
-        /// </summary>
372
-        /// <param name="str"></param>
373
-        /// <returns></returns>
374
-        public static string Formatstr(string html)
375
-        {
376
-            System.Text.RegularExpressions.Regex regex1 = new System.Text.RegularExpressions.Regex(@"<script[\s\S]+</script *>", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
377
-            System.Text.RegularExpressions.Regex regex2 = new System.Text.RegularExpressions.Regex(@" href *= *[\s\S]*script *:", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
378
-            System.Text.RegularExpressions.Regex regex3 = new System.Text.RegularExpressions.Regex(@" on[\s\S]*=", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
379
-            System.Text.RegularExpressions.Regex regex4 = new System.Text.RegularExpressions.Regex(@"<iframe[\s\S]+</iframe *>", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
380
-            System.Text.RegularExpressions.Regex regex5 = new System.Text.RegularExpressions.Regex(@"<frameset[\s\S]+</frameset *>", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
381
-            System.Text.RegularExpressions.Regex regex10 = new System.Text.RegularExpressions.Regex(@"select", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
382
-            System.Text.RegularExpressions.Regex regex11 = new System.Text.RegularExpressions.Regex(@"update", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
383
-            System.Text.RegularExpressions.Regex regex12 = new System.Text.RegularExpressions.Regex(@"delete", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
384
-            html = regex1.Replace(html, ""); //过滤<script></script>标记
385
-            html = regex2.Replace(html, ""); //过滤href=javascript: (<A>) 属性
386
-            html = regex3.Replace(html, " _disibledevent="); //过滤其它控件的on...事件
387
-            html = regex4.Replace(html, ""); //过滤iframe
388
-            html = regex10.Replace(html, "s_elect");
389
-            html = regex11.Replace(html, "u_pudate");
390
-            html = regex12.Replace(html, "d_elete");
391
-            html = html.Replace("'", "’");
392
-            html = html.Replace("&nbsp;", " ");
393
-            return html;
394
-        }
395
-        #endregion
396
-    }
397
-}

+ 17 - 0
RMYY_CallCenter_Api/Controllers/WorkOrder/T_Dis_WorkOrderController.cs

@@ -0,0 +1,17 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Web;
5
+using System.Web.Mvc;
6
+
7
+namespace RMYY_CallCenter_Api.Controllers.WorkOrder
8
+{
9
+    public class T_Dis_WorkOrderController : BaseController
10
+    {
11
+        // GET: T_Dis_WorkOrder
12
+        public ActionResult Index()
13
+        {
14
+            return View();
15
+        }
16
+    }
17
+}

+ 2 - 0
RMYY_CallCenter_Api/RMYY_CallCenter_Api.csproj

@@ -143,6 +143,7 @@
143 143
     <Compile Include="Controllers\System\RoleController.cs" />
144 144
     <Compile Include="Controllers\System\UserAccountController.cs" />
145 145
     <Compile Include="Controllers\WorkOrder\T_Dev_WorkOrderController.cs" />
146
+    <Compile Include="Controllers\WorkOrder\T_Dis_WorkOrderController.cs" />
146 147
     <Compile Include="Controllers\WorkOrder\T_Hos_WorkOrderController.cs" />
147 148
     <Compile Include="Controllers\WorkOrder\T_Mat_WorkOrderController.cs" />
148 149
     <Compile Include="Filter\AuthorizeFilter.cs" />
@@ -179,6 +180,7 @@
179 180
   </ItemGroup>
180 181
   <ItemGroup>
181 182
     <Folder Include="App_Data\" />
183
+    <Folder Include="Views\T_Dis_WorkOrder\" />
182 184
     <Folder Include="Views\T_Hos_WorkOrder\" />
183 185
     <Folder Include="Views\WorkBase\" />
184 186
   </ItemGroup>