Procházet zdrojové kódy

信息管理 - 内部短信

lihai %!s(int64=8) %!d(string=před) roky
rodič
revize
b6b48fd67c

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

@@ -70,6 +70,7 @@
70 70
     <Compile Include="T_RepositoryCategory.cs" />
71 71
     <Compile Include="T_RepositoryInformation.cs" />
72 72
     <Compile Include="T_RepositoryLog.cs" />
73
+    <Compile Include="T_SMS_InternalMessages.cs" />
73 74
     <Compile Include="T_SMS_RecvSMS.cs" />
74 75
     <Compile Include="T_SMS_SendSMSTask.cs" />
75 76
     <Compile Include="T_SMS_SentSMS.cs" />

+ 154 - 0
CallCenterApi/CallCenterApi.BLL/T_SMS_InternalMessages.cs

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

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

@@ -71,6 +71,7 @@
71 71
     <Compile Include="T_RepositoryCategory.cs" />
72 72
     <Compile Include="T_RepositoryInformation.cs" />
73 73
     <Compile Include="T_RepositoryLog.cs" />
74
+    <Compile Include="T_SMS_InternalMessages.cs" />
74 75
     <Compile Include="T_SMS_RecvSMS.cs" />
75 76
     <Compile Include="T_SMS_SendSMSTask.cs" />
76 77
     <Compile Include="T_SMS_SentSMS.cs" />

+ 388 - 0
CallCenterApi/CallCenterApi.DAL/T_SMS_InternalMessages.cs

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

+ 2 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/CallCenterApi.Interface.csproj

@@ -181,6 +181,7 @@
181 181
     <Compile Include="Controllers\HomeController.cs" />
182 182
     <Compile Include="Controllers\IndexController.cs" />
183 183
     <Compile Include="Controllers\InfoController.cs" />
184
+    <Compile Include="Controllers\information\InternalMessagesController.cs" />
184 185
     <Compile Include="Controllers\information\NoticeController.cs" />
185 186
     <Compile Include="Controllers\knowledge\KnowledgeClassController.cs" />
186 187
     <Compile Include="Controllers\knowledge\KnowledgeController.cs" />
@@ -281,6 +282,7 @@
281 282
     <Folder Include="Views\IndexCategory\" />
282 283
     <Folder Include="Views\Index\" />
283 284
     <Folder Include="Views\Info\" />
285
+    <Folder Include="Views\InternalMessages\" />
284 286
     <Folder Include="Views\KnowledgeClass\" />
285 287
     <Folder Include="Views\Knowledge\" />
286 288
     <Folder Include="Views\Login\" />

+ 2 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/Client/ApplicationsRefreshController.cs

@@ -94,6 +94,7 @@ namespace CallCenterApi.Interface.Controllers.Client
94 94
         /// 保存信息
95 95
         /// </summary>
96 96
         /// <returns></returns>
97
+        [Authority]
97 98
         public ActionResult SaveInfo()
98 99
         {
99 100
             int id = RequestString.GetInt("id", 0);
@@ -174,6 +175,7 @@ namespace CallCenterApi.Interface.Controllers.Client
174 175
         /// </summary>
175 176
         /// <param name="ids"></param>
176 177
         /// <returns></returns>
178
+        [Authority]
177 179
         public ActionResult DelInfo(string[] ids)
178 180
         {
179 181
             if (ids != null && ids.Length > 0)

+ 1 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/Client/ArticleController.cs

@@ -127,6 +127,7 @@ namespace CallCenterApi.Interface.Controllers.Client
127 127
         /// 保存信息
128 128
         /// </summary>
129 129
         /// <returns></returns>
130
+        [Authority]
130 131
         public ActionResult AddInfo()
131 132
         {
132 133
             int id = RequestString.GetInt("id", 0);

+ 2 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/Client/FAQController.cs

@@ -101,6 +101,7 @@ namespace CallCenterApi.Interface.Controllers.Client
101 101
         /// 保存信息
102 102
         /// </summary>
103 103
         /// <returns></returns>
104
+        [Authority]
104 105
         public ActionResult AddInfo()
105 106
         {
106 107
 
@@ -180,6 +181,7 @@ namespace CallCenterApi.Interface.Controllers.Client
180 181
         /// </summary>
181 182
         /// <param name="ids"></param>
182 183
         /// <returns></returns>
184
+        [Authority]
183 185
         public ActionResult DelInfo(string[] ids)
184 186
         {
185 187
             if (ids != null && ids.Length > 0)

+ 2 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/Client/UserFeedbackController.cs

@@ -101,6 +101,7 @@ namespace CallCenterApi.Interface.Controllers.Client
101 101
         /// 保存信息
102 102
         /// </summary>
103 103
         /// <returns></returns>
104
+        [Authority]
104 105
         public ActionResult AddInfo()
105 106
         {
106 107
 
@@ -176,6 +177,7 @@ namespace CallCenterApi.Interface.Controllers.Client
176 177
         /// </summary>
177 178
         /// <param name="ids"></param>
178 179
         /// <returns></returns>
180
+        [Authority]
179 181
         public ActionResult DelInfo(string[] ids)
180 182
         {
181 183
             if (ids != null && ids.Length > 0)

+ 2 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/Client/UserGradeController.cs

@@ -106,6 +106,7 @@ namespace CallCenterApi.Interface.Controllers.Client
106 106
         /// 保存信息
107 107
         /// </summary>
108 108
         /// <returns></returns>
109
+        [Authority]
109 110
         public ActionResult AddInfo()
110 111
         {
111 112
 
@@ -184,6 +185,7 @@ namespace CallCenterApi.Interface.Controllers.Client
184 185
         /// </summary>
185 186
         /// <param name="ids"></param>
186 187
         /// <returns></returns>
188
+        [Authority]
187 189
         public ActionResult DelInfo(string[] ids)
188 190
         {
189 191
             if (ids != null && ids.Length > 0)

+ 259 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/information/InternalMessagesController.cs

@@ -0,0 +1,259 @@
1
+using CallCenter.Utility;
2
+using CallCenterApi.Interface.Controllers.Base;
3
+using System;
4
+using System.Collections.Generic;
5
+using System.Data;
6
+using System.Linq;
7
+using System.Web;
8
+using System.Web.Mvc;
9
+
10
+namespace CallCenterApi.Interface.Controllers.information
11
+{
12
+    public class InternalMessagesController : BaseController
13
+    {
14
+        BLL.T_SMS_InternalMessages bll = new BLL.T_SMS_InternalMessages();
15
+        /// <summary>
16
+        /// 获取所有列表 分页
17
+        /// </summary>
18
+        /// <returns></returns>
19
+        public ActionResult GetAllList()
20
+        {
21
+            DataTable dt = new DataTable();
22
+            string SMS_Title = HttpUtility.UrlDecode(RequestString.GetQueryString("title"));
23
+            string SMS_ReceiveUserCode = HttpUtility.UrlDecode(RequestString.GetQueryString("receiveUserCode"));
24
+            string SMS_SendUserCode = HttpUtility.UrlDecode(RequestString.GetQueryString("sendUserCode"));
25
+            string SMS_Content = HttpUtility.UrlDecode(RequestString.GetQueryString("content"));
26
+            string strstarttime = HttpUtility.UrlDecode(RequestString.GetQueryString("strstarttime"));
27
+            string strendtime = HttpUtility.UrlDecode(RequestString.GetQueryString("strendtime"));
28
+            string strpageindex = RequestString.GetQueryString("page");
29
+            int pageindex = 1;
30
+            string strpagesize = RequestString.GetQueryString("pagesize");
31
+            int pagesize = 10;
32
+
33
+            string sql = string.Empty;
34
+            if (SMS_Title.Trim() != "")
35
+            {
36
+                sql += " and SMS_Title like '%" + SMS_Title + "%'";
37
+            }
38
+            if (SMS_ReceiveUserCode.Trim() != "")
39
+            {
40
+                sql += " and SMS_ReceiveUserCode = '" + SMS_ReceiveUserCode + "'";
41
+            }
42
+            if (SMS_SendUserCode.Trim() != "")
43
+            {
44
+                sql += " and SMS_SendUserCode = '" + SMS_SendUserCode + "'";
45
+            }
46
+            if (SMS_Content.Trim() != "")
47
+            {
48
+                sql += " and SMS_Content like '%" + SMS_Content + "%'";
49
+            }
50
+            if (strstarttime.Trim() != "" && strstarttime != "undefined")
51
+            {
52
+                sql += " and datediff(day,SMS_SendUserCode,'" + strstarttime + "')<=0 ";
53
+            }
54
+            if (strendtime.Trim() != "" && strendtime != "undefined")
55
+            {
56
+                sql += " and datediff(day,SMS_SendUserCode,'" + strendtime + "')>=0   ";
57
+            }
58
+            if (strpageindex.Trim() != "")
59
+            {
60
+                pageindex = Convert.ToInt32(strpageindex);
61
+            }
62
+            if (strpagesize.Trim() != "")
63
+            {
64
+                pagesize = Convert.ToInt32(strpagesize);
65
+            }
66
+            int recordCount = 0;
67
+            dt = BLL.PagerBLL.GetListPager(
68
+                    "T_SMS_InternalMessages",
69
+                    "F_Id",
70
+                    "*",
71
+                    sql,
72
+                    "ORDER BY SMS_Id desc",
73
+                    pagesize,
74
+                    pageindex,
75
+                    true,
76
+                    out recordCount);
77
+            var obj = new
78
+            {
79
+                rows = dt,
80
+                total = recordCount
81
+            };
82
+            return Content(obj.ToJson());
83
+        }
84
+
85
+        /// <summary>
86
+        /// 获取前几条列表
87
+        /// </summary>
88
+        /// <returns></returns>
89
+        public ActionResult GetTopList()
90
+        {
91
+            DataTable dt = new DataTable();
92
+            string strWhere = string.Empty;
93
+            int Top = RequestString.GetInt("top", 5);
94
+            string SMS_ReceiveUserCode = RequestString.GetQueryString("receiveUserCode");
95
+            if (SMS_ReceiveUserCode.Trim() != "")
96
+            {
97
+                strWhere += " and SMS_ReceiveUserCode = '" + SMS_ReceiveUserCode + "'";
98
+            }
99
+            dt = bll.GetList(Top, strWhere, " SMS_Order,SMS_SendTime ").Tables[0];
100
+            var obj = new
101
+            {
102
+                rows = dt,
103
+                total = Top
104
+            };
105
+            return Content(obj.ToJson());
106
+        }
107
+
108
+        /// <summary>
109
+        /// 获取一条详细信息
110
+        /// </summary>
111
+        /// <param name="infoid"></param>
112
+        /// <returns></returns>
113
+        [Authority]
114
+        public ActionResult GetInfo(string infoid)
115
+        {
116
+            if (infoid != null && infoid.Trim() != "")
117
+            {
118
+                Model.T_SMS_InternalMessages model = bll.GetModel(int.Parse(infoid.Trim()));
119
+                
120
+                if (model != null)
121
+                {
122
+                    if (model.SMS_IsRead == 0)
123
+                    {
124
+                        model.SMS_IsRead = 1;
125
+                        model.SMS_ReadTime = DateTime.Now;
126
+                        bool b = bll.Update(model);
127
+                        if (b)
128
+                        {
129
+                            return Success("获取成功", model);
130
+                        }
131
+                        else
132
+                        {
133
+                            return Error("获取失败,无更新权限");
134
+                        }
135
+                    }
136
+                    else {
137
+                        return Success("获取成功", model);
138
+                    }
139
+                }
140
+                else
141
+                {
142
+                    return Error("获取失败");
143
+                };
144
+            }
145
+            else
146
+            {
147
+                return Error("获取参数失败");
148
+            }
149
+        }
150
+
151
+        /// <summary>
152
+        /// 保存信息
153
+        /// </summary>
154
+        /// <returns></returns>
155
+        [Authority]
156
+        public ActionResult SaveInfo()
157
+        {
158
+            int id = RequestString.GetInt("id", 0);
159
+            string SMS_Title = RequestString.GetFormString("title");
160
+            string SMS_ReceiveUserCode = RequestString.GetFormString("receiveUserCode");
161
+            string SMS_SendUserCode = RequestString.GetFormString("sendUserCode");
162
+            string SMS_Content = RequestString.GetFormString("content");
163
+            int SMS_IsDelete = RequestString.GetInt("isDelete", 0);
164
+            int SMS_IsRead = RequestString.GetInt("isRead", 0);
165
+            int SMS_Order = RequestString.GetInt("order", 0);
166
+            int SMS_IsTop = RequestString.GetInt("isTop", 0);
167
+
168
+            if (!string.IsNullOrWhiteSpace(SMS_Title) || !string.IsNullOrWhiteSpace(SMS_ReceiveUserCode) || !string.IsNullOrWhiteSpace(SMS_ReceiveUserCode))
169
+            {
170
+                Model.T_SMS_InternalMessages model = new Model.T_SMS_InternalMessages();
171
+                if (id == 0)
172
+                {
173
+                    model.SMS_Title = SMS_Title;
174
+                    model.SMS_Content = SMS_Content;
175
+                    model.SMS_ReceiveUserCode = SMS_ReceiveUserCode;
176
+                    model.SMS_SendUserCode = SMS_SendUserCode;
177
+                    model.SMS_IsRead = SMS_IsRead;
178
+                    model.SMS_SendTime = DateTime.Now;
179
+                    //model.SMS_ReadTime = SMS_ReadTime;
180
+                    //model.SMS_DeleteTime = SMS_DeleteTime;
181
+                    model.SMS_IsDelete = 0;
182
+                    model.SMS_Order = SMS_Order;
183
+                    model.SMS_IsTop = SMS_IsTop;
184
+                    int n = bll.Add(model);
185
+                    if (n > 0)
186
+                    {
187
+                        return Success("添加成功", n);
188
+                    }
189
+                    else
190
+                    {
191
+                        return Error("添加失败");
192
+                    }
193
+                }
194
+                else
195
+                {
196
+                    model = bll.GetModel(id);
197
+                    if (model != null)
198
+                    {
199
+                        model.SMS_Id = id;
200
+                        model.SMS_Title = SMS_Title;
201
+                        model.SMS_Content = SMS_Content;
202
+                        model.SMS_ReceiveUserCode = SMS_ReceiveUserCode;
203
+                        model.SMS_SendUserCode = SMS_SendUserCode;
204
+                        model.SMS_IsRead = SMS_IsRead;
205
+                        model.SMS_SendTime = model.SMS_SendTime;
206
+                        //model.SMS_ReadTime = DateTime.Now;
207
+                        //model.SMS_DeleteTime = SMS_DeleteTime;
208
+                        model.SMS_IsDelete = 0;
209
+                        model.SMS_Order = SMS_Order;
210
+                        model.SMS_IsTop = SMS_IsTop;
211
+                        if (bll.Update(model))
212
+                        {
213
+                            return Success("修改成功");
214
+                        }
215
+                        else
216
+                        {
217
+                            return Error("修改失败");
218
+                        }
219
+                    }
220
+                    return Error("信息不存在");
221
+                }
222
+            }
223
+            else
224
+            {
225
+                return Error("获取参数失败");
226
+            }
227
+        }
228
+
229
+        /// <summary>
230
+        /// 删除信息
231
+        /// </summary>
232
+        /// <param name="ids"></param>
233
+        /// <returns></returns>
234
+        [Authority]
235
+        public ActionResult DelInfo(string[] ids)
236
+        {
237
+            if (ids != null && ids.Length > 0)
238
+            {
239
+                string idd = " ";
240
+                foreach (string str in ids)
241
+                {
242
+                    idd += str + ",";
243
+                }
244
+                if (bll.DeleteList(idd.TrimEnd(',')))
245
+                {
246
+                    return Success("删除成功");
247
+                }
248
+                else
249
+                    return Error("删除失败");
250
+            }
251
+            else
252
+            {
253
+                return Error("获取参数失败");
254
+            }
255
+        }
256
+
257
+
258
+    }
259
+}

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

@@ -74,6 +74,7 @@
74 74
     <Compile Include="T_RepositoryCategory.cs" />
75 75
     <Compile Include="T_RepositoryInformation.cs" />
76 76
     <Compile Include="T_RepositoryLog.cs" />
77
+    <Compile Include="T_SMS_InternalMessages.cs" />
77 78
     <Compile Include="T_SMS_RecvSMS.cs" />
78 79
     <Compile Include="T_SMS_SendSMSTask.cs" />
79 80
     <Compile Include="T_SMS_SentSMS.cs" />

+ 124 - 0
CallCenterApi/CallCenterApi.Model/T_SMS_InternalMessages.cs

@@ -0,0 +1,124 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace CallCenterApi.Model
8
+{
9
+    public partial class T_SMS_InternalMessages
10
+    {
11
+        public T_SMS_InternalMessages()
12
+        { }
13
+        #region Model
14
+        private int _sms_id;
15
+        private string _sms_title;
16
+        private string _sms_content;
17
+        private string _sms_receiveusercode;
18
+        private string _sms_sendusercode;
19
+        private int? _sms_isread;
20
+        private DateTime? _sms_sendtime;
21
+        private DateTime? _sms_readtime;
22
+        private DateTime? _sms_deletetime;
23
+        private int? _sms_isdelete;
24
+        private int? _sms_order;
25
+        private int? _sms_istop;
26
+        /// <summary>
27
+        /// id,自增
28
+        /// </summary>
29
+        public int SMS_Id
30
+        {
31
+            set { _sms_id = value; }
32
+            get { return _sms_id; }
33
+        }
34
+        /// <summary>
35
+        /// 短信标题
36
+        /// </summary>
37
+        public string SMS_Title
38
+        {
39
+            set { _sms_title = value; }
40
+            get { return _sms_title; }
41
+        }
42
+        /// <summary>
43
+        /// 短信内容
44
+        /// </summary>
45
+        public string SMS_Content
46
+        {
47
+            set { _sms_content = value; }
48
+            get { return _sms_content; }
49
+        }
50
+        /// <summary>
51
+        /// 接收用户Code
52
+        /// </summary>
53
+        public string SMS_ReceiveUserCode
54
+        {
55
+            set { _sms_receiveusercode = value; }
56
+            get { return _sms_receiveusercode; }
57
+        }
58
+        /// <summary>
59
+        /// 发送用户Code
60
+        /// </summary>
61
+        public string SMS_SendUserCode
62
+        {
63
+            set { _sms_sendusercode = value; }
64
+            get { return _sms_sendusercode; }
65
+        }
66
+        /// <summary>
67
+        /// 是否阅读(0未阅读1已阅读)
68
+        /// </summary>
69
+        public int? SMS_IsRead
70
+        {
71
+            set { _sms_isread = value; }
72
+            get { return _sms_isread; }
73
+        }
74
+        /// <summary>
75
+        /// 发送时间
76
+        /// </summary>
77
+        public DateTime? SMS_SendTime
78
+        {
79
+            set { _sms_sendtime = value; }
80
+            get { return _sms_sendtime; }
81
+        }
82
+        /// <summary>
83
+        /// 阅读时间
84
+        /// </summary>
85
+        public DateTime? SMS_ReadTime
86
+        {
87
+            set { _sms_readtime = value; }
88
+            get { return _sms_readtime; }
89
+        }
90
+        /// <summary>
91
+        /// 删除时间
92
+        /// </summary>
93
+        public DateTime? SMS_DeleteTime
94
+        {
95
+            set { _sms_deletetime = value; }
96
+            get { return _sms_deletetime; }
97
+        }
98
+        /// <summary>
99
+        /// 是否删除(0默认1删除)
100
+        /// </summary>
101
+        public int? SMS_IsDelete
102
+        {
103
+            set { _sms_isdelete = value; }
104
+            get { return _sms_isdelete; }
105
+        }
106
+        /// <summary>
107
+        /// 排序
108
+        /// </summary>
109
+        public int? SMS_Order
110
+        {
111
+            set { _sms_order = value; }
112
+            get { return _sms_order; }
113
+        }
114
+        /// <summary>
115
+        /// 置顶(0默认1置顶)
116
+        /// </summary>
117
+        public int? SMS_IsTop
118
+        {
119
+            set { _sms_istop = value; }
120
+            get { return _sms_istop; }
121
+        }
122
+        #endregion Model
123
+    }
124
+}