Browse Source

修改类名 去掉拓思德点阵笔初始化

tags/对接微服务前
张剑 3 years ago
parent
commit
a5bd407a73

+ 0
- 274
XHWK.WKTool/DAL/DAL_TmatrixCode.cs View File

1
-using Common.system;
2
-
3
-using Newtonsoft.Json.Linq;
4
-
5
-using System;
6
-using System.Collections.Specialized;
7
-using System.Threading;
8
-
9
-using XHWK.Model;
10
-
11
-namespace XHWK.WKTool.DAL
12
-{
13
-    /// <summary>
14
-    /// TQL在线铺码服务-改为SDK  暂无用
15
-    /// </summary>
16
-    public class DAL_TmatrixCode
17
-    {
18
-        /// <summary>
19
-        /// TQL铺码地址
20
-        /// </summary>
21
-        private string TmatrixCodeURL = APP.TmatrixCodeURL;
22
-        /// <summary>
23
-        /// TQL用户名
24
-        /// </summary>
25
-        string TQLUserName = "test122";
26
-        /// <summary>
27
-        /// TQL密码
28
-        /// </summary>
29
-        string TQLPassword = "123456";
30
-        /// <summary>
31
-        /// 用户登陆后的用户ID
32
-        /// </summary>
33
-        string UserID;
34
-        /// <summary>
35
-        /// 分配的铺码 ID
36
-        /// </summary>
37
-        string pageserial;
38
-        //1000 操作成功
39
-        //1001 打开数据库失败
40
-        //1002 用户名或密码错误
41
-        //1003 Key 信息错误(过期或已使用完)
42
-        //1004 上传 Pdf 文档无法打开
43
-        //1005 铺码初始化失败
44
-        //1006 铺码错误
45
-        //1007 Json 数据错误
46
-        //1008 接口错误
47
-        //1009 UserID 错误
48
-        //1010 未查到该历史数据
49
-        /// <summary>
50
-        /// TQL登陆
51
-        /// </summary>
52
-        /// <param name="Message"></param>
53
-        /// <returns></returns>
54
-        public bool TQLUserLogin(out string Message)
55
-        {
56
-            Exception ex = null;
57
-            Message = "";//请求重试5次 共5秒
58
-            for (int num = 0; num < 5; num++)
59
-            {
60
-                try
61
-                {
62
-                    JObject jo = HttpHelper.PostFunction(TmatrixCodeURL + @"/TmatrixCode/User/UserLogin", @"application/x-www-form-urlencoded", @"userName=" + TQLUserName + "&password=" + TQLPassword, "");
63
-                    if (jo == null)
64
-                    {
65
-                        Message = "无法访问铺码服务器,请检查网络或铺码服务器地址。";
66
-                        return false;
67
-                    }
68
-                    //"state":"1000",
69
-                    //"message":"File upload was succeed!",
70
-                    //" userID ":"1"
71
-                    //1000 操作成功
72
-                    if (jo["state"].ToString() == "1000")
73
-                    {
74
-                        Message = "";
75
-                        //登陆成功后用户ID
76
-                        UserID = jo["userID"].ToString();
77
-                        return true;
78
-                    }
79
-                    else
80
-                    {
81
-                        Message = jo["message"].ToString();
82
-                        return false;
83
-                    }
84
-                }
85
-                catch (Exception e)
86
-                {
87
-                    Message = "无法访问铺码服务器:" + e.Message;
88
-                    ex = e;
89
-                    Thread.Sleep(1000);
90
-                }
91
-            }
92
-            string ErrMessage = "【TQL登陆】(TQLUserLogin):请求失败。" + Message;
93
-            LogHelper.WriteErrLog(ErrMessage, ex);
94
-            return false;
95
-        }
96
-
97
-        /// <summary>
98
-        /// TQL上传文件
99
-        /// </summary>
100
-        /// <param name="filePath">文件路径</param>
101
-        /// <param name="fileName">文件名</param>
102
-        /// <param name="Message"></param>
103
-        /// <returns></returns>
104
-        public bool TQLStartTmatrix(string filePath, string fileName, out string Message)
105
-        {
106
-            Exception ex = null;
107
-            Message = "";//请求重试5次 共5秒
108
-            if (string.IsNullOrWhiteSpace(UserID))
109
-            {
110
-                if (!TQLUserLogin(out Message))
111
-                {
112
-                    return false;
113
-                }
114
-            }
115
-            for (int num = 0; num < 5; num++)
116
-            {
117
-                try
118
-                {
119
-                    //byte[] byteArray = FileToolsCommon.ReadBigFileSpecifyLength(VideoInfo.VideoPath, len, (int)VideoInfo.SliceLen);
120
-                    //userID Y 字符 登录之后分配的 ID
121
-                    //callBack Y 回调 API 该 API 由应用方提供,为 post 请求
122
-                    //createimage Y 字符 是否生成 png 图片(若生 成则会进行文件打包成 zip)0,不生成,1 生 成。
123
-                    //fileName Y 字符 文件名称数组
124
-                    //tmatrixType Y 字符 铺码类型(0.600DPI 打 印、1.1200DPI 打印、 2.印刷
125
-                    //fileData
126
-                    //参数
127
-                    NameValueCollection formFields = new NameValueCollection
128
-                            {
129
-                                { "userID", UserID },
130
-                                { "callBack", ""},
131
-                                { "createimage", "0" },
132
-                                { "fileName", fileName },
133
-                                { "tmatrixType", "1" }
134
-                            };
135
-                    string[] PathList = new string[] { filePath };
136
-                    JObject jo = HttpHelper.UploadFilesToRemoteUrl(TmatrixCodeURL + @"/TmatrixCode/User/startTmatrix", PathList, "", formFields);
137
-                    if (jo == null)
138
-                    {
139
-                        Message = "无法访问铺码服务器,请检查网络或铺码服务器地址。";
140
-                        return false;
141
-                    }
142
-                    Model_TmatrixCode resultObj = JsonHelper.JsonToObj<Model_TmatrixCode>(jo.ToString());
143
-
144
-                    //1000 操作成功
145
-                    if (resultObj.state == "1000")
146
-                    {
147
-                        Message = "";
148
-                        pageserial = resultObj.pageserial;
149
-                        return true;
150
-                    }
151
-                    else
152
-                    {
153
-                        Message = resultObj.message;
154
-                        return false;
155
-                    }
156
-                }
157
-                catch (Exception e)
158
-                {
159
-                    Message = "无法访问铺码服务器:" + e.Message;
160
-                    ex = e;
161
-                    Thread.Sleep(1000);
162
-                }
163
-            }
164
-            string ErrMessage = "【TQL上传】(TQLStartTmatrix):请求失败。" + Message;
165
-            LogHelper.WriteErrLog(ErrMessage, ex);
166
-            return false;
167
-        }
168
-
169
-        /// <summary>
170
-        /// 查询进度
171
-        /// </summary>
172
-        /// <param name="Message"></param>
173
-        /// <returns>-1失败 0:未铺码 1:正在铺码 2:铺码完成,3:未查到。</returns>
174
-        public int TQLSchedulequery(out string Message)
175
-        {
176
-            Exception ex = null;
177
-            Message = "";//请求重试5次 共5秒
178
-            for (int num = 0; num < 5; num++)
179
-            {
180
-                try
181
-                {
182
-                    string[] pageserialList = new string[] { pageserial };
183
-                    JObject jo = HttpHelper.PostFunction(TmatrixCodeURL + @"/TmatrixCode/User/schedulequery", @"application/x-www-form-urlencoded", @"userID=" + UserID + "&pageserialList=" + pageserialList, "");
184
-                    if (jo == null)
185
-                    {
186
-                        Message = "无法访问铺码服务器,请检查网络或铺码服务器地址。";
187
-                        return -1;
188
-                    }
189
-                    Model_ScheduleQuery resultObj = JsonHelper.JsonToObj<Model_ScheduleQuery>(jo.ToString());
190
-
191
-                    //1000 操作成功
192
-                    if (resultObj.state == "1000")
193
-                    {
194
-                        //state Y 字符 返回标志
195
-                        //message Y 字符 返回标志说明
196
-                        //list Y 字符 进度数组
197
-                        //schedule Y 字符 返回铺码进度:0 - 100
198
-                        //pageserial 铺码 ID 字符 铺码 ID
199
-                        //state Y 数字 0:未铺码 1:正在铺码 2:铺码完成,3:未查到。
200
-                        Message = "";
201
-                        return int.Parse(resultObj.list.Find(x => x.pageserial == pageserial).state);
202
-                    }
203
-                    else
204
-                    {
205
-                        Message = resultObj.message;
206
-                        return -1;
207
-                    }
208
-                }
209
-                catch (Exception e)
210
-                {
211
-                    Message = "无法访问铺码服务器:" + e.Message;
212
-                    ex = e;
213
-                    Thread.Sleep(1000);
214
-                }
215
-            }
216
-            string ErrMessage = "【TQL查询进度】(TQLSchedulequery):请求失败。" + Message;
217
-            LogHelper.WriteErrLog(ErrMessage, ex);
218
-            return -1;
219
-        }
220
-
221
-        /// <summary>
222
-        /// TQL历史查询
223
-        /// </summary>
224
-        /// <param name="Message"></param>
225
-        /// <returns></returns>
226
-        public string TQLHistoryQuery(string fileName, string startPage, string maxPage, out string Message)
227
-        {
228
-            Exception ex = null;
229
-            Message = "";//请求重试5次 共5秒
230
-            for (int num = 0; num < 5; num++)
231
-            {
232
-                try
233
-                {
234
-                    //userID Y 字符 登录之后分配的 ID
235
-                    //fileName N 字符 查询文件名称
236
-                    //pageserial N 字符 铺码 ID(铺码 ID 或文件名必须设置一个)
237
-                    //startPage Y int 开始查询页码,从 1 开 始
238
-                    //maxPage Y int 最大页码数
239
-                    JObject jo = HttpHelper.PostFunction(TmatrixCodeURL + @"/TmatrixCode/User/HistoryQuery", @"application/x-www-form-urlencoded", @"userID=" + UserID + "&fileName=" + fileName + "&pageserial=" + pageserial + "&startPage=" + startPage + "&maxPage=" + maxPage, "");
240
-                    if (jo == null)
241
-                    {
242
-                        Message = "无法访问铺码服务器,请检查网络或铺码服务器地址。";
243
-                        return "";
244
-                    }
245
-
246
-                    Model_HistoryQuery resultObj = JsonHelper.JsonToObj<Model_HistoryQuery>(jo.ToString());
247
-                    //1000 操作成功
248
-                    if (resultObj.state == "1000")
249
-                    {
250
-                        Message = "";
251
-                        Model_HistoryPageList model_HistoryPageList = resultObj.pageList[0];
252
-                        Model_HistoryListItem model_HistoryListItem = model_HistoryPageList.list.Find(x => x.pageserial == pageserial);
253
-
254
-                        return model_HistoryListItem.url;
255
-                    }
256
-                    else
257
-                    {
258
-                        Message = resultObj.message;
259
-                        return "";
260
-                    }
261
-                }
262
-                catch (Exception e)
263
-                {
264
-                    Message = "无法访问铺码服务器:" + e.Message;
265
-                    ex = e;
266
-                    Thread.Sleep(1000);
267
-                }
268
-            }
269
-            string ErrMessage = "【TQL查询历史记录】(TQLHistoryQuery):请求失败。" + Message;
270
-            LogHelper.WriteErrLog(ErrMessage, ex);
271
-            return "";
272
-        }
273
-    }
274
-}

XHWK.WKTool/DAL/Interface.cs → XHWK.WKTool/DAL/XHApi.cs View File

11
 
11
 
12
 namespace XHWK.WKTool.DAL
12
 namespace XHWK.WKTool.DAL
13
 {
13
 {
14
-    public class Interface
14
+    public class XHApi
15
     {
15
     {
16
         /// <summary>
16
         /// <summary>
17
         /// 激活信息--添加
17
         /// 激活信息--添加

+ 1
- 1
XHWK.WKTool/KeyVerification.xaml.cs View File

18
          */
18
          */
19
     public partial class KeyVerification : Window
19
     public partial class KeyVerification : Window
20
     {
20
     {
21
-        private readonly Interface registerController = new Interface();
21
+        private readonly XHApi registerController = new XHApi();
22
         private int serverReturnCode = 0;
22
         private int serverReturnCode = 0;
23
 
23
 
24
         public KeyVerification()
24
         public KeyVerification()

+ 48
- 26
XHWK.WKTool/LoginWindow.xaml.cs View File

21
         /// <summary>
21
         /// <summary>
22
         /// 调用接口
22
         /// 调用接口
23
         /// </summary>
23
         /// </summary>
24
-        private readonly Interface @interface = new Interface();
24
+        private readonly XHApi xhapi = new XHApi();
25
 
25
 
26
         public LoginWindow()
26
         public LoginWindow()
27
         {
27
         {
47
         /// <summary>
47
         /// <summary>
48
         /// 关闭事件
48
         /// 关闭事件
49
         /// </summary>
49
         /// </summary>
50
-        /// <param name="sender"></param>
51
-        /// <param name="e"></param>
50
+        /// <param name="sender">
51
+        /// </param>
52
+        /// <param name="e">
53
+        /// </param>
52
         private void BtnDown_Click(object sender, RoutedEventArgs e)
54
         private void BtnDown_Click(object sender, RoutedEventArgs e)
53
         {
55
         {
54
             txbAccountNumber.Text = string.Empty;
56
             txbAccountNumber.Text = string.Empty;
59
         /// <summary>
61
         /// <summary>
60
         /// 登录事件
62
         /// 登录事件
61
         /// </summary>
63
         /// </summary>
62
-        /// <param name="sender"></param>
63
-        /// <param name="e"></param>
64
+        /// <param name="sender">
65
+        /// </param>
66
+        /// <param name="e">
67
+        /// </param>
64
         private void BtnStart_Click(object sender, RoutedEventArgs e)
68
         private void BtnStart_Click(object sender, RoutedEventArgs e)
65
         {
69
         {
66
             #region 获取服务接口地址 --2021年7月9日赵耀
70
             #region 获取服务接口地址 --2021年7月9日赵耀
108
             accountNumber = txbAccountNumber.Text.Replace(" ", "").Trim();
112
             accountNumber = txbAccountNumber.Text.Replace(" ", "").Trim();
109
             password = pobPassword.Password.Replace(" ", "").Trim();
113
             password = pobPassword.Password.Replace(" ", "").Trim();
110
 
114
 
111
-            int code = @interface.Login(accountNumber, password);
115
+            int code = xhapi.Login(accountNumber, password);
112
             if (code == 0)
116
             if (code == 0)
113
             {
117
             {
114
                 FileToolsCommon.CreateDirectory(APP.DataPath);
118
                 FileToolsCommon.CreateDirectory(APP.DataPath);
136
                 if (!string.IsNullOrWhiteSpace(APP.UserInfo.Headpic))
140
                 if (!string.IsNullOrWhiteSpace(APP.UserInfo.Headpic))
137
                 {
141
                 {
138
                     //FileToolsCommon.
142
                     //FileToolsCommon.
139
-                    @interface.DownloadAvatar(APP.UserInfo.Headpic, HeadpicPath);
143
+                    xhapi.DownloadAvatar(APP.UserInfo.Headpic, HeadpicPath);
140
                 }
144
                 }
141
 
145
 
142
                 #endregion 下载头像
146
                 #endregion 下载头像
154
         /// <summary>
158
         /// <summary>
155
         /// 记住账号
159
         /// 记住账号
156
         /// </summary>
160
         /// </summary>
157
-        /// <param name="sender"></param>
158
-        /// <param name="e"></param>
161
+        /// <param name="sender">
162
+        /// </param>
163
+        /// <param name="e">
164
+        /// </param>
159
         private void CkSaveName_Click(object sender, RoutedEventArgs e)
165
         private void CkSaveName_Click(object sender, RoutedEventArgs e)
160
         {
166
         {
161
         }
167
         }
163
         /// <summary>
169
         /// <summary>
164
         /// 读取客户设置
170
         /// 读取客户设置
165
         /// </summary>
171
         /// </summary>
166
-        /// <param name="settingName"></param>
167
-        /// <returns></returns>
172
+        /// <param name="settingName">
173
+        /// </param>
174
+        /// <returns>
175
+        /// </returns>
168
         public static string GetSettingString(string settingName)
176
         public static string GetSettingString(string settingName)
169
         {
177
         {
170
             try
178
             try
181
         /// <summary>
189
         /// <summary>
182
         /// 更新设置
190
         /// 更新设置
183
         /// </summary>
191
         /// </summary>
184
-        /// <param name="settingName"></param>
185
-        /// <param name="valueName"></param>
192
+        /// <param name="settingName">
193
+        /// </param>
194
+        /// <param name="valueName">
195
+        /// </param>
186
         public static void UpdateSettingString(string settingName, string valueName)
196
         public static void UpdateSettingString(string settingName, string valueName)
187
         {
197
         {
188
             Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
198
             Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
199
         /// <summary>
209
         /// <summary>
200
         /// 限制输入特殊字符
210
         /// 限制输入特殊字符
201
         /// </summary>
211
         /// </summary>
202
-        /// <param name="sender"></param>
203
-        /// <param name="e"></param>
212
+        /// <param name="sender">
213
+        /// </param>
214
+        /// <param name="e">
215
+        /// </param>
204
         private void txbAccountNumber_PreviewTextInput(object sender, TextCompositionEventArgs e)
216
         private void txbAccountNumber_PreviewTextInput(object sender, TextCompositionEventArgs e)
205
         {
217
         {
206
             try
218
             try
235
         /// <summary>
247
         /// <summary>
236
         /// 打开服务地址
248
         /// 打开服务地址
237
         /// </summary>
249
         /// </summary>
238
-        /// <param name="sender"></param>
239
-        /// <param name="e"></param>
250
+        /// <param name="sender">
251
+        /// </param>
252
+        /// <param name="e">
253
+        /// </param>
240
         private void BtnServiceAddress_Click(object sender, RoutedEventArgs e)
254
         private void BtnServiceAddress_Click(object sender, RoutedEventArgs e)
241
         {
255
         {
242
             GridLoginPage.Visibility = Visibility.Collapsed;
256
             GridLoginPage.Visibility = Visibility.Collapsed;
246
         /// <summary>
260
         /// <summary>
247
         /// 取消
261
         /// 取消
248
         /// </summary>
262
         /// </summary>
249
-        /// <param name="sender"></param>
250
-        /// <param name="e"></param>
263
+        /// <param name="sender">
264
+        /// </param>
265
+        /// <param name="e">
266
+        /// </param>
251
         private void BtnCancel_Click(object sender, RoutedEventArgs e)
267
         private void BtnCancel_Click(object sender, RoutedEventArgs e)
252
         {
268
         {
253
             GridLoginPage.Visibility = Visibility.Visible;
269
             GridLoginPage.Visibility = Visibility.Visible;
257
         /// <summary>
273
         /// <summary>
258
         /// 服务地址设置
274
         /// 服务地址设置
259
         /// </summary>
275
         /// </summary>
260
-        /// <param name="sender"></param>
261
-        /// <param name="e"></param>
276
+        /// <param name="sender">
277
+        /// </param>
278
+        /// <param name="e">
279
+        /// </param>
262
         private void BtnSetServiceAddress_Click(object sender, RoutedEventArgs e)
280
         private void BtnSetServiceAddress_Click(object sender, RoutedEventArgs e)
263
         {
281
         {
264
             #region 获取服务地址 -- 2021年7月8日赵耀
282
             #region 获取服务地址 -- 2021年7月8日赵耀
265
 
283
 
266
             if (!string.IsNullOrWhiteSpace(TbxServiceAddress.Text))
284
             if (!string.IsNullOrWhiteSpace(TbxServiceAddress.Text))
267
             {
285
             {
268
-                if (@interface.GetServiceAddress(TbxServiceAddress.Text, out string Message))
286
+                if (xhapi.GetServiceAddress(TbxServiceAddress.Text, out string Message))
269
                 {
287
                 {
270
                     APP.SaveServiceAddressData();
288
                     APP.SaveServiceAddressData();
271
                     APP.SwitchAddress();
289
                     APP.SwitchAddress();
288
         /// <summary>
306
         /// <summary>
289
         /// 校外
307
         /// 校外
290
         /// </summary>
308
         /// </summary>
291
-        /// <param name="sender"></param>
292
-        /// <param name="e"></param>
309
+        /// <param name="sender">
310
+        /// </param>
311
+        /// <param name="e">
312
+        /// </param>
293
         private void RbnIsOutsideSchool_Checked(object sender, RoutedEventArgs e)
313
         private void RbnIsOutsideSchool_Checked(object sender, RoutedEventArgs e)
294
         {
314
         {
295
             APP.IsOutsideSchool = true;
315
             APP.IsOutsideSchool = true;
303
         /// <summary>
323
         /// <summary>
304
         /// 校内
324
         /// 校内
305
         /// </summary>
325
         /// </summary>
306
-        /// <param name="sender"></param>
307
-        /// <param name="e"></param>
326
+        /// <param name="sender">
327
+        /// </param>
328
+        /// <param name="e">
329
+        /// </param>
308
         private void RbnSchool_Checked(object sender, RoutedEventArgs e)
330
         private void RbnSchool_Checked(object sender, RoutedEventArgs e)
309
         {
331
         {
310
             APP.IsOutsideSchool = false;
332
             APP.IsOutsideSchool = false;

+ 1
- 1
XHWK.WKTool/ProductVerification.xaml.cs View File

20
          */
20
          */
21
     public partial class ProductVerification : Window
21
     public partial class ProductVerification : Window
22
     {
22
     {
23
-        private readonly Interface registerController = new Interface();
23
+        private readonly XHApi registerController = new XHApi();
24
         private int serverReturnCode = 0;
24
         private int serverReturnCode = 0;
25
 
25
 
26
         public ProductVerification()
26
         public ProductVerification()

+ 46
- 22
XHWK.WKTool/UploadWindow.xaml.cs View File

1
 using Common.system;
1
 using Common.system;
2
 
2
 
3
 using System;
3
 using System;
4
-using System.Collections.ObjectModel;
5
 using System.Threading;
4
 using System.Threading;
5
+using System.Collections.ObjectModel;
6
 using System.Windows;
6
 using System.Windows;
7
 using System.Windows.Controls;
7
 using System.Windows.Controls;
8
 using System.Windows.Input;
8
 using System.Windows.Input;
22
         /// <summary>
22
         /// <summary>
23
         /// 调用接口
23
         /// 调用接口
24
         /// </summary>
24
         /// </summary>
25
-        private readonly Interface @interface = new Interface();
25
+        private readonly XHApi xhapi = new XHApi();
26
+
26
         /// <summary>
27
         /// <summary>
27
         /// 前台数据
28
         /// 前台数据
28
         /// </summary>
29
         /// </summary>
29
         internal LoginPageData pageData = new LoginPageData();
30
         internal LoginPageData pageData = new LoginPageData();
31
+
30
         /// <summary>
32
         /// <summary>
31
         /// 文件名
33
         /// 文件名
32
         /// </summary>
34
         /// </summary>
33
         private string Resourcename = string.Empty;
35
         private string Resourcename = string.Empty;
36
+
34
         /// <summary>
37
         /// <summary>
35
         /// 文件大小
38
         /// 文件大小
36
         /// </summary>
39
         /// </summary>
37
         private long Resourcesize = 0;
40
         private long Resourcesize = 0;
41
+
38
         /// <summary>
42
         /// <summary>
39
         /// 文件类型
43
         /// 文件类型
40
         /// </summary>
44
         /// </summary>
41
         private string Suffix = string.Empty;
45
         private string Suffix = string.Empty;
46
+
42
         /// <summary>
47
         /// <summary>
43
         /// 唯一编号
48
         /// 唯一编号
44
         /// </summary>
49
         /// </summary>
45
         private string Guid = string.Empty;
50
         private string Guid = string.Empty;
51
+
46
         //定义事件
52
         //定义事件
47
         public event ChangeTextHandlers ChangeTextEvents;
53
         public event ChangeTextHandlers ChangeTextEvents;
54
+
48
         /// <summary>
55
         /// <summary>
49
         /// 当前视频的下标
56
         /// 当前视频的下标
50
         /// </summary>
57
         /// </summary>
51
         private int i = 0;
58
         private int i = 0;
59
+
52
         private System.Timers.Timer times;
60
         private System.Timers.Timer times;
61
+
53
         public UploadWindow()
62
         public UploadWindow()
54
         {
63
         {
55
             InitializeComponent();
64
             InitializeComponent();
56
-
57
         }
65
         }
66
+
58
         /// <summary>
67
         /// <summary>
59
         /// 初始化
68
         /// 初始化
60
         /// </summary>
69
         /// </summary>
68
             tip_outer.Visibility = Visibility.Collapsed;
77
             tip_outer.Visibility = Visibility.Collapsed;
69
             Tsubjectbook();
78
             Tsubjectbook();
70
         }
79
         }
80
+
71
         /// <summary>
81
         /// <summary>
72
         /// 教材接口调用
82
         /// 教材接口调用
73
         /// </summary>
83
         /// </summary>
74
-        /// <returns></returns>
84
+        /// <returns>
85
+        /// </returns>
75
         private void Tsubjectbook()
86
         private void Tsubjectbook()
76
         {
87
         {
77
-            int code = @interface.TsubjectbookList();
88
+            int code = xhapi.TsubjectbookList();
78
             if (code == 0)
89
             if (code == 0)
79
             {
90
             {
80
                 for (int i = 0; i < APP.TsubjectbookList.Count; i++)
91
                 for (int i = 0; i < APP.TsubjectbookList.Count; i++)
95
                 MessageWindow.Show(APP.ServerMsg);
106
                 MessageWindow.Show(APP.ServerMsg);
96
             }
107
             }
97
         }
108
         }
109
+
98
         /// <summary>
110
         /// <summary>
99
         /// 章节接口调用
111
         /// 章节接口调用
100
         /// </summary>
112
         /// </summary>
105
             {
117
             {
106
                 selectIndex = 0;
118
                 selectIndex = 0;
107
             }
119
             }
108
-            int code = @interface.DirectorList(APP.TsubjectbookList[selectIndex].Lsbid, 4, APP.UserInfo.Userid);
120
+            int code = xhapi.DirectorList(APP.TsubjectbookList[selectIndex].Lsbid, 4, APP.UserInfo.Userid);
109
             if (code == 0)
121
             if (code == 0)
110
             {
122
             {
111
                 pageData.zhangjieList.Clear();
123
                 pageData.zhangjieList.Clear();
133
                 MessageWindow.Show(APP.ServerMsg);
145
                 MessageWindow.Show(APP.ServerMsg);
134
             }
146
             }
135
         }
147
         }
148
+
136
         /// <summary>
149
         /// <summary>
137
         /// 子章节递归
150
         /// 子章节递归
138
         /// </summary>
151
         /// </summary>
139
-        /// <param name="directorList"></param>
152
+        /// <param name="directorList">
153
+        /// </param>
140
         private void addChild(Model_DirectorList directorList)
154
         private void addChild(Model_DirectorList directorList)
141
         {
155
         {
142
             if (directorList.children != null && directorList.children.Count > 0)
156
             if (directorList.children != null && directorList.children.Count > 0)
156
                 }
170
                 }
157
             }
171
             }
158
         }
172
         }
173
+
159
         /// <summary>
174
         /// <summary>
160
         /// 章节是否加空格符
175
         /// 章节是否加空格符
161
         /// </summary>
176
         /// </summary>
162
-        /// <param name="num"></param>
163
-        /// <returns></returns>
177
+        /// <param name="num">
178
+        /// </param>
179
+        /// <returns>
180
+        /// </returns>
164
         private string getSpace(int num)
181
         private string getSpace(int num)
165
         {
182
         {
166
             string str = "";
183
             string str = "";
170
             }
187
             }
171
             return str;
188
             return str;
172
         }
189
         }
190
+
173
         private void Window_Loaded(object sender, RoutedEventArgs e)
191
         private void Window_Loaded(object sender, RoutedEventArgs e)
174
         {
192
         {
175
-
176
         }
193
         }
177
 
194
 
178
         private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
195
         private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
179
         {
196
         {
180
-
181
         }
197
         }
198
+
182
         /// <summary>
199
         /// <summary>
183
         /// 教材下拉框改变事件
200
         /// 教材下拉框改变事件
184
         /// </summary>
201
         /// </summary>
185
-        /// <param name="sender"></param>
186
-        /// <param name="e"></param>
202
+        /// <param name="sender">
203
+        /// </param>
204
+        /// <param name="e">
205
+        /// </param>
187
         private void toolbar_list_SelectionChanged(object sender, SelectionChangedEventArgs e)
206
         private void toolbar_list_SelectionChanged(object sender, SelectionChangedEventArgs e)
188
         {
207
         {
189
             Director();
208
             Director();
194
             APP.IsUpLoad = false;
213
             APP.IsUpLoad = false;
195
             Hide();
214
             Hide();
196
         }
215
         }
216
+
197
         /// <summary>
217
         /// <summary>
198
         /// 上传到个人空间
218
         /// 上传到个人空间
199
         /// </summary>
219
         /// </summary>
200
-        /// <param name="sender"></param>
201
-        /// <param name="e"></param>
220
+        /// <param name="sender">
221
+        /// </param>
222
+        /// <param name="e">
223
+        /// </param>
202
         private void BtnStart_Click(object sender, RoutedEventArgs e)
224
         private void BtnStart_Click(object sender, RoutedEventArgs e)
203
         {
225
         {
204
             if (string.IsNullOrWhiteSpace(book_list.Text))
226
             if (string.IsNullOrWhiteSpace(book_list.Text))
229
             times.Elapsed += Times_ElapsedClick;
251
             times.Elapsed += Times_ElapsedClick;
230
             times.Start();
252
             times.Start();
231
         }
253
         }
254
+
232
         private void StartUpload()
255
         private void StartUpload()
233
         {
256
         {
234
             try
257
             try
236
                 DAL_Upload dAL_Upload = new DAL_Upload();
259
                 DAL_Upload dAL_Upload = new DAL_Upload();
237
                 if (dAL_Upload.UploadVideoTwo(Guid, out string ErrMessage))
260
                 if (dAL_Upload.UploadVideoTwo(Guid, out string ErrMessage))
238
                 {
261
                 {
239
-
240
-
241
                     //        converted: 0
262
                     //        converted: 0
242
                     //createid: 80
263
                     //createid: 80
243
                     //directorid: 1009
264
                     //directorid: 1009
296
 
317
 
297
                     model_ResourceAdd.suffix = Suffix;
318
                     model_ResourceAdd.suffix = Suffix;
298
                     //model_ResourceAdd.uid = 0;//zxy
319
                     //model_ResourceAdd.uid = 0;//zxy
299
-                    int code = @interface.ResourceAdd(model_ResourceAdd);
320
+                    int code = xhapi.ResourceAdd(model_ResourceAdd);
300
                     if (code == 0)
321
                     if (code == 0)
301
                     {
322
                     {
302
                         Dispatcher.Invoke(() =>
323
                         Dispatcher.Invoke(() =>
318
                                 }
339
                                 }
319
                             }
340
                             }
320
 
341
 
321
-
322
                             btnStart.IsEnabled = true;
342
                             btnStart.IsEnabled = true;
323
                             book_list.IsEnabled = true;
343
                             book_list.IsEnabled = true;
324
                             cmbTeachingMaterial.IsEnabled = true;
344
                             cmbTeachingMaterial.IsEnabled = true;
376
         }
396
         }
377
 
397
 
378
         private int num = 0;
398
         private int num = 0;
399
+
379
         /// <summary>
400
         /// <summary>
380
         /// 计时器
401
         /// 计时器
381
         /// </summary>
402
         /// </summary>
382
-        /// <param name="sender"></param>
383
-        /// <param name="e"></param>
403
+        /// <param name="sender">
404
+        /// </param>
405
+        /// <param name="e">
406
+        /// </param>
384
         private void Times_ElapsedClick(object sender, System.Timers.ElapsedEventArgs e)
407
         private void Times_ElapsedClick(object sender, System.Timers.ElapsedEventArgs e)
385
         {
408
         {
386
             Dispatcher.Invoke(() =>
409
             Dispatcher.Invoke(() =>
399
             });
422
             });
400
         }
423
         }
401
     }
424
     }
425
+
402
     public class LoginPageData : NotifyModel
426
     public class LoginPageData : NotifyModel
403
     {
427
     {
404
         public ObservableCollection<ComboBoxBean> bookList { get; set; }
428
         public ObservableCollection<ComboBoxBean> bookList { get; set; }
411
             zhangjieList = new ObservableCollection<ComboBoxBean>();
435
             zhangjieList = new ObservableCollection<ComboBoxBean>();
412
         }
436
         }
413
     }
437
     }
414
-}
438
+}

+ 345
- 203
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs
File diff suppressed because it is too large
View File


+ 1
- 1
XHWK.WKTool/XHWK.WKTool.csproj View File

241
       <DependentUpon>CountdownWindow.xaml</DependentUpon>
241
       <DependentUpon>CountdownWindow.xaml</DependentUpon>
242
     </Compile>
242
     </Compile>
243
     <Compile Include="DAL\DAL_Upload.cs" />
243
     <Compile Include="DAL\DAL_Upload.cs" />
244
-    <Compile Include="DAL\Interface.cs" />
244
+    <Compile Include="DAL\XHApi.cs" />
245
     <Compile Include="DAL\ResultVo.cs" />
245
     <Compile Include="DAL\ResultVo.cs" />
246
     <Compile Include="DeviceWindow.xaml.cs">
246
     <Compile Include="DeviceWindow.xaml.cs">
247
       <DependentUpon>DeviceWindow.xaml</DependentUpon>
247
       <DependentUpon>DeviceWindow.xaml</DependentUpon>

+ 1
- 0
XHWK.WKTool/system/LogHelper.cs View File

22
             if (loginfo.IsInfoEnabled)
22
             if (loginfo.IsInfoEnabled)
23
             {
23
             {
24
                 loginfo.Info(info);
24
                 loginfo.Info(info);
25
+                Console.WriteLine(info);
25
             }
26
             }
26
         }
27
         }
27
 
28
 

Loading…
Cancel
Save