Przeglądaj źródła

新增短信接收模块

zhoufan 4 lat temu
rodzic
commit
aef5d0cc5e

+ 1 - 0
CallCenterApi/CallCenterApi.BLL/CallCenterApi.BLL.csproj

@@ -120,6 +120,7 @@
120 120
     <Compile Include="T_Repository_List_log.cs" />
121 121
     <Compile Include="T_Repository_Operation.cs" />
122 122
     <Compile Include="T_SMS_InternalMessages.cs" />
123
+    <Compile Include="T_SMS_Receive.cs" />
123 124
     <Compile Include="T_SMS_RecvSMS.cs" />
124 125
     <Compile Include="T_SMS_SendSMSTask.cs" />
125 126
     <Compile Include="T_SMS_SentSMS.cs" />

+ 128 - 0
CallCenterApi/CallCenterApi.BLL/T_SMS_Receive.cs

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

+ 1 - 0
CallCenterApi/CallCenterApi.DAL/CallCenterApi.DAL.csproj

@@ -120,6 +120,7 @@
120 120
     <Compile Include="T_Repository_List_log.cs" />
121 121
     <Compile Include="T_Repository_Operation.cs" />
122 122
     <Compile Include="T_SMS_InternalMessages.cs" />
123
+    <Compile Include="T_SMS_Receive.cs" />
123 124
     <Compile Include="T_SMS_RecvSMS.cs" />
124 125
     <Compile Include="T_SMS_SendSMSTask.cs" />
125 126
     <Compile Include="T_SMS_SentSMS.cs" />

+ 291 - 0
CallCenterApi/CallCenterApi.DAL/T_SMS_Receive.cs

@@ -0,0 +1,291 @@
1
+using System;
2
+using System.Data;
3
+using System.Text;
4
+using System.Data.SqlClient;
5
+using CallCenterApi.DB;
6
+
7
+namespace CallCenterApi.DAL
8
+{
9
+    /// <summary>
10
+    /// 数据访问类:T_SMS_Receive
11
+    /// </summary>
12
+    public partial class T_SMS_Receive
13
+    {
14
+        public T_SMS_Receive()
15
+        { }
16
+        #region  BasicMethod
17
+        /// <summary>
18
+        /// 是否存在该记录
19
+        /// </summary>
20
+        public bool Exists(int F_Id)
21
+        {
22
+            StringBuilder strSql = new StringBuilder();
23
+            strSql.Append("select count(1) from T_SMS_Receive with(nolock)");
24
+            strSql.Append(" where F_Id=@F_Id");
25
+            SqlParameter[] parameters = {
26
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)
27
+            };
28
+            parameters[0].Value = F_Id;
29
+
30
+            return DbHelperSQL.Exists(strSql.ToString(), parameters);
31
+        }
32
+
33
+
34
+        /// <summary>
35
+        /// 增加一条数据
36
+        /// </summary>
37
+        public int Add(CallCenterApi.Model.T_SMS_Receive model)
38
+        {
39
+            StringBuilder strSql = new StringBuilder();
40
+            strSql.Append("insert into T_SMS_Receive(");
41
+            strSql.Append("F_Telephone,F_Content,F_Time,F_ApiKey,F_AccessNo,F_State,F_CreateTime)");
42
+            strSql.Append(" values (");
43
+            strSql.Append("@F_Telephone,@F_Content,@F_Time,@F_ApiKey,@F_AccessNo,@F_State,@F_CreateTime)");
44
+            strSql.Append(";select @@IDENTITY");
45
+            SqlParameter[] parameters = {
46
+                    new SqlParameter("@F_Telephone", SqlDbType.VarChar,20),
47
+                    new SqlParameter("@F_Content", SqlDbType.NVarChar,1000),
48
+                    new SqlParameter("@F_Time", SqlDbType.DateTime),
49
+                    new SqlParameter("@F_ApiKey", SqlDbType.VarChar,50),
50
+                    new SqlParameter("@F_AccessNo", SqlDbType.VarChar,20),
51
+                    new SqlParameter("@F_State", SqlDbType.Int,4),
52
+                    new SqlParameter("@F_CreateTime", SqlDbType.DateTime)};
53
+            parameters[0].Value = model.F_Telephone;
54
+            parameters[1].Value = model.F_Content;
55
+            parameters[2].Value = model.F_Time;
56
+            parameters[3].Value = model.F_ApiKey;
57
+            parameters[4].Value = model.F_AccessNo;
58
+            parameters[5].Value = model.F_State;
59
+            parameters[6].Value = model.F_CreateTime;
60
+
61
+            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
62
+            if (obj == null)
63
+            {
64
+                return 0;
65
+            }
66
+            else
67
+            {
68
+                return Convert.ToInt32(obj);
69
+            }
70
+        }
71
+        /// <summary>
72
+        /// 更新一条数据
73
+        /// </summary>
74
+        public bool Update(CallCenterApi.Model.T_SMS_Receive model)
75
+        {
76
+            StringBuilder strSql = new StringBuilder();
77
+            strSql.Append("update T_SMS_Receive set ");
78
+            strSql.Append("F_Telephone=@F_Telephone,");
79
+            strSql.Append("F_Content=@F_Content,");
80
+            strSql.Append("F_Time=@F_Time,");
81
+            strSql.Append("F_ApiKey=@F_ApiKey,");
82
+            strSql.Append("F_AccessNo=@F_AccessNo,");
83
+            strSql.Append("F_State=@F_State,");
84
+            strSql.Append("F_CreateTime=@F_CreateTime");
85
+            strSql.Append(" where F_Id=@F_Id");
86
+            SqlParameter[] parameters = {
87
+                    new SqlParameter("@F_Telephone", SqlDbType.VarChar,20),
88
+                    new SqlParameter("@F_Content", SqlDbType.NVarChar,1000),
89
+                    new SqlParameter("@F_Time", SqlDbType.DateTime),
90
+                    new SqlParameter("@F_ApiKey", SqlDbType.VarChar,50),
91
+                    new SqlParameter("@F_AccessNo", SqlDbType.VarChar,20),
92
+                    new SqlParameter("@F_State", SqlDbType.Int,4),
93
+                    new SqlParameter("@F_CreateTime", SqlDbType.DateTime),
94
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)};
95
+            parameters[0].Value = model.F_Telephone;
96
+            parameters[1].Value = model.F_Content;
97
+            parameters[2].Value = model.F_Time;
98
+            parameters[3].Value = model.F_ApiKey;
99
+            parameters[4].Value = model.F_AccessNo;
100
+            parameters[5].Value = model.F_State;
101
+            parameters[6].Value = model.F_CreateTime;
102
+            parameters[7].Value = model.F_Id;
103
+
104
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
105
+            if (rows > 0)
106
+            {
107
+                return true;
108
+            }
109
+            else
110
+            {
111
+                return false;
112
+            }
113
+        }
114
+
115
+        /// <summary>
116
+        /// 删除一条数据
117
+        /// </summary>
118
+        public bool Delete(int F_Id)
119
+        {
120
+
121
+            StringBuilder strSql = new StringBuilder();
122
+            strSql.Append("delete from T_SMS_Receive ");
123
+            strSql.Append(" where F_Id=@F_Id");
124
+            SqlParameter[] parameters = {
125
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)
126
+            };
127
+            parameters[0].Value = F_Id;
128
+
129
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
130
+            if (rows > 0)
131
+            {
132
+                return true;
133
+            }
134
+            else
135
+            {
136
+                return false;
137
+            }
138
+        }
139
+        /// <summary>
140
+        /// 批量删除数据
141
+        /// </summary>
142
+        public bool DeleteList(string F_Idlist)
143
+        {
144
+            StringBuilder strSql = new StringBuilder();
145
+            strSql.Append("delete from T_SMS_Receive ");
146
+            strSql.Append(" where F_Id in (" + F_Idlist + ")  ");
147
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
148
+            if (rows > 0)
149
+            {
150
+                return true;
151
+            }
152
+            else
153
+            {
154
+                return false;
155
+            }
156
+        }
157
+
158
+
159
+        /// <summary>
160
+        /// 得到一个对象实体
161
+        /// </summary>
162
+        public CallCenterApi.Model.T_SMS_Receive GetModel(int F_Id)
163
+        {
164
+
165
+            StringBuilder strSql = new StringBuilder();
166
+            strSql.Append("select  top 1 F_Id,F_Telephone,F_Content,F_Time,F_ApiKey,F_AccessNo,F_State,F_CreateTime from T_SMS_Receive with(nolock)");
167
+            strSql.Append(" where F_Id=@F_Id");
168
+            SqlParameter[] parameters = {
169
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)
170
+            };
171
+            parameters[0].Value = F_Id;
172
+
173
+            CallCenterApi.Model.T_SMS_Receive model = new CallCenterApi.Model.T_SMS_Receive();
174
+            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
175
+            if (ds.Tables[0].Rows.Count > 0)
176
+            {
177
+                return DataRowToModel(ds.Tables[0].Rows[0]);
178
+            }
179
+            else
180
+            {
181
+                return null;
182
+            }
183
+        }
184
+
185
+
186
+        /// <summary>
187
+        /// 得到一个对象实体
188
+        /// </summary>
189
+        public CallCenterApi.Model.T_SMS_Receive DataRowToModel(DataRow row)
190
+        {
191
+            CallCenterApi.Model.T_SMS_Receive model = new CallCenterApi.Model.T_SMS_Receive();
192
+            if (row != null)
193
+            {
194
+                if (row["F_Id"] != null && row["F_Id"].ToString() != "")
195
+                {
196
+                    model.F_Id = int.Parse(row["F_Id"].ToString());
197
+                }
198
+                if (row["F_Telephone"] != null)
199
+                {
200
+                    model.F_Telephone = row["F_Telephone"].ToString();
201
+                }
202
+                if (row["F_Content"] != null)
203
+                {
204
+                    model.F_Content = row["F_Content"].ToString();
205
+                }
206
+                if (row["F_Time"] != null && row["F_Time"].ToString() != "")
207
+                {
208
+                    model.F_Time = DateTime.Parse(row["F_Time"].ToString());
209
+                }
210
+                if (row["F_ApiKey"] != null)
211
+                {
212
+                    model.F_ApiKey = row["F_ApiKey"].ToString();
213
+                }
214
+                if (row["F_AccessNo"] != null)
215
+                {
216
+                    model.F_AccessNo = row["F_AccessNo"].ToString();
217
+                }
218
+                if (row["F_State"] != null && row["F_State"].ToString() != "")
219
+                {
220
+                    model.F_State = int.Parse(row["F_State"].ToString());
221
+                }
222
+                if (row["F_CreateTime"] != null && row["F_CreateTime"].ToString() != "")
223
+                {
224
+                    model.F_CreateTime = DateTime.Parse(row["F_CreateTime"].ToString());
225
+                }
226
+            }
227
+            return model;
228
+        }
229
+
230
+        /// <summary>
231
+        /// 获得数据列表
232
+        /// </summary>
233
+        public DataSet GetList(string strWhere)
234
+        {
235
+            StringBuilder strSql = new StringBuilder();
236
+            strSql.Append("select F_Id,F_Telephone,F_Content,F_Time,F_ApiKey,F_AccessNo,F_State,F_CreateTime ");
237
+            strSql.Append(" FROM T_SMS_Receive with(nolock)");
238
+            if (strWhere.Trim() != "")
239
+            {
240
+                strSql.Append(" where " + strWhere);
241
+            }
242
+            return DbHelperSQL.Query(strSql.ToString());
243
+        }
244
+
245
+        /// <summary>
246
+        /// 获得前几行数据
247
+        /// </summary>
248
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
249
+        {
250
+            StringBuilder strSql = new StringBuilder();
251
+            strSql.Append("select ");
252
+            if (Top > 0)
253
+            {
254
+                strSql.Append(" top " + Top.ToString());
255
+            }
256
+            strSql.Append(" F_Id,F_Telephone,F_Content,F_Time,F_ApiKey,F_AccessNo,F_State,F_CreateTime ");
257
+            strSql.Append(" FROM T_SMS_Receive with(nolock)");
258
+            if (strWhere.Trim() != "")
259
+            {
260
+                strSql.Append(" where " + strWhere);
261
+            }
262
+            strSql.Append(" order by " + filedOrder);
263
+            return DbHelperSQL.Query(strSql.ToString());
264
+        }
265
+
266
+        /// <summary>
267
+        /// 获取记录总数
268
+        /// </summary>
269
+        public int GetRecordCount(string strWhere)
270
+        {
271
+            StringBuilder strSql = new StringBuilder();
272
+            strSql.Append("select count(1) FROM T_SMS_Receive with(nolock)");
273
+            if (strWhere.Trim() != "")
274
+            {
275
+                strSql.Append(" where " + strWhere);
276
+            }
277
+            object obj = DbHelperSQL.GetSingle(strSql.ToString());
278
+            if (obj == null)
279
+            {
280
+                return 0;
281
+            }
282
+            else
283
+            {
284
+                return Convert.ToInt32(obj);
285
+            }
286
+        }
287
+
288
+        #endregion  BasicMethod
289
+    }
290
+}
291
+

+ 1 - 0
CallCenterApi/CallCenterApi.Model/CallCenterApi.Model.csproj

@@ -88,6 +88,7 @@
88 88
     <Compile Include="T_Repository_List_Demands.cs" />
89 89
     <Compile Include="T_Repository_List_log.cs" />
90 90
     <Compile Include="T_Repository_Operation.cs" />
91
+    <Compile Include="T_SMS_Receive.cs" />
91 92
     <Compile Include="T_Sys_Achievements.cs" />
92 93
     <Compile Include="T_Sys_Class.cs" />
93 94
     <Compile Include="T_Msg_Chat.cs" />

+ 89 - 0
CallCenterApi/CallCenterApi.Model/T_SMS_Receive.cs

@@ -0,0 +1,89 @@
1
+using System;
2
+namespace CallCenterApi.Model
3
+{
4
+    /// <summary>
5
+    /// T_SMS_Receive:实体类(属性说明自动提取数据库字段的描述信息)
6
+    /// </summary>
7
+    [Serializable]
8
+    public partial class T_SMS_Receive
9
+    {
10
+        public T_SMS_Receive()
11
+        { }
12
+        #region Model
13
+        private int _f_id;
14
+        private string _f_telephone;
15
+        private string _f_content;
16
+        private DateTime? _f_time;
17
+        private string _f_apikey;
18
+        private string _f_accessno;
19
+        private int? _f_state;
20
+        private DateTime? _f_createtime;
21
+        /// <summary>
22
+        /// 
23
+        /// </summary>
24
+        public int F_Id
25
+        {
26
+            set { _f_id = value; }
27
+            get { return _f_id; }
28
+        }
29
+        /// <summary>
30
+        /// 
31
+        /// </summary>
32
+        public string F_Telephone
33
+        {
34
+            set { _f_telephone = value; }
35
+            get { return _f_telephone; }
36
+        }
37
+        /// <summary>
38
+        /// 
39
+        /// </summary>
40
+        public string F_Content
41
+        {
42
+            set { _f_content = value; }
43
+            get { return _f_content; }
44
+        }
45
+        /// <summary>
46
+        /// 
47
+        /// </summary>
48
+        public DateTime? F_Time
49
+        {
50
+            set { _f_time = value; }
51
+            get { return _f_time; }
52
+        }
53
+        /// <summary>
54
+        /// 
55
+        /// </summary>
56
+        public string F_ApiKey
57
+        {
58
+            set { _f_apikey = value; }
59
+            get { return _f_apikey; }
60
+        }
61
+        /// <summary>
62
+        /// 
63
+        /// </summary>
64
+        public string F_AccessNo
65
+        {
66
+            set { _f_accessno = value; }
67
+            get { return _f_accessno; }
68
+        }
69
+        /// <summary>
70
+        /// 
71
+        /// </summary>
72
+        public int? F_State
73
+        {
74
+            set { _f_state = value; }
75
+            get { return _f_state; }
76
+        }
77
+        /// <summary>
78
+        /// 
79
+        /// </summary>
80
+        public DateTime? F_CreateTime
81
+        {
82
+            set { _f_createtime = value; }
83
+            get { return _f_createtime; }
84
+        }
85
+        #endregion Model
86
+
87
+    }
88
+}
89
+