mengjie лет назад: 7
Родитель
Сommit
7d23e55e34
34 измененных файлов с 8238 добавлено и 63 удалено
  1. 65 0
      HySoftSMS.DAL/HySoftSMS.DAL.csproj
  2. 36 0
      HySoftSMS.DAL/Properties/AssemblyInfo.cs
  3. 364 0
      HySoftSMS.DAL/阿里短信任务执行表.cs
  4. 491 0
      HySoftSMS.DAL/阿里短信任务表.cs
  5. 75 0
      HySoftSMS.DBUtility/CommandInfo.cs
  6. 1289 0
      HySoftSMS.DBUtility/DbHelperSQL.cs
  7. 56 0
      HySoftSMS.DBUtility/HySoftSMS.DBUtility.csproj
  8. 36 0
      HySoftSMS.DBUtility/Properties/AssemblyInfo.cs
  9. 1289 0
      HySoftSMS.Model/DbHelperSQL.cs
  10. 55 0
      HySoftSMS.Model/HySoftSMS.Model.csproj
  11. 36 0
      HySoftSMS.Model/Properties/AssemblyInfo.cs
  12. 111 0
      HySoftSMS.Model/阿里短信任务执行表.cs
  13. 237 0
      HySoftSMS.Model/阿里短信任务表.cs
  14. 46 0
      HySoftSMS.sln
  15. 46 0
      HySoftSMS/App.config
  16. 75 0
      HySoftSMS/CommandInfo.cs
  17. 1289 0
      HySoftSMS/DbHelperSQL.cs
  18. 0 39
      HySoftSMS/Form1.Designer.cs
  19. 0 20
      HySoftSMS/Form1.cs
  20. 75 0
      HySoftSMS/FrmMain.Designer.cs
  21. 178 0
      HySoftSMS/FrmMain.cs
  22. 120 0
      HySoftSMS/FrmMain.resx
  23. 55 3
      HySoftSMS/HySoftSMS.csproj
  24. 71 0
      HySoftSMS/IniFile.cs
  25. 1 1
      HySoftSMS/Program.cs
  26. 1315 0
      HySoftSMS/Utils.cs
  27. 4 0
      HySoftSMS/packages.config
  28. 109 0
      HySoftSMS/task.cs
  29. 81 0
      HySoftSMS/taskitem.cs
  30. 237 0
      HySoftSMS/阿里短信任务表.cs
  31. 65 0
      HySoftSMS。BLL/HySoftSMS.BLL.csproj
  32. 36 0
      HySoftSMS。BLL/Properties/AssemblyInfo.cs
  33. 148 0
      HySoftSMS。BLL/阿里短信任务执行表.cs
  34. 147 0
      HySoftSMS。BLL/阿里短信任务表.cs

+ 65 - 0
HySoftSMS.DAL/HySoftSMS.DAL.csproj

@@ -0,0 +1,65 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4
+  <PropertyGroup>
5
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7
+    <ProjectGuid>{184B0510-CB6C-45F1-8E4D-74DAAB55CAF2}</ProjectGuid>
8
+    <OutputType>Library</OutputType>
9
+    <AppDesignerFolder>Properties</AppDesignerFolder>
10
+    <RootNamespace>HySoftSMS.DAL</RootNamespace>
11
+    <AssemblyName>HySoftSMS.DAL</AssemblyName>
12
+    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
13
+    <FileAlignment>512</FileAlignment>
14
+  </PropertyGroup>
15
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16
+    <DebugSymbols>true</DebugSymbols>
17
+    <DebugType>full</DebugType>
18
+    <Optimize>false</Optimize>
19
+    <OutputPath>bin\Debug\</OutputPath>
20
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
21
+    <ErrorReport>prompt</ErrorReport>
22
+    <WarningLevel>4</WarningLevel>
23
+  </PropertyGroup>
24
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25
+    <DebugType>pdbonly</DebugType>
26
+    <Optimize>true</Optimize>
27
+    <OutputPath>bin\Release\</OutputPath>
28
+    <DefineConstants>TRACE</DefineConstants>
29
+    <ErrorReport>prompt</ErrorReport>
30
+    <WarningLevel>4</WarningLevel>
31
+  </PropertyGroup>
32
+  <ItemGroup>
33
+    <Reference Include="System" />
34
+    <Reference Include="System.Core" />
35
+    <Reference Include="System.Xml.Linq" />
36
+    <Reference Include="System.Data.DataSetExtensions" />
37
+    <Reference Include="Microsoft.CSharp" />
38
+    <Reference Include="System.Data" />
39
+    <Reference Include="System.Net.Http" />
40
+    <Reference Include="System.Xml" />
41
+  </ItemGroup>
42
+  <ItemGroup>
43
+    <Compile Include="阿里短信任务执行表.cs" />
44
+    <Compile Include="阿里短信任务表.cs" />
45
+    <Compile Include="Properties\AssemblyInfo.cs" />
46
+  </ItemGroup>
47
+  <ItemGroup>
48
+    <ProjectReference Include="..\HySoftSMS.DBUtility\HySoftSMS.DBUtility.csproj">
49
+      <Project>{A7E848AD-AFF7-414D-9719-51AF37915F53}</Project>
50
+      <Name>HySoftSMS.DBUtility</Name>
51
+    </ProjectReference>
52
+    <ProjectReference Include="..\HySoftSMS.Model\HySoftSMS.Model.csproj">
53
+      <Project>{e9840689-06b7-4de8-98b8-04c37a2f2f0e}</Project>
54
+      <Name>HySoftSMS.Model</Name>
55
+    </ProjectReference>
56
+  </ItemGroup>
57
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
58
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
59
+       Other similar extension points exist, see Microsoft.Common.targets.
60
+  <Target Name="BeforeBuild">
61
+  </Target>
62
+  <Target Name="AfterBuild">
63
+  </Target>
64
+  -->
65
+</Project>

+ 36 - 0
HySoftSMS.DAL/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
1
+using System.Reflection;
2
+using System.Runtime.CompilerServices;
3
+using System.Runtime.InteropServices;
4
+
5
+// 有关程序集的一般信息由以下
6
+// 控制。更改这些特性值可修改
7
+// 与程序集关联的信息。
8
+[assembly: AssemblyTitle("HySoftSMS.DAL")]
9
+[assembly: AssemblyDescription("")]
10
+[assembly: AssemblyConfiguration("")]
11
+[assembly: AssemblyCompany("")]
12
+[assembly: AssemblyProduct("HySoftSMS.DAL")]
13
+[assembly: AssemblyCopyright("Copyright ©  2018")]
14
+[assembly: AssemblyTrademark("")]
15
+[assembly: AssemblyCulture("")]
16
+
17
+//将 ComVisible 设置为 false 将使此程序集中的类型
18
+//对 COM 组件不可见。  如果需要从 COM 访问此程序集中的类型,
19
+//请将此类型的 ComVisible 特性设置为 true。
20
+[assembly: ComVisible(false)]
21
+
22
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23
+[assembly: Guid("184b0510-cb6c-45f1-8e4d-74daab55caf2")]
24
+
25
+// 程序集的版本信息由下列四个值组成: 
26
+//
27
+//      主版本
28
+//      次版本
29
+//      生成号
30
+//      修订号
31
+//
32
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33
+// 方法是按如下所示使用“*”: :
34
+// [assembly: AssemblyVersion("1.0.*")]
35
+[assembly: AssemblyVersion("1.0.0.0")]
36
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 364 - 0
HySoftSMS.DAL/阿里短信任务执行表.cs

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

+ 491 - 0
HySoftSMS.DAL/阿里短信任务表.cs

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

+ 75 - 0
HySoftSMS.DBUtility/CommandInfo.cs

@@ -0,0 +1,75 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Data.SqlClient;
4
+using System.Linq;
5
+using System.Text;
6
+using System.Threading.Tasks;
7
+
8
+namespace HySoftSMS.DBUtility
9
+{
10
+    public enum EffentNextType
11
+    {
12
+        /// <summary>
13
+        /// 对其他语句无任何影响 
14
+        /// </summary>
15
+        None,
16
+        /// <summary>
17
+        /// 当前语句必须为"select count(1) from .."格式,如果存在则继续执行,不存在回滚事务
18
+        /// </summary>
19
+        WhenHaveContine,
20
+        /// <summary>
21
+        /// 当前语句必须为"select count(1) from .."格式,如果不存在则继续执行,存在回滚事务
22
+        /// </summary>
23
+        WhenNoHaveContine,
24
+        /// <summary>
25
+        /// 当前语句影响到的行数必须大于0,否则回滚事务
26
+        /// </summary>
27
+        ExcuteEffectRows,
28
+        /// <summary>
29
+        /// 引发事件-当前语句必须为"select count(1) from .."格式,如果不存在则继续执行,存在回滚事务
30
+        /// </summary>
31
+        SolicitationEvent
32
+    }
33
+    public class CommandInfo
34
+    {
35
+        public object ShareObject = null;
36
+        public object OriginalData = null;
37
+        event EventHandler _solicitationEvent;
38
+        public event EventHandler SolicitationEvent
39
+        {
40
+            add
41
+            {
42
+                _solicitationEvent += value;
43
+            }
44
+            remove
45
+            {
46
+                _solicitationEvent -= value;
47
+            }
48
+        }
49
+        public void OnSolicitationEvent()
50
+        {
51
+            if (_solicitationEvent != null)
52
+            {
53
+                _solicitationEvent(this, new EventArgs());
54
+            }
55
+        }
56
+        public string CommandText;
57
+        public System.Data.Common.DbParameter[] Parameters;
58
+        public EffentNextType EffentNextType = EffentNextType.None;
59
+        public CommandInfo()
60
+        {
61
+
62
+        }
63
+        public CommandInfo(string sqlText, SqlParameter[] para)
64
+        {
65
+            this.CommandText = sqlText;
66
+            this.Parameters = para;
67
+        }
68
+        public CommandInfo(string sqlText, SqlParameter[] para, EffentNextType type)
69
+        {
70
+            this.CommandText = sqlText;
71
+            this.Parameters = para;
72
+            this.EffentNextType = type;
73
+        }
74
+    }
75
+}

Разница между файлами не показана из-за своего большого размера
+ 1289 - 0
HySoftSMS.DBUtility/DbHelperSQL.cs


+ 56 - 0
HySoftSMS.DBUtility/HySoftSMS.DBUtility.csproj

@@ -0,0 +1,56 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4
+  <PropertyGroup>
5
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7
+    <ProjectGuid>{A7E848AD-AFF7-414D-9719-51AF37915F53}</ProjectGuid>
8
+    <OutputType>Library</OutputType>
9
+    <AppDesignerFolder>Properties</AppDesignerFolder>
10
+    <RootNamespace>HySoftSMS.DBUtility</RootNamespace>
11
+    <AssemblyName>HySoftSMS.DBUtility</AssemblyName>
12
+    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
13
+    <FileAlignment>512</FileAlignment>
14
+  </PropertyGroup>
15
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16
+    <DebugSymbols>true</DebugSymbols>
17
+    <DebugType>full</DebugType>
18
+    <Optimize>false</Optimize>
19
+    <OutputPath>bin\Debug\</OutputPath>
20
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
21
+    <ErrorReport>prompt</ErrorReport>
22
+    <WarningLevel>4</WarningLevel>
23
+  </PropertyGroup>
24
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25
+    <DebugType>pdbonly</DebugType>
26
+    <Optimize>true</Optimize>
27
+    <OutputPath>bin\Release\</OutputPath>
28
+    <DefineConstants>TRACE</DefineConstants>
29
+    <ErrorReport>prompt</ErrorReport>
30
+    <WarningLevel>4</WarningLevel>
31
+  </PropertyGroup>
32
+  <ItemGroup>
33
+    <Reference Include="System" />
34
+    <Reference Include="System.configuration" />
35
+    <Reference Include="System.Core" />
36
+    <Reference Include="System.Xml.Linq" />
37
+    <Reference Include="System.Data.DataSetExtensions" />
38
+    <Reference Include="Microsoft.CSharp" />
39
+    <Reference Include="System.Data" />
40
+    <Reference Include="System.Net.Http" />
41
+    <Reference Include="System.Xml" />
42
+  </ItemGroup>
43
+  <ItemGroup>
44
+    <Compile Include="CommandInfo.cs" />
45
+    <Compile Include="DbHelperSQL.cs" />
46
+    <Compile Include="Properties\AssemblyInfo.cs" />
47
+  </ItemGroup>
48
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
49
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
50
+       Other similar extension points exist, see Microsoft.Common.targets.
51
+  <Target Name="BeforeBuild">
52
+  </Target>
53
+  <Target Name="AfterBuild">
54
+  </Target>
55
+  -->
56
+</Project>

+ 36 - 0
HySoftSMS.DBUtility/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
1
+using System.Reflection;
2
+using System.Runtime.CompilerServices;
3
+using System.Runtime.InteropServices;
4
+
5
+// 有关程序集的一般信息由以下
6
+// 控制。更改这些特性值可修改
7
+// 与程序集关联的信息。
8
+[assembly: AssemblyTitle("HySoftSMS.DBUtility")]
9
+[assembly: AssemblyDescription("")]
10
+[assembly: AssemblyConfiguration("")]
11
+[assembly: AssemblyCompany("")]
12
+[assembly: AssemblyProduct("HySoftSMS.DBUtility")]
13
+[assembly: AssemblyCopyright("Copyright ©  2018")]
14
+[assembly: AssemblyTrademark("")]
15
+[assembly: AssemblyCulture("")]
16
+
17
+//将 ComVisible 设置为 false 将使此程序集中的类型
18
+//对 COM 组件不可见。  如果需要从 COM 访问此程序集中的类型,
19
+//请将此类型的 ComVisible 特性设置为 true。
20
+[assembly: ComVisible(false)]
21
+
22
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23
+[assembly: Guid("a7e848ad-aff7-414d-9719-51af37915f53")]
24
+
25
+// 程序集的版本信息由下列四个值组成: 
26
+//
27
+//      主版本
28
+//      次版本
29
+//      生成号
30
+//      修订号
31
+//
32
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33
+// 方法是按如下所示使用“*”: :
34
+// [assembly: AssemblyVersion("1.0.*")]
35
+[assembly: AssemblyVersion("1.0.0.0")]
36
+[assembly: AssemblyFileVersion("1.0.0.0")]

Разница между файлами не показана из-за своего большого размера
+ 1289 - 0
HySoftSMS.Model/DbHelperSQL.cs


+ 55 - 0
HySoftSMS.Model/HySoftSMS.Model.csproj

@@ -0,0 +1,55 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4
+  <PropertyGroup>
5
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7
+    <ProjectGuid>{E9840689-06B7-4DE8-98B8-04C37A2F2F0E}</ProjectGuid>
8
+    <OutputType>Library</OutputType>
9
+    <AppDesignerFolder>Properties</AppDesignerFolder>
10
+    <RootNamespace>HySoftSMS.Model</RootNamespace>
11
+    <AssemblyName>HySoftSMS.Model</AssemblyName>
12
+    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
13
+    <FileAlignment>512</FileAlignment>
14
+  </PropertyGroup>
15
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16
+    <DebugSymbols>true</DebugSymbols>
17
+    <DebugType>full</DebugType>
18
+    <Optimize>false</Optimize>
19
+    <OutputPath>bin\Debug\</OutputPath>
20
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
21
+    <ErrorReport>prompt</ErrorReport>
22
+    <WarningLevel>4</WarningLevel>
23
+  </PropertyGroup>
24
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25
+    <DebugType>pdbonly</DebugType>
26
+    <Optimize>true</Optimize>
27
+    <OutputPath>bin\Release\</OutputPath>
28
+    <DefineConstants>TRACE</DefineConstants>
29
+    <ErrorReport>prompt</ErrorReport>
30
+    <WarningLevel>4</WarningLevel>
31
+  </PropertyGroup>
32
+  <ItemGroup>
33
+    <Reference Include="System" />
34
+    <Reference Include="System.Core" />
35
+    <Reference Include="System.Xml.Linq" />
36
+    <Reference Include="System.Data.DataSetExtensions" />
37
+    <Reference Include="Microsoft.CSharp" />
38
+    <Reference Include="System.Data" />
39
+    <Reference Include="System.Net.Http" />
40
+    <Reference Include="System.Xml" />
41
+  </ItemGroup>
42
+  <ItemGroup>
43
+    <Compile Include="阿里短信任务执行表.cs" />
44
+    <Compile Include="阿里短信任务表.cs" />
45
+    <Compile Include="Properties\AssemblyInfo.cs" />
46
+  </ItemGroup>
47
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
48
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
49
+       Other similar extension points exist, see Microsoft.Common.targets.
50
+  <Target Name="BeforeBuild">
51
+  </Target>
52
+  <Target Name="AfterBuild">
53
+  </Target>
54
+  -->
55
+</Project>

+ 36 - 0
HySoftSMS.Model/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
1
+using System.Reflection;
2
+using System.Runtime.CompilerServices;
3
+using System.Runtime.InteropServices;
4
+
5
+// 有关程序集的一般信息由以下
6
+// 控制。更改这些特性值可修改
7
+// 与程序集关联的信息。
8
+[assembly: AssemblyTitle("HySoftSMS.Model")]
9
+[assembly: AssemblyDescription("")]
10
+[assembly: AssemblyConfiguration("")]
11
+[assembly: AssemblyCompany("")]
12
+[assembly: AssemblyProduct("HySoftSMS.Model")]
13
+[assembly: AssemblyCopyright("Copyright ©  2018")]
14
+[assembly: AssemblyTrademark("")]
15
+[assembly: AssemblyCulture("")]
16
+
17
+//将 ComVisible 设置为 false 将使此程序集中的类型
18
+//对 COM 组件不可见。  如果需要从 COM 访问此程序集中的类型,
19
+//请将此类型的 ComVisible 特性设置为 true。
20
+[assembly: ComVisible(false)]
21
+
22
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23
+[assembly: Guid("e9840689-06b7-4de8-98b8-04c37a2f2f0e")]
24
+
25
+// 程序集的版本信息由下列四个值组成: 
26
+//
27
+//      主版本
28
+//      次版本
29
+//      生成号
30
+//      修订号
31
+//
32
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33
+// 方法是按如下所示使用“*”: :
34
+// [assembly: AssemblyVersion("1.0.*")]
35
+[assembly: AssemblyVersion("1.0.0.0")]
36
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 111 - 0
HySoftSMS.Model/阿里短信任务执行表.cs

@@ -0,0 +1,111 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace HySoftSMS.Model
8
+{
9
+    /// <summary>
10
+    /// 阿里短信任务执行表:实体类(属性说明自动提取数据库字段的描述信息)
11
+    /// </summary>
12
+    [Serializable]
13
+    public partial class 阿里短信任务执行表
14
+    {
15
+        public 阿里短信任务执行表()
16
+        { }
17
+        #region Model
18
+        private int _id;
19
+        private int? _任务条目id;
20
+        private string _任务条目子表名称;
21
+        private int? _任务id;
22
+        private string _号码;
23
+        private string _短信参数;
24
+        private int? _短信服务接口状态;
25
+        private string _短信内容;
26
+        private string _短信code;
27
+        private string _短信参数名;
28
+        /// <summary>
29
+        /// 
30
+        /// </summary>
31
+        public int ID
32
+        {
33
+            set { _id = value; }
34
+            get { return _id; }
35
+        }
36
+        /// <summary>
37
+        /// 
38
+        /// </summary>
39
+        public int? 任务条目ID
40
+        {
41
+            set { _任务条目id = value; }
42
+            get { return _任务条目id; }
43
+        }
44
+        /// <summary>
45
+        /// 
46
+        /// </summary>
47
+        public string 任务条目子表名称
48
+        {
49
+            set { _任务条目子表名称 = value; }
50
+            get { return _任务条目子表名称; }
51
+        }
52
+        /// <summary>
53
+        /// 
54
+        /// </summary>
55
+        public int? 任务ID
56
+        {
57
+            set { _任务id = value; }
58
+            get { return _任务id; }
59
+        }
60
+        /// <summary>
61
+        /// 
62
+        /// </summary>
63
+        public string 号码
64
+        {
65
+            set { _号码 = value; }
66
+            get { return _号码; }
67
+        }
68
+        /// <summary>
69
+        /// 
70
+        /// </summary>
71
+        public string 短信参数
72
+        {
73
+            set { _短信参数 = value; }
74
+            get { return _短信参数; }
75
+        }
76
+        /// <summary>
77
+        /// 
78
+        /// </summary>
79
+        public int? 短信服务接口状态
80
+        {
81
+            set { _短信服务接口状态 = value; }
82
+            get { return _短信服务接口状态; }
83
+        }
84
+        /// <summary>
85
+        /// 
86
+        /// </summary>
87
+        public string 短信内容
88
+        {
89
+            set { _短信内容 = value; }
90
+            get { return _短信内容; }
91
+        }
92
+        /// <summary>
93
+        /// 
94
+        /// </summary>
95
+        public string 短信CODE
96
+        {
97
+            set { _短信code = value; }
98
+            get { return _短信code; }
99
+        }
100
+        /// <summary>
101
+        /// 
102
+        /// </summary>
103
+        public string 短信参数名
104
+        {
105
+            set { _短信参数名 = value; }
106
+            get { return _短信参数名; }
107
+        }
108
+        #endregion Model
109
+
110
+    }
111
+}

+ 237 - 0
HySoftSMS.Model/阿里短信任务表.cs

@@ -0,0 +1,237 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace HySoftSMS.Model
8
+{
9
+    // <summary>
10
+    /// 阿里短信任务表:实体类(属性说明自动提取数据库字段的描述信息)
11
+    /// </summary>
12
+    [Serializable]
13
+    public partial class 阿里短信任务表
14
+    {
15
+        public 阿里短信任务表()
16
+        { }
17
+        #region Model
18
+        private int _id;
19
+        private string _名称;
20
+        private string _任务状态;
21
+        private string _任务类型;
22
+        private int? _通知方式;
23
+        private int? _任务优先级;
24
+        private DateTime? _计划开始时间;
25
+        private DateTime? _任务首次执行时间;
26
+        private DateTime? _任务终止时间;
27
+        private int? _业务分类id;
28
+        private int? _短信模板id;
29
+        private int? _任务提交人id;
30
+        private DateTime? _任务提交时间;
31
+        private int? _任务总数;
32
+        private int? _执行完成数量;
33
+        private int? _未执行数量;
34
+        private string _短信任务状态;
35
+        private int? _短信任务数量;
36
+        private int? _短信已执行完成数量;
37
+        private string _任务条目子表名称;
38
+        private DateTime? _a时段开始时间;
39
+        private DateTime? _a时段结束时间;
40
+        private DateTime? _b时段开始时间;
41
+        private DateTime? _b时段结束时间;
42
+        /// <summary>
43
+        /// 
44
+        /// </summary>
45
+        public int ID
46
+        {
47
+            set { _id = value; }
48
+            get { return _id; }
49
+        }
50
+        /// <summary>
51
+        /// 
52
+        /// </summary>
53
+        public string 名称
54
+        {
55
+            set { _名称 = value; }
56
+            get { return _名称; }
57
+        }
58
+        /// <summary>
59
+        /// 
60
+        /// </summary>
61
+        public string 任务状态
62
+        {
63
+            set { _任务状态 = value; }
64
+            get { return _任务状态; }
65
+        }
66
+        /// <summary>
67
+        /// 
68
+        /// </summary>
69
+        public string 任务类型
70
+        {
71
+            set { _任务类型 = value; }
72
+            get { return _任务类型; }
73
+        }
74
+        /// <summary>
75
+        /// 
76
+        /// </summary>
77
+        public int? 通知方式
78
+        {
79
+            set { _通知方式 = value; }
80
+            get { return _通知方式; }
81
+        }
82
+        /// <summary>
83
+        /// 
84
+        /// </summary>
85
+        public int? 任务优先级
86
+        {
87
+            set { _任务优先级 = value; }
88
+            get { return _任务优先级; }
89
+        }
90
+        /// <summary>
91
+        /// 
92
+        /// </summary>
93
+        public DateTime? 计划开始时间
94
+        {
95
+            set { _计划开始时间 = value; }
96
+            get { return _计划开始时间; }
97
+        }
98
+        /// <summary>
99
+        /// 
100
+        /// </summary>
101
+        public DateTime? 任务首次执行时间
102
+        {
103
+            set { _任务首次执行时间 = value; }
104
+            get { return _任务首次执行时间; }
105
+        }
106
+        /// <summary>
107
+        /// 
108
+        /// </summary>
109
+        public DateTime? 任务终止时间
110
+        {
111
+            set { _任务终止时间 = value; }
112
+            get { return _任务终止时间; }
113
+        }
114
+        /// <summary>
115
+        /// 
116
+        /// </summary>
117
+        public int? 业务分类ID
118
+        {
119
+            set { _业务分类id = value; }
120
+            get { return _业务分类id; }
121
+        }
122
+        /// <summary>
123
+        /// 
124
+        /// </summary>
125
+        public int? 短信模板ID
126
+        {
127
+            set { _短信模板id = value; }
128
+            get { return _短信模板id; }
129
+        }
130
+        /// <summary>
131
+        /// 
132
+        /// </summary>
133
+        public int? 任务提交人ID
134
+        {
135
+            set { _任务提交人id = value; }
136
+            get { return _任务提交人id; }
137
+        }
138
+        /// <summary>
139
+        /// 
140
+        /// </summary>
141
+        public DateTime? 任务提交时间
142
+        {
143
+            set { _任务提交时间 = value; }
144
+            get { return _任务提交时间; }
145
+        }
146
+        /// <summary>
147
+        /// 
148
+        /// </summary>
149
+        public int? 任务总数
150
+        {
151
+            set { _任务总数 = value; }
152
+            get { return _任务总数; }
153
+        }
154
+        /// <summary>
155
+        /// 
156
+        /// </summary>
157
+        public int? 执行完成数量
158
+        {
159
+            set { _执行完成数量 = value; }
160
+            get { return _执行完成数量; }
161
+        }
162
+        /// <summary>
163
+        /// 
164
+        /// </summary>
165
+        public int? 未执行数量
166
+        {
167
+            set { _未执行数量 = value; }
168
+            get { return _未执行数量; }
169
+        }
170
+        /// <summary>
171
+        /// 
172
+        /// </summary>
173
+        public string 短信任务状态
174
+        {
175
+            set { _短信任务状态 = value; }
176
+            get { return _短信任务状态; }
177
+        }
178
+        /// <summary>
179
+        /// 
180
+        /// </summary>
181
+        public int? 短信任务数量
182
+        {
183
+            set { _短信任务数量 = value; }
184
+            get { return _短信任务数量; }
185
+        }
186
+        /// <summary>
187
+        /// 
188
+        /// </summary>
189
+        public int? 短信已执行完成数量
190
+        {
191
+            set { _短信已执行完成数量 = value; }
192
+            get { return _短信已执行完成数量; }
193
+        }
194
+        /// <summary>
195
+        /// 
196
+        /// </summary>
197
+        public string 任务条目子表名称
198
+        {
199
+            set { _任务条目子表名称 = value; }
200
+            get { return _任务条目子表名称; }
201
+        }
202
+        /// <summary>
203
+        /// 
204
+        /// </summary>
205
+        public DateTime? a时段开始时间
206
+        {
207
+            set { _a时段开始时间 = value; }
208
+            get { return _a时段开始时间; }
209
+        }
210
+        /// <summary>
211
+        /// 
212
+        /// </summary>
213
+        public DateTime? a时段结束时间
214
+        {
215
+            set { _a时段结束时间 = value; }
216
+            get { return _a时段结束时间; }
217
+        }
218
+        /// <summary>
219
+        /// 
220
+        /// </summary>
221
+        public DateTime? b时段开始时间
222
+        {
223
+            set { _b时段开始时间 = value; }
224
+            get { return _b时段开始时间; }
225
+        }
226
+        /// <summary>
227
+        /// 
228
+        /// </summary>
229
+        public DateTime? b时段结束时间
230
+        {
231
+            set { _b时段结束时间 = value; }
232
+            get { return _b时段结束时间; }
233
+        }
234
+        #endregion Model
235
+
236
+    }
237
+}

+ 46 - 0
HySoftSMS.sln

@@ -5,16 +5,62 @@ VisualStudioVersion = 14.0.25420.1
5 5
 MinimumVisualStudioVersion = 10.0.40219.1
6 6
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HySoftSMS", "HySoftSMS\HySoftSMS.csproj", "{6CB73218-49D9-411F-BA1B-E84063B8BA60}"
7 7
 EndProject
8
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HySoftSMS.BLL", "HySoftSMS。BLL\HySoftSMS.BLL.csproj", "{31F4CA87-7E73-43CE-991D-3707E4D8D25E}"
9
+EndProject
10
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HySoftSMS.Model", "HySoftSMS.Model\HySoftSMS.Model.csproj", "{E9840689-06B7-4DE8-98B8-04C37A2F2F0E}"
11
+EndProject
12
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HySoftSMS.DAL", "HySoftSMS.DAL\HySoftSMS.DAL.csproj", "{184B0510-CB6C-45F1-8E4D-74DAAB55CAF2}"
13
+EndProject
14
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HySoftSMS.DBUtility", "HySoftSMS.DBUtility\HySoftSMS.DBUtility.csproj", "{A7E848AD-AFF7-414D-9719-51AF37915F53}"
15
+EndProject
8 16
 Global
9 17
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 18
 		Debug|Any CPU = Debug|Any CPU
19
+		Debug|x86 = Debug|x86
11 20
 		Release|Any CPU = Release|Any CPU
21
+		Release|x86 = Release|x86
12 22
 	EndGlobalSection
13 23
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 24
 		{6CB73218-49D9-411F-BA1B-E84063B8BA60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 25
 		{6CB73218-49D9-411F-BA1B-E84063B8BA60}.Debug|Any CPU.Build.0 = Debug|Any CPU
26
+		{6CB73218-49D9-411F-BA1B-E84063B8BA60}.Debug|x86.ActiveCfg = Debug|x86
27
+		{6CB73218-49D9-411F-BA1B-E84063B8BA60}.Debug|x86.Build.0 = Debug|x86
16 28
 		{6CB73218-49D9-411F-BA1B-E84063B8BA60}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 29
 		{6CB73218-49D9-411F-BA1B-E84063B8BA60}.Release|Any CPU.Build.0 = Release|Any CPU
30
+		{6CB73218-49D9-411F-BA1B-E84063B8BA60}.Release|x86.ActiveCfg = Release|x86
31
+		{6CB73218-49D9-411F-BA1B-E84063B8BA60}.Release|x86.Build.0 = Release|x86
32
+		{31F4CA87-7E73-43CE-991D-3707E4D8D25E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33
+		{31F4CA87-7E73-43CE-991D-3707E4D8D25E}.Debug|Any CPU.Build.0 = Debug|Any CPU
34
+		{31F4CA87-7E73-43CE-991D-3707E4D8D25E}.Debug|x86.ActiveCfg = Debug|Any CPU
35
+		{31F4CA87-7E73-43CE-991D-3707E4D8D25E}.Debug|x86.Build.0 = Debug|Any CPU
36
+		{31F4CA87-7E73-43CE-991D-3707E4D8D25E}.Release|Any CPU.ActiveCfg = Release|Any CPU
37
+		{31F4CA87-7E73-43CE-991D-3707E4D8D25E}.Release|Any CPU.Build.0 = Release|Any CPU
38
+		{31F4CA87-7E73-43CE-991D-3707E4D8D25E}.Release|x86.ActiveCfg = Release|Any CPU
39
+		{31F4CA87-7E73-43CE-991D-3707E4D8D25E}.Release|x86.Build.0 = Release|Any CPU
40
+		{E9840689-06B7-4DE8-98B8-04C37A2F2F0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
41
+		{E9840689-06B7-4DE8-98B8-04C37A2F2F0E}.Debug|Any CPU.Build.0 = Debug|Any CPU
42
+		{E9840689-06B7-4DE8-98B8-04C37A2F2F0E}.Debug|x86.ActiveCfg = Debug|Any CPU
43
+		{E9840689-06B7-4DE8-98B8-04C37A2F2F0E}.Debug|x86.Build.0 = Debug|Any CPU
44
+		{E9840689-06B7-4DE8-98B8-04C37A2F2F0E}.Release|Any CPU.ActiveCfg = Release|Any CPU
45
+		{E9840689-06B7-4DE8-98B8-04C37A2F2F0E}.Release|Any CPU.Build.0 = Release|Any CPU
46
+		{E9840689-06B7-4DE8-98B8-04C37A2F2F0E}.Release|x86.ActiveCfg = Release|Any CPU
47
+		{E9840689-06B7-4DE8-98B8-04C37A2F2F0E}.Release|x86.Build.0 = Release|Any CPU
48
+		{184B0510-CB6C-45F1-8E4D-74DAAB55CAF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
49
+		{184B0510-CB6C-45F1-8E4D-74DAAB55CAF2}.Debug|Any CPU.Build.0 = Debug|Any CPU
50
+		{184B0510-CB6C-45F1-8E4D-74DAAB55CAF2}.Debug|x86.ActiveCfg = Debug|Any CPU
51
+		{184B0510-CB6C-45F1-8E4D-74DAAB55CAF2}.Debug|x86.Build.0 = Debug|Any CPU
52
+		{184B0510-CB6C-45F1-8E4D-74DAAB55CAF2}.Release|Any CPU.ActiveCfg = Release|Any CPU
53
+		{184B0510-CB6C-45F1-8E4D-74DAAB55CAF2}.Release|Any CPU.Build.0 = Release|Any CPU
54
+		{184B0510-CB6C-45F1-8E4D-74DAAB55CAF2}.Release|x86.ActiveCfg = Release|Any CPU
55
+		{184B0510-CB6C-45F1-8E4D-74DAAB55CAF2}.Release|x86.Build.0 = Release|Any CPU
56
+		{A7E848AD-AFF7-414D-9719-51AF37915F53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
57
+		{A7E848AD-AFF7-414D-9719-51AF37915F53}.Debug|Any CPU.Build.0 = Debug|Any CPU
58
+		{A7E848AD-AFF7-414D-9719-51AF37915F53}.Debug|x86.ActiveCfg = Debug|Any CPU
59
+		{A7E848AD-AFF7-414D-9719-51AF37915F53}.Debug|x86.Build.0 = Debug|Any CPU
60
+		{A7E848AD-AFF7-414D-9719-51AF37915F53}.Release|Any CPU.ActiveCfg = Release|Any CPU
61
+		{A7E848AD-AFF7-414D-9719-51AF37915F53}.Release|Any CPU.Build.0 = Release|Any CPU
62
+		{A7E848AD-AFF7-414D-9719-51AF37915F53}.Release|x86.ActiveCfg = Release|Any CPU
63
+		{A7E848AD-AFF7-414D-9719-51AF37915F53}.Release|x86.Build.0 = Release|Any CPU
18 64
 	EndGlobalSection
19 65
 	GlobalSection(SolutionProperties) = preSolution
20 66
 		HideSolutionNode = FALSE

+ 46 - 0
HySoftSMS/App.config

@@ -3,4 +3,50 @@
3 3
     <startup> 
4 4
         <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
5 5
     </startup>
6
+ <!--反射 -->
7
+  <appSettings>
8
+    <add key="DAL" value="HySoftSMS.DAL" />
9
+  
10
+   <!--产品名称:云通信短信API产品,开发者无需替换-->
11
+    <add key="product" value="Dysmsapi"/>
12
+    <!--产品域名,开发者无需替换-->
13
+    <add key="domain" value="dysmsapi.aliyuncs.com"/>
14
+    <!--AccessKeyID-->
15
+    <!--LTAIiRnqfwwo1OBX-->
16
+    <add key="accesskeyid" value="LTAID8jj0g51ZsYv"/>
17
+    <!--AccessKeySecret-->
18
+    <!--NrxDE7DEN7FC2pW5egjqCB8Cvi2IfC-->
19
+    <add key="accesskeysecret" value="EH0S0XbUQihHSGA7FMutP0J8kzXqPk"/>
20
+    <!--短信签名-->
21
+    <!--华谊科技-->
22
+    <add key="signname" value="华谊服务平台测试"/>
23
+    <!--模板CODE-->
24
+    <!--模板SMS_146615372-->
25
+    <add key="templatecode" value="SMS_146610520"/>
26
+
27
+    <!--循环时间间隔-->
28
+    <add key="interval" value="5000"/>
29
+    <!--每次发送条数-->
30
+    <add key="count" value="30"/>
31
+    <!--每条短信价格-->
32
+    <add key="price" value="0.8"/>
33
+
34
+    <!--url-->
35
+    <add key="geturl" value="http://192.168.4.18/api/sms/getbalance"/>
36
+    <!--url-->
37
+    <add key="deducturl" value="http://192.168.4.18/api/sms/deductamount"/>
38
+    <!--url-->
39
+    <add key="sendurl" value="http://192.168.4.18/api/sms/sendsms"/>
40
+    <!--账号-->
41
+    <add key="account" value="gszls"/>
42
+    <!--密码-->
43
+    <add key="password" value="gszls800100"/>
44
+    <!--签名-->
45
+    <add key="sign" value="gszls800100"/>
46
+  </appSettings>
47
+  <!--数据库连接字符串-->
48
+  <connectionStrings>   
49
+    <add name="ConnectionString" connectionString="Data Source=192.168.4.18;User ID=sa;pwd=800100;Initial Catalog=GSZLS;"/>   
50
+  </connectionStrings>
51
+  <system.windows.forms jitDebugging="true" />
6 52
 </configuration>

+ 75 - 0
HySoftSMS/CommandInfo.cs

@@ -0,0 +1,75 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Data.SqlClient;
4
+using System.Linq;
5
+using System.Text;
6
+using System.Threading.Tasks;
7
+
8
+namespace HySoftSMS
9
+{
10
+    public enum EffentNextType
11
+    {
12
+        /// <summary>
13
+        /// 对其他语句无任何影响 
14
+        /// </summary>
15
+        None,
16
+        /// <summary>
17
+        /// 当前语句必须为"select count(1) from .."格式,如果存在则继续执行,不存在回滚事务
18
+        /// </summary>
19
+        WhenHaveContine,
20
+        /// <summary>
21
+        /// 当前语句必须为"select count(1) from .."格式,如果不存在则继续执行,存在回滚事务
22
+        /// </summary>
23
+        WhenNoHaveContine,
24
+        /// <summary>
25
+        /// 当前语句影响到的行数必须大于0,否则回滚事务
26
+        /// </summary>
27
+        ExcuteEffectRows,
28
+        /// <summary>
29
+        /// 引发事件-当前语句必须为"select count(1) from .."格式,如果不存在则继续执行,存在回滚事务
30
+        /// </summary>
31
+        SolicitationEvent
32
+    }
33
+    public class CommandInfo
34
+    {
35
+        public object ShareObject = null;
36
+        public object OriginalData = null;
37
+        event EventHandler _solicitationEvent;
38
+        public event EventHandler SolicitationEvent
39
+        {
40
+            add
41
+            {
42
+                _solicitationEvent += value;
43
+            }
44
+            remove
45
+            {
46
+                _solicitationEvent -= value;
47
+            }
48
+        }
49
+        public void OnSolicitationEvent()
50
+        {
51
+            if (_solicitationEvent != null)
52
+            {
53
+                _solicitationEvent(this, new EventArgs());
54
+            }
55
+        }
56
+        public string CommandText;
57
+        public System.Data.Common.DbParameter[] Parameters;
58
+        public EffentNextType EffentNextType = EffentNextType.None;
59
+        public CommandInfo()
60
+        {
61
+
62
+        }
63
+        public CommandInfo(string sqlText, SqlParameter[] para)
64
+        {
65
+            this.CommandText = sqlText;
66
+            this.Parameters = para;
67
+        }
68
+        public CommandInfo(string sqlText, SqlParameter[] para, EffentNextType type)
69
+        {
70
+            this.CommandText = sqlText;
71
+            this.Parameters = para;
72
+            this.EffentNextType = type;
73
+        }
74
+    }
75
+}

Разница между файлами не показана из-за своего большого размера
+ 1289 - 0
HySoftSMS/DbHelperSQL.cs


+ 0 - 39
HySoftSMS/Form1.Designer.cs

@@ -1,39 +0,0 @@
1
-namespace HySoftSMS
2
-{
3
-    partial class Form1
4
-    {
5
-        /// <summary>
6
-        /// 必需的设计器变量。
7
-        /// </summary>
8
-        private System.ComponentModel.IContainer components = null;
9
-
10
-        /// <summary>
11
-        /// 清理所有正在使用的资源。
12
-        /// </summary>
13
-        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
14
-        protected override void Dispose(bool disposing)
15
-        {
16
-            if (disposing && (components != null))
17
-            {
18
-                components.Dispose();
19
-            }
20
-            base.Dispose(disposing);
21
-        }
22
-
23
-        #region Windows 窗体设计器生成的代码
24
-
25
-        /// <summary>
26
-        /// 设计器支持所需的方法 - 不要修改
27
-        /// 使用代码编辑器修改此方法的内容。
28
-        /// </summary>
29
-        private void InitializeComponent()
30
-        {
31
-            this.components = new System.ComponentModel.Container();
32
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
33
-            this.Text = "Form1";
34
-        }
35
-
36
-        #endregion
37
-    }
38
-}
39
-

+ 0 - 20
HySoftSMS/Form1.cs

@@ -1,20 +0,0 @@
1
-using System;
2
-using System.Collections.Generic;
3
-using System.ComponentModel;
4
-using System.Data;
5
-using System.Drawing;
6
-using System.Linq;
7
-using System.Text;
8
-using System.Threading.Tasks;
9
-using System.Windows.Forms;
10
-
11
-namespace HySoftSMS
12
-{
13
-    public partial class Form1 : Form
14
-    {
15
-        public Form1()
16
-        {
17
-            InitializeComponent();
18
-        }
19
-    }
20
-}

+ 75 - 0
HySoftSMS/FrmMain.Designer.cs

@@ -0,0 +1,75 @@
1
+namespace HySoftSMS
2
+{
3
+    partial class FrmMain
4
+    {
5
+        /// <summary>
6
+        /// 必需的设计器变量。
7
+        /// </summary>
8
+        private System.ComponentModel.IContainer components = null;
9
+
10
+        /// <summary>
11
+        /// 清理所有正在使用的资源。
12
+        /// </summary>
13
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
14
+        protected override void Dispose(bool disposing)
15
+        {
16
+            if (disposing && (components != null))
17
+            {
18
+                components.Dispose();
19
+            }
20
+            base.Dispose(disposing);
21
+        }
22
+
23
+        #region Windows 窗体设计器生成的代码
24
+
25
+        /// <summary>
26
+        /// 设计器支持所需的方法 - 不要修改
27
+        /// 使用代码编辑器修改此方法的内容。
28
+        /// </summary>
29
+        private void InitializeComponent()
30
+        {
31
+            this.rtb1 = new System.Windows.Forms.RichTextBox();
32
+            this.label1 = new System.Windows.Forms.Label();
33
+            this.SuspendLayout();
34
+            // 
35
+            // rtb1
36
+            // 
37
+            this.rtb1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
38
+            this.rtb1.Location = new System.Drawing.Point(120, 12);
39
+            this.rtb1.Name = "rtb1";
40
+            this.rtb1.Size = new System.Drawing.Size(258, 136);
41
+            this.rtb1.TabIndex = 0;
42
+            this.rtb1.Text = "";
43
+            // 
44
+            // label1
45
+            // 
46
+            this.label1.AutoSize = true;
47
+            this.label1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
48
+            this.label1.Location = new System.Drawing.Point(35, 12);
49
+            this.label1.Name = "label1";
50
+            this.label1.Size = new System.Drawing.Size(79, 20);
51
+            this.label1.TabIndex = 1;
52
+            this.label1.Text = "信息展示:";
53
+            // 
54
+            // FrmMain
55
+            // 
56
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
57
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
58
+            this.ClientSize = new System.Drawing.Size(422, 170);
59
+            this.Controls.Add(this.label1);
60
+            this.Controls.Add(this.rtb1);
61
+            this.Name = "FrmMain";
62
+            this.Text = "短信发送";
63
+            this.Load += new System.EventHandler(this.FrmMain_Load);
64
+            this.ResumeLayout(false);
65
+            this.PerformLayout();
66
+
67
+        }
68
+
69
+        #endregion
70
+
71
+        private System.Windows.Forms.RichTextBox rtb1;
72
+        private System.Windows.Forms.Label label1;
73
+    }
74
+}
75
+

+ 178 - 0
HySoftSMS/FrmMain.cs

@@ -0,0 +1,178 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.ComponentModel;
4
+using System.Configuration;
5
+using System.Data;
6
+using System.Drawing;
7
+using System.Linq;
8
+using System.Text;
9
+using System.Threading.Tasks;
10
+using System.Timers;
11
+using System.Windows.Forms;
12
+using Newtonsoft.Json.Linq;
13
+using Newtonsoft.Json;
14
+using System.Threading;
15
+
16
+namespace HySoftSMS
17
+{
18
+    public partial class FrmMain : Form
19
+    {
20
+        public FrmMain()
21
+        {
22
+            InitializeComponent();
23
+        }
24
+
25
+        private int interval = 1000;//线程休眠时间
26
+        private void FrmMain_Load(object sender, EventArgs e)
27
+        {
28
+            getbalance();
29
+
30
+            if (balance > 1)
31
+            {
32
+                //Console.WriteLine("余额:" + balance);
33
+                rtb1.AppendText(DateTime.Now.ToString() + "  余额:" + balance);
34
+
35
+                interval = Int32.Parse(ConfigurationManager.AppSettings["interval"]);
36
+                //开启线程
37
+                Thread thread1 = new Thread(TimeEvent);
38
+                thread1.Start();
39
+
40
+                //aTimer = new Timer();
41
+                //aTimer.Elapsed += new ElapsedEventHandler(TimeEvent);
42
+                //aTimer.Interval = interval;
43
+                //aTimer.Enabled = true;
44
+            }
45
+            else
46
+            {
47
+                //Console.WriteLine("余额不足");
48
+                rtb1.AppendText(DateTime .Now .ToString ()+ "  余额不足\n");
49
+            }
50
+
51
+            //Console.ReadLine();
52
+        }
53
+
54
+        static decimal balance = 0;
55
+
56
+        private  void TimeEvent()//(object sender, ElapsedEventArgs e)
57
+        {
58
+            try
59
+            {
60
+                while (true)
61
+                {
62
+                    if (balance > 1)
63
+                    {
64
+                        startsendsms();
65
+                    }
66
+                    else
67
+                    {
68
+                        getbalance();
69
+                    }
70
+                }
71
+            }
72
+            catch (Exception e)
73
+            {
74
+                MessageBox.Show(DateTime .Now .ToString ()+"线程异常:"+e.ToString ());
75
+            }
76
+        }
77
+
78
+
79
+        /// <summary>
80
+        /// 获取余额
81
+        /// </summary>
82
+        private  void getbalance()
83
+        {
84
+            var url = ConfigurationManager.AppSettings["geturl"];
85
+            var account = ConfigurationManager.AppSettings["account"];
86
+            var password = ConfigurationManager.AppSettings["password"];
87
+            var sign = ConfigurationManager.AppSettings["sign"];
88
+
89
+            var signcode = Utils.MD5(account + "+" + password + "+" + sign + "+" + DateTime.Now.ToString("yyyyMMdd"));
90
+            var result = Utils.HttpGet(url + "?usercode=" + account + "&password=" + password + "&signcode=" + signcode);//.ToJObject();
91
+            JObject jo0 = (JObject)JsonConvert.DeserializeObject(result);
92
+           
93
+            if (jo0["state"].ToString() == "success")
94
+            {
95
+                balance = decimal.Parse(jo0["data"].ToString());
96
+            }
97
+        }
98
+
99
+        /// <summary>
100
+        /// 开始发送短信
101
+        /// </summary>
102
+        public  void startsendsms()
103
+        {
104
+            task tk = new task();
105
+            taskitem ti = new taskitem();
106
+            tk.ScanTask();
107
+            var task = tk.getexcutetask();
108
+            if (task != null)
109
+            {
110
+                foreach (var item in ti.gettaskitemlist(task.ID))
111
+                {
112
+                    if (balance > 1)
113
+                    {
114
+                        /*Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));*/
115
+
116
+                        //sms ss = new sms(item.短信CODE);
117
+                        //string result = ss.SendSms(item.号码, item.短信参数名, item.短信参数);
118
+                        //Console.WriteLine(item.号码 + ":" + (string.IsNullOrEmpty(result) ? "发送成功" : "发送失败,原因:" + result));
119
+
120
+                        //var url = ConfigurationManager.AppSettings["deducturl"];
121
+                        //var account = ConfigurationManager.AppSettings["account"];
122
+                        //var password = ConfigurationManager.AppSettings["password"];
123
+                        //var sign = ConfigurationManager.AppSettings["sign"];
124
+
125
+                        //var signcode = Utils.MD5(account + "+" + password + "+" + sign + "+" + DateTime.Now.ToString("yyyyMMdd"));
126
+                        //var sendresult = Utils.HttpPost(url,"usercode=" + account + "&password=" + password + "&signcode=" + signcode + "&phonenumber=" + item.号码).ToJObject();
127
+                        //if (sendresult["state"].ToString() == "success")
128
+                        //{
129
+                        //    balance = decimal.Parse(sendresult["data"].ToString());
130
+                        //    Console.WriteLine("扣款成功");
131
+                        //}
132
+                        //else
133
+                        //{
134
+                        //    Console.WriteLine("扣款失败");
135
+                        //}
136
+
137
+                        var url = ConfigurationManager.AppSettings["sendsms"];
138
+                        var account = ConfigurationManager.AppSettings["account"];
139
+                        var password = ConfigurationManager.AppSettings["password"];
140
+                        var sign = ConfigurationManager.AppSettings["sign"];
141
+
142
+                        var signname = ConfigurationManager.AppSettings["signname"];
143
+                        var signcode = Utils.MD5(account + "+" + password + "+" + sign + "+" + DateTime.Now.ToString("yyyyMMdd"));
144
+                        string param = "usercode=" + account + "&password=" + password + "&signcode=" + signcode + "&signname=" + signname + "&templatecode=" + item.短信CODE
145
+                            + "&phonenumber=" + item.号码 + "&paramname=" + item.短信参数名 + "&param=" + item.短信参数;
146
+                        var jo0 = Utils.PostHTML(url, param);//.ToJObject();
147
+                        JObject sendresult = (JObject)JsonConvert.DeserializeObject(jo0);
148
+                        string result = string.Empty;
149
+                        if (sendresult["state"].ToString() == "success")
150
+                        {
151
+                            balance = decimal.Parse(sendresult["data"].ToString());
152
+                        }
153
+                        else
154
+                        {
155
+                            result = sendresult["message"].ToString();
156
+                        }
157
+
158
+                        rtb1.AppendText(item.号码 + ":" + (string.IsNullOrEmpty(result) ? "发送成功" : "发送失败,原因:" + result));
159
+
160
+                        bool bl = ti.SetSMSTaskItemSendResult(task.ID, item.ID, string.IsNullOrEmpty(result), result, balance.ToString());
161
+                        if (bl)
162
+                        {
163
+                            rtb1.AppendText (item.号码 + ":更新任务成功");
164
+                        }
165
+                        else
166
+                        {
167
+                            rtb1.AppendText(item.号码 + ":更新任务失败");
168
+                        }
169
+                    }
170
+                    else
171
+                    {
172
+                        return;
173
+                    }
174
+                }
175
+            }
176
+        }
177
+    }
178
+}

+ 120 - 0
HySoftSMS/FrmMain.resx

@@ -0,0 +1,120 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
+    <xsd:element name="root" msdata:IsDataSet="true">
65
+      <xsd:complexType>
66
+        <xsd:choice maxOccurs="unbounded">
67
+          <xsd:element name="metadata">
68
+            <xsd:complexType>
69
+              <xsd:sequence>
70
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
+              </xsd:sequence>
72
+              <xsd:attribute name="name" use="required" type="xsd:string" />
73
+              <xsd:attribute name="type" type="xsd:string" />
74
+              <xsd:attribute name="mimetype" type="xsd:string" />
75
+              <xsd:attribute ref="xml:space" />
76
+            </xsd:complexType>
77
+          </xsd:element>
78
+          <xsd:element name="assembly">
79
+            <xsd:complexType>
80
+              <xsd:attribute name="alias" type="xsd:string" />
81
+              <xsd:attribute name="name" type="xsd:string" />
82
+            </xsd:complexType>
83
+          </xsd:element>
84
+          <xsd:element name="data">
85
+            <xsd:complexType>
86
+              <xsd:sequence>
87
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
+              </xsd:sequence>
90
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
+              <xsd:attribute ref="xml:space" />
94
+            </xsd:complexType>
95
+          </xsd:element>
96
+          <xsd:element name="resheader">
97
+            <xsd:complexType>
98
+              <xsd:sequence>
99
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
+              </xsd:sequence>
101
+              <xsd:attribute name="name" type="xsd:string" use="required" />
102
+            </xsd:complexType>
103
+          </xsd:element>
104
+        </xsd:choice>
105
+      </xsd:complexType>
106
+    </xsd:element>
107
+  </xsd:schema>
108
+  <resheader name="resmimetype">
109
+    <value>text/microsoft-resx</value>
110
+  </resheader>
111
+  <resheader name="version">
112
+    <value>2.0</value>
113
+  </resheader>
114
+  <resheader name="reader">
115
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+  <resheader name="writer">
118
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
+  </resheader>
120
+</root>

+ 55 - 3
HySoftSMS/HySoftSMS.csproj

@@ -32,8 +32,33 @@
32 32
     <ErrorReport>prompt</ErrorReport>
33 33
     <WarningLevel>4</WarningLevel>
34 34
   </PropertyGroup>
35
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
36
+    <DebugSymbols>true</DebugSymbols>
37
+    <OutputPath>bin\x86\Debug\</OutputPath>
38
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
39
+    <DebugType>full</DebugType>
40
+    <PlatformTarget>x86</PlatformTarget>
41
+    <ErrorReport>prompt</ErrorReport>
42
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
43
+    <Prefer32Bit>true</Prefer32Bit>
44
+  </PropertyGroup>
45
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
46
+    <OutputPath>bin\x86\Release\</OutputPath>
47
+    <DefineConstants>TRACE</DefineConstants>
48
+    <Optimize>true</Optimize>
49
+    <DebugType>pdbonly</DebugType>
50
+    <PlatformTarget>x86</PlatformTarget>
51
+    <ErrorReport>prompt</ErrorReport>
52
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
53
+    <Prefer32Bit>true</Prefer32Bit>
54
+  </PropertyGroup>
35 55
   <ItemGroup>
56
+    <Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
57
+      <HintPath>..\packages\Newtonsoft.Json.10.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
58
+      <Private>True</Private>
59
+    </Reference>
36 60
     <Reference Include="System" />
61
+    <Reference Include="System.configuration" />
37 62
     <Reference Include="System.Core" />
38 63
     <Reference Include="System.Xml.Linq" />
39 64
     <Reference Include="System.Data.DataSetExtensions" />
@@ -46,14 +71,22 @@
46 71
     <Reference Include="System.Xml" />
47 72
   </ItemGroup>
48 73
   <ItemGroup>
49
-    <Compile Include="Form1.cs">
74
+    <Compile Include="CommandInfo.cs" />
75
+    <Compile Include="FrmMain.cs">
50 76
       <SubType>Form</SubType>
51 77
     </Compile>
52
-    <Compile Include="Form1.Designer.cs">
53
-      <DependentUpon>Form1.cs</DependentUpon>
78
+    <Compile Include="FrmMain.Designer.cs">
79
+      <DependentUpon>FrmMain.cs</DependentUpon>
54 80
     </Compile>
81
+    <Compile Include="IniFile.cs" />
55 82
     <Compile Include="Program.cs" />
56 83
     <Compile Include="Properties\AssemblyInfo.cs" />
84
+    <Compile Include="task.cs" />
85
+    <Compile Include="taskitem.cs" />
86
+    <Compile Include="Utils.cs" />
87
+    <EmbeddedResource Include="FrmMain.resx">
88
+      <DependentUpon>FrmMain.cs</DependentUpon>
89
+    </EmbeddedResource>
57 90
     <EmbeddedResource Include="Properties\Resources.resx">
58 91
       <Generator>ResXFileCodeGenerator</Generator>
59 92
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
@@ -63,6 +96,7 @@
63 96
       <AutoGen>True</AutoGen>
64 97
       <DependentUpon>Resources.resx</DependentUpon>
65 98
     </Compile>
99
+    <None Include="packages.config" />
66 100
     <None Include="Properties\Settings.settings">
67 101
       <Generator>SettingsSingleFileGenerator</Generator>
68 102
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -76,6 +110,24 @@
76 110
   <ItemGroup>
77 111
     <None Include="App.config" />
78 112
   </ItemGroup>
113
+  <ItemGroup>
114
+    <ProjectReference Include="..\HySoftSMS.DAL\HySoftSMS.DAL.csproj">
115
+      <Project>{184b0510-cb6c-45f1-8e4d-74daab55caf2}</Project>
116
+      <Name>HySoftSMS.DAL</Name>
117
+    </ProjectReference>
118
+    <ProjectReference Include="..\HySoftSMS.DBUtility\HySoftSMS.DBUtility.csproj">
119
+      <Project>{A7E848AD-AFF7-414D-9719-51AF37915F53}</Project>
120
+      <Name>HySoftSMS.DBUtility</Name>
121
+    </ProjectReference>
122
+    <ProjectReference Include="..\HySoftSMS.Model\HySoftSMS.Model.csproj">
123
+      <Project>{e9840689-06b7-4de8-98b8-04c37a2f2f0e}</Project>
124
+      <Name>HySoftSMS.Model</Name>
125
+    </ProjectReference>
126
+    <ProjectReference Include="..\HySoftSMS。BLL\HySoftSMS.BLL.csproj">
127
+      <Project>{31f4ca87-7e73-43ce-991d-3707e4d8d25e}</Project>
128
+      <Name>HySoftSMS.BLL</Name>
129
+    </ProjectReference>
130
+  </ItemGroup>
79 131
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
80 132
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
81 133
        Other similar extension points exist, see Microsoft.Common.targets.

+ 71 - 0
HySoftSMS/IniFile.cs

@@ -0,0 +1,71 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Runtime.InteropServices;
5
+using System.Text;
6
+using System.Threading.Tasks;
7
+
8
+namespace HySoftSMS
9
+{
10
+    public class IniFile
11
+    {
12
+        public string Path;
13
+
14
+        public IniFile(string path)
15
+        {
16
+            this.Path = path;
17
+        }
18
+
19
+        #region 声明读写INI文件的API函数
20
+
21
+        [DllImport("kernel32")]
22
+        private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
23
+
24
+        [DllImport("kernel32")]
25
+        private static extern int GetPrivateProfileString(string section, string key, string defVal, StringBuilder retVal, int size, string filePath);
26
+
27
+        [DllImport("kernel32")]
28
+        private static extern int GetPrivateProfileString(string section, string key, string defVal, Byte[] retVal, int size, string filePath);
29
+
30
+        #endregion
31
+
32
+        /// <summary>
33
+        /// 写INI文件
34
+        /// </summary>
35
+        /// <param name="section">段落</param>
36
+        /// <param name="key">键</param>
37
+        /// <param name="iValue">值</param>
38
+        public void IniWriteValue(string section, string key, string iValue)
39
+        {
40
+            WritePrivateProfileString(section, key, iValue, this.Path);
41
+        }
42
+
43
+        /// <summary>
44
+        /// 读取INI文件
45
+        /// </summary>
46
+        /// <param name="section">段落</param>
47
+        /// <param name="key">键</param>
48
+        /// <returns>返回的键值</returns>
49
+        public string IniReadValue(string section, string key)
50
+        {
51
+            StringBuilder temp = new StringBuilder(255);
52
+
53
+            int i = GetPrivateProfileString(section, key, "", temp, 255, this.Path);
54
+            return temp.ToString();
55
+        }
56
+
57
+        /// <summary>
58
+        /// 读取INI文件
59
+        /// </summary>
60
+        /// <param name="Section">段,格式[]</param>
61
+        /// <param name="Key">键</param>
62
+        /// <returns>返回byte类型的section组或键值组</returns>
63
+        public byte[] IniReadValues(string section, string key)
64
+        {
65
+            byte[] temp = new byte[255];
66
+
67
+            int i = GetPrivateProfileString(section, key, "", temp, 255, this.Path);
68
+            return temp;
69
+        }
70
+    }
71
+}

+ 1 - 1
HySoftSMS/Program.cs

@@ -16,7 +16,7 @@ namespace HySoftSMS
16 16
         {
17 17
             Application.EnableVisualStyles();
18 18
             Application.SetCompatibleTextRenderingDefault(false);
19
-            Application.Run(new Form1());
19
+            Application.Run(new FrmMain());
20 20
         }
21 21
     }
22 22
 }

Разница между файлами не показана из-за своего большого размера
+ 1315 - 0
HySoftSMS/Utils.cs


+ 4 - 0
HySoftSMS/packages.config

@@ -0,0 +1,4 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<packages>
3
+  <package id="Newtonsoft.Json" version="10.0.1" targetFramework="net452" />
4
+</packages>

+ 109 - 0
HySoftSMS/task.cs

@@ -0,0 +1,109 @@
1
+using HySoftSMS.BLL;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.Linq;
5
+using System.Text;
6
+using System.Threading.Tasks;
7
+
8
+namespace HySoftSMS
9
+{
10
+    public class task
11
+    {
12
+        public task() { }
13
+
14
+        public void ScanTask()
15
+        {
16
+            var tasklist = gettasklist();
17
+
18
+            foreach (var task in tasklist)
19
+            {
20
+                DateTime now = DateTime.Now;
21
+                bool isstart = task.计划开始时间 < now;
22
+                bool isexcute = BeInTimeInterval(task.a时段开始时间.Value, task.a时段结束时间.Value, task.b时段开始时间.Value, task.b时段结束时间.Value);
23
+                if (task.短信任务状态 == "终止" || task.短信任务状态 == "无任务")
24
+                {
25
+                    task.任务状态 = "终止";
26
+                }
27
+                else if (task.任务状态 == "执行排队中" && !isexcute)
28
+                {
29
+                    task.任务状态 = "定时等待";
30
+                    task.短信任务状态 = "定时等待";
31
+                }
32
+                else if (task.任务状态 == "定时等待" && isexcute && isstart)
33
+                {
34
+                    task.任务状态 = "执行排队中";
35
+                    task.短信任务状态 = "执行排队中";
36
+                }
37
+                SetTaskStates(task.ID, task.任务状态, task.短信任务状态);
38
+            }
39
+
40
+
41
+            var excutask = tasklist.Where(p => p.任务状态 == "执行中").FirstOrDefault();
42
+            if (excutask == null)
43
+            {
44
+                excutask = tasklist.Where(p => p.任务状态 == "执行排队中").OrderByDescending(p => p.任务优先级).FirstOrDefault();
45
+                if (excutask != null)
46
+                {
47
+                    SetTaskStates(excutask.ID, "执行中", "执行中");
48
+                }
49
+            }
50
+        }
51
+
52
+        /// <summary>
53
+        /// 获取要执行的任务列表
54
+        /// </summary>
55
+        /// <returns></returns>
56
+        public List<Model.阿里短信任务表> gettasklist()
57
+        {
58
+            return new 阿里短信任务表().GetModelList(" 任务状态 IN ('定时等待','执行排队中','执行中') ");
59
+        }
60
+
61
+        /// <summary>
62
+        /// 获取执行中任务
63
+        /// </summary>
64
+        /// <param name="taskid"></param>
65
+        /// <returns></returns>
66
+        public Model.阿里短信任务表 getexcutetask()
67
+        {
68
+            return new 阿里短信任务表().GetModelList("短信任务状态='执行中'").FirstOrDefault();
69
+        }
70
+
71
+        /// <summary>
72
+        /// 更新任务状态
73
+        /// </summary>
74
+        /// <param name="taskid"></param>
75
+        /// <param name="taskstate"></param>
76
+        /// <param name="smsstate"></param>
77
+        /// <returns></returns>
78
+        public bool SetTaskStates(int taskid, string taskstate, string smsstate)
79
+        {
80
+            bool bl = false;
81
+            var taskinfo = new 阿里短信任务表().GetModel(taskid);
82
+            if (taskinfo != null)
83
+            {
84
+                taskinfo.任务状态 = taskstate;
85
+                taskinfo.短信任务状态 = smsstate;
86
+                bl = new 阿里短信任务表().Update(taskinfo);
87
+            }
88
+            return bl;
89
+        }
90
+
91
+        /// <summary>
92
+        /// 是否在执行时间段中
93
+        /// </summary>
94
+        /// <param name="aDTBegain"></param>
95
+        /// <param name="aDTEnd"></param>
96
+        /// <param name="bDTBegain"></param>
97
+        /// <param name="bDTEnd"></param>
98
+        /// <returns></returns>
99
+        private bool BeInTimeInterval(DateTime aDTBegain, DateTime aDTEnd, DateTime bDTBegain, DateTime bDTEnd)
100
+        {
101
+            long num = long.Parse(DateTime.Now.ToString("HHmm"));
102
+            long num2 = long.Parse(aDTBegain.ToString("HHmm"));
103
+            long num3 = long.Parse(aDTEnd.ToString("HHmm"));
104
+            long num4 = long.Parse(bDTBegain.ToString("HHmm"));
105
+            long num5 = long.Parse(bDTEnd.ToString("HHmm"));
106
+            return (num >= num2 && num <= num3) || (num >= num4 && num <= num5);
107
+        }
108
+    }
109
+}

+ 81 - 0
HySoftSMS/taskitem.cs

@@ -0,0 +1,81 @@
1
+using HySoftSMS.DBUtility;
2
+using HySoftSMS.BLL;
3
+using System;
4
+using System.Collections.Generic;
5
+using System.Configuration;
6
+using System.Linq;
7
+using System.Text;
8
+using System.Threading.Tasks;
9
+
10
+namespace HySoftSMS
11
+{
12
+    public class taskitem
13
+    {
14
+        private int maxcount = 0;
15
+        private decimal price = 0;
16
+        public taskitem()
17
+        {
18
+            maxcount = Int32.Parse(ConfigurationManager.AppSettings["count"]);
19
+            price = decimal.Parse(ConfigurationManager.AppSettings["price"]);
20
+        }
21
+
22
+        /// <summary>
23
+        /// 获取任务明细
24
+        /// </summary>
25
+        /// <param name="taskid"></param>
26
+        /// <returns></returns>
27
+        public List<Model.阿里短信任务执行表> gettaskitemlist(int taskid)
28
+        {
29
+            var dt = new 阿里短信任务执行表().GetList(maxcount, " 短信服务接口状态=0 and 任务ID=" + taskid, " id ").Tables[0];
30
+            var list = new 阿里短信任务执行表().DataTableToList(dt);
31
+            foreach (var l in list)
32
+            {
33
+                l.短信服务接口状态 = 1;
34
+                new 阿里短信任务执行表().Update(l);
35
+            }
36
+            return list;
37
+        }
38
+
39
+        /// <summary>
40
+        /// 更新条目发送结果
41
+        /// </summary>
42
+        /// <param name="taskid"></param>
43
+        /// <param name="itemid"></param>
44
+        /// <param name="result"></param>
45
+        /// <param name="errinfo"></param>
46
+        public bool SetSMSTaskItemSendResult(int taskid, int itemid, bool result, string errinfo, string balance)
47
+        {
48
+            bool bl = false;
49
+            var item = new 阿里短信任务执行表().GetModelList(" 任务条目ID=" + itemid + " and 任务ID=" + taskid).FirstOrDefault();
50
+            var tablename = DbHelperSQL.GetSingle("SELECT [任务条目子表名称] FROM [阿里短信任务表] WHERE [ID]=" + taskid);
51
+            string sql1 = "DELETE FROM [阿里短信任务执行表] WHERE [任务ID]=" + taskid + " AND [任务条目ID]=" + itemid;
52
+            string sql2 = "UPDATE " + tablename + " SET [已执行次数]=[已执行次数]+1,状态=" + (result ? 3 : 2)
53
+                + ",最后执行方式=2,最后执行时间=GETDATE(),最后执行是否成功=" + (result ? 1 : -1) + ",最后执行失败原因='" + errinfo
54
+                + "' WHERE 任务ID=" + taskid + " AND [ID]=" + itemid;
55
+            string sql3 = "UPDATE 阿里短信任务表 SET [执行完成数量]=[执行完成数量]+1,[未执行数量]=[未执行数量]-1,[短信已执行完成数量]=[短信已执行完成数量]+1 WHERE ID=" + taskid;
56
+            string sql4 = "INSERT INTO [任务执行历史表] ([任务ID],[任务条目表名],[任务条目ID],[号码],[结果],[执行方式],[执行时间],[执行内容]) VALUES ('"
57
+                + taskid + "','" + tablename + "','" + itemid + "','" + item.号码 + "','" + (result ? 3 : 2) + "',2,GETDATE(),'" + errinfo + "')";
58
+
59
+
60
+            List<string> sqls = new List<string> { sql1, sql2, sql3, sql4 };
61
+
62
+            if (result)
63
+            {
64
+                //string sql5 = "UPDATE T_Sys_SystemConfig SET [F_ParamValue]=CONVERT(VARCHAR(100),CONVERT(DECIMAL(18,2),[F_ParamValue])-" + price + ")  WHERE F_ParamCode='SMSBalance'";
65
+                string sql5 = "UPDATE T_Sys_SystemConfig SET [F_ParamValue]='" + balance + "'  WHERE F_ParamCode='SMSBalance'";
66
+                sqls.Add(sql5);
67
+            }
68
+
69
+            int n = DbHelperSQL.ExecuteSqlTran(sqls);
70
+            if (n > 0)
71
+            {
72
+                string sql = "UPDATE 阿里短信任务表 SET 短信任务状态='终止' WHERE [短信已执行完成数量]=[短信任务数量] AND ID=" + taskid;
73
+                DbHelperSQL.ExecuteSql(sql);
74
+
75
+                bl = true;
76
+            }
77
+
78
+            return bl;
79
+        }
80
+    }
81
+}

+ 237 - 0
HySoftSMS/阿里短信任务表.cs

@@ -0,0 +1,237 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace HySoftSMS
8
+{
9
+    // <summary>
10
+    /// 阿里短信任务表:实体类(属性说明自动提取数据库字段的描述信息)
11
+    /// </summary>
12
+    [Serializable]
13
+    public partial class 阿里短信任务表
14
+    {
15
+        public 阿里短信任务表()
16
+        { }
17
+        #region Model
18
+        private int _id;
19
+        private string _名称;
20
+        private string _任务状态;
21
+        private string _任务类型;
22
+        private int? _通知方式;
23
+        private int? _任务优先级;
24
+        private DateTime? _计划开始时间;
25
+        private DateTime? _任务首次执行时间;
26
+        private DateTime? _任务终止时间;
27
+        private int? _业务分类id;
28
+        private int? _短信模板id;
29
+        private int? _任务提交人id;
30
+        private DateTime? _任务提交时间;
31
+        private int? _任务总数;
32
+        private int? _执行完成数量;
33
+        private int? _未执行数量;
34
+        private string _短信任务状态;
35
+        private int? _短信任务数量;
36
+        private int? _短信已执行完成数量;
37
+        private string _任务条目子表名称;
38
+        private DateTime? _a时段开始时间;
39
+        private DateTime? _a时段结束时间;
40
+        private DateTime? _b时段开始时间;
41
+        private DateTime? _b时段结束时间;
42
+        /// <summary>
43
+        /// 
44
+        /// </summary>
45
+        public int ID
46
+        {
47
+            set { _id = value; }
48
+            get { return _id; }
49
+        }
50
+        /// <summary>
51
+        /// 
52
+        /// </summary>
53
+        public string 名称
54
+        {
55
+            set { _名称 = value; }
56
+            get { return _名称; }
57
+        }
58
+        /// <summary>
59
+        /// 
60
+        /// </summary>
61
+        public string 任务状态
62
+        {
63
+            set { _任务状态 = value; }
64
+            get { return _任务状态; }
65
+        }
66
+        /// <summary>
67
+        /// 
68
+        /// </summary>
69
+        public string 任务类型
70
+        {
71
+            set { _任务类型 = value; }
72
+            get { return _任务类型; }
73
+        }
74
+        /// <summary>
75
+        /// 
76
+        /// </summary>
77
+        public int? 通知方式
78
+        {
79
+            set { _通知方式 = value; }
80
+            get { return _通知方式; }
81
+        }
82
+        /// <summary>
83
+        /// 
84
+        /// </summary>
85
+        public int? 任务优先级
86
+        {
87
+            set { _任务优先级 = value; }
88
+            get { return _任务优先级; }
89
+        }
90
+        /// <summary>
91
+        /// 
92
+        /// </summary>
93
+        public DateTime? 计划开始时间
94
+        {
95
+            set { _计划开始时间 = value; }
96
+            get { return _计划开始时间; }
97
+        }
98
+        /// <summary>
99
+        /// 
100
+        /// </summary>
101
+        public DateTime? 任务首次执行时间
102
+        {
103
+            set { _任务首次执行时间 = value; }
104
+            get { return _任务首次执行时间; }
105
+        }
106
+        /// <summary>
107
+        /// 
108
+        /// </summary>
109
+        public DateTime? 任务终止时间
110
+        {
111
+            set { _任务终止时间 = value; }
112
+            get { return _任务终止时间; }
113
+        }
114
+        /// <summary>
115
+        /// 
116
+        /// </summary>
117
+        public int? 业务分类ID
118
+        {
119
+            set { _业务分类id = value; }
120
+            get { return _业务分类id; }
121
+        }
122
+        /// <summary>
123
+        /// 
124
+        /// </summary>
125
+        public int? 短信模板ID
126
+        {
127
+            set { _短信模板id = value; }
128
+            get { return _短信模板id; }
129
+        }
130
+        /// <summary>
131
+        /// 
132
+        /// </summary>
133
+        public int? 任务提交人ID
134
+        {
135
+            set { _任务提交人id = value; }
136
+            get { return _任务提交人id; }
137
+        }
138
+        /// <summary>
139
+        /// 
140
+        /// </summary>
141
+        public DateTime? 任务提交时间
142
+        {
143
+            set { _任务提交时间 = value; }
144
+            get { return _任务提交时间; }
145
+        }
146
+        /// <summary>
147
+        /// 
148
+        /// </summary>
149
+        public int? 任务总数
150
+        {
151
+            set { _任务总数 = value; }
152
+            get { return _任务总数; }
153
+        }
154
+        /// <summary>
155
+        /// 
156
+        /// </summary>
157
+        public int? 执行完成数量
158
+        {
159
+            set { _执行完成数量 = value; }
160
+            get { return _执行完成数量; }
161
+        }
162
+        /// <summary>
163
+        /// 
164
+        /// </summary>
165
+        public int? 未执行数量
166
+        {
167
+            set { _未执行数量 = value; }
168
+            get { return _未执行数量; }
169
+        }
170
+        /// <summary>
171
+        /// 
172
+        /// </summary>
173
+        public string 短信任务状态
174
+        {
175
+            set { _短信任务状态 = value; }
176
+            get { return _短信任务状态; }
177
+        }
178
+        /// <summary>
179
+        /// 
180
+        /// </summary>
181
+        public int? 短信任务数量
182
+        {
183
+            set { _短信任务数量 = value; }
184
+            get { return _短信任务数量; }
185
+        }
186
+        /// <summary>
187
+        /// 
188
+        /// </summary>
189
+        public int? 短信已执行完成数量
190
+        {
191
+            set { _短信已执行完成数量 = value; }
192
+            get { return _短信已执行完成数量; }
193
+        }
194
+        /// <summary>
195
+        /// 
196
+        /// </summary>
197
+        public string 任务条目子表名称
198
+        {
199
+            set { _任务条目子表名称 = value; }
200
+            get { return _任务条目子表名称; }
201
+        }
202
+        /// <summary>
203
+        /// 
204
+        /// </summary>
205
+        public DateTime? a时段开始时间
206
+        {
207
+            set { _a时段开始时间 = value; }
208
+            get { return _a时段开始时间; }
209
+        }
210
+        /// <summary>
211
+        /// 
212
+        /// </summary>
213
+        public DateTime? a时段结束时间
214
+        {
215
+            set { _a时段结束时间 = value; }
216
+            get { return _a时段结束时间; }
217
+        }
218
+        /// <summary>
219
+        /// 
220
+        /// </summary>
221
+        public DateTime? b时段开始时间
222
+        {
223
+            set { _b时段开始时间 = value; }
224
+            get { return _b时段开始时间; }
225
+        }
226
+        /// <summary>
227
+        /// 
228
+        /// </summary>
229
+        public DateTime? b时段结束时间
230
+        {
231
+            set { _b时段结束时间 = value; }
232
+            get { return _b时段结束时间; }
233
+        }
234
+        #endregion Model
235
+
236
+    }
237
+}

+ 65 - 0
HySoftSMS。BLL/HySoftSMS.BLL.csproj

@@ -0,0 +1,65 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4
+  <PropertyGroup>
5
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7
+    <ProjectGuid>{31F4CA87-7E73-43CE-991D-3707E4D8D25E}</ProjectGuid>
8
+    <OutputType>Library</OutputType>
9
+    <AppDesignerFolder>Properties</AppDesignerFolder>
10
+    <RootNamespace>HySoftSMS_BLL</RootNamespace>
11
+    <AssemblyName>HySoftSMS。BLL</AssemblyName>
12
+    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
13
+    <FileAlignment>512</FileAlignment>
14
+  </PropertyGroup>
15
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16
+    <DebugSymbols>true</DebugSymbols>
17
+    <DebugType>full</DebugType>
18
+    <Optimize>false</Optimize>
19
+    <OutputPath>bin\Debug\</OutputPath>
20
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
21
+    <ErrorReport>prompt</ErrorReport>
22
+    <WarningLevel>4</WarningLevel>
23
+  </PropertyGroup>
24
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25
+    <DebugType>pdbonly</DebugType>
26
+    <Optimize>true</Optimize>
27
+    <OutputPath>bin\Release\</OutputPath>
28
+    <DefineConstants>TRACE</DefineConstants>
29
+    <ErrorReport>prompt</ErrorReport>
30
+    <WarningLevel>4</WarningLevel>
31
+  </PropertyGroup>
32
+  <ItemGroup>
33
+    <Reference Include="System" />
34
+    <Reference Include="System.Core" />
35
+    <Reference Include="System.Xml.Linq" />
36
+    <Reference Include="System.Data.DataSetExtensions" />
37
+    <Reference Include="Microsoft.CSharp" />
38
+    <Reference Include="System.Data" />
39
+    <Reference Include="System.Net.Http" />
40
+    <Reference Include="System.Xml" />
41
+  </ItemGroup>
42
+  <ItemGroup>
43
+    <Compile Include="阿里短信任务执行表.cs" />
44
+    <Compile Include="阿里短信任务表.cs" />
45
+    <Compile Include="Properties\AssemblyInfo.cs" />
46
+  </ItemGroup>
47
+  <ItemGroup>
48
+    <ProjectReference Include="..\HySoftSMS.DAL\HySoftSMS.DAL.csproj">
49
+      <Project>{184b0510-cb6c-45f1-8e4d-74daab55caf2}</Project>
50
+      <Name>HySoftSMS.DAL</Name>
51
+    </ProjectReference>
52
+    <ProjectReference Include="..\HySoftSMS.Model\HySoftSMS.Model.csproj">
53
+      <Project>{e9840689-06b7-4de8-98b8-04c37a2f2f0e}</Project>
54
+      <Name>HySoftSMS.Model</Name>
55
+    </ProjectReference>
56
+  </ItemGroup>
57
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
58
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
59
+       Other similar extension points exist, see Microsoft.Common.targets.
60
+  <Target Name="BeforeBuild">
61
+  </Target>
62
+  <Target Name="AfterBuild">
63
+  </Target>
64
+  -->
65
+</Project>

+ 36 - 0
HySoftSMS。BLL/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
1
+using System.Reflection;
2
+using System.Runtime.CompilerServices;
3
+using System.Runtime.InteropServices;
4
+
5
+// 有关程序集的一般信息由以下
6
+// 控制。更改这些特性值可修改
7
+// 与程序集关联的信息。
8
+[assembly: AssemblyTitle("HySoftSMS。BLL")]
9
+[assembly: AssemblyDescription("")]
10
+[assembly: AssemblyConfiguration("")]
11
+[assembly: AssemblyCompany("")]
12
+[assembly: AssemblyProduct("HySoftSMS。BLL")]
13
+[assembly: AssemblyCopyright("Copyright ©  2018")]
14
+[assembly: AssemblyTrademark("")]
15
+[assembly: AssemblyCulture("")]
16
+
17
+//将 ComVisible 设置为 false 将使此程序集中的类型
18
+//对 COM 组件不可见。  如果需要从 COM 访问此程序集中的类型,
19
+//请将此类型的 ComVisible 特性设置为 true。
20
+[assembly: ComVisible(false)]
21
+
22
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23
+[assembly: Guid("31f4ca87-7e73-43ce-991d-3707e4d8d25e")]
24
+
25
+// 程序集的版本信息由下列四个值组成: 
26
+//
27
+//      主版本
28
+//      次版本
29
+//      生成号
30
+//      修订号
31
+//
32
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33
+// 方法是按如下所示使用“*”: :
34
+// [assembly: AssemblyVersion("1.0.*")]
35
+[assembly: AssemblyVersion("1.0.0.0")]
36
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 148 - 0
HySoftSMS。BLL/阿里短信任务执行表.cs

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

+ 147 - 0
HySoftSMS。BLL/阿里短信任务表.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 HySoftSMS.BLL
9
+{
10
+    /// <summary>
11
+    /// 阿里短信任务表
12
+    /// </summary>
13
+    public partial class 阿里短信任务表
14
+    {
15
+        private readonly HySoftSMS.DAL.阿里短信任务表 dal = new DAL.阿里短信任务表();
16
+        public 阿里短信任务表()
17
+        { }
18
+        #region  BasicMethod
19
+        /// <summary>
20
+        /// 是否存在该记录
21
+        /// </summary>
22
+        public bool Exists(int ID)
23
+        {
24
+            return dal.Exists(ID);
25
+        }
26
+
27
+        /// <summary>
28
+        /// 增加一条数据
29
+        /// </summary>
30
+        public int Add(Model.阿里短信任务表 model)
31
+        {
32
+            return dal.Add(model);
33
+        }
34
+
35
+        /// <summary>
36
+        /// 更新一条数据
37
+        /// </summary>
38
+        public bool Update(Model.阿里短信任务表 model)
39
+        {
40
+            return dal.Update(model);
41
+        }
42
+
43
+        /// <summary>
44
+        /// 删除一条数据
45
+        /// </summary>
46
+        public bool Delete(int ID)
47
+        {
48
+
49
+            return dal.Delete(ID);
50
+        }
51
+        /// <summary>
52
+        /// 删除一条数据
53
+        /// </summary>
54
+        public bool DeleteList(string IDlist)
55
+        {
56
+            return dal.DeleteList(IDlist);
57
+        }
58
+
59
+        /// <summary>
60
+        /// 得到一个对象实体
61
+        /// </summary>
62
+        public Model.阿里短信任务表 GetModel(int ID)
63
+        {
64
+
65
+            return dal.GetModel(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<Model.阿里短信任务表> 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<Model.阿里短信任务表> DataTableToList(DataTable dt)
94
+        {
95
+            List<Model.阿里短信任务表> modelList = new List<Model.阿里短信任务表>();
96
+            int rowsCount = dt.Rows.Count;
97
+            if (rowsCount > 0)
98
+            {
99
+                Model.阿里短信任务表 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
+}