Selaa lähdekoodia

移除AutoGetKey和AutoGetKeyStatus接口,同时删除没有再使用的接口GetFireTvDsn

Jeff 3 vuotta sitten
vanhempi
commit
2a9a298418

+ 0 - 113
FactoryTool_CShare/Business/CommonMethod.cs

@@ -1649,119 +1649,6 @@ namespace MOKA_Factory_Tools
             return true;
         }
 
-        public static bool AutoGetKey(string url, string order, string key, string keytype, SQLiteConnection errorDBNow)
-        {
-            string code;
-            string desc;
-            HttpHelper http = new HttpHelper();
-            HttpItem item = new HttpItem()
-            {
-                Encoding = Encoding.Default,
-                Method = "post",
-                ContentType = "application/x-www-form-urlencoded",
-                KeepAlive = false
-            };
-            url += "/autogetkey.do?";
-            item.URL = url;
-            item.Postdata = string.Format("order={0}&key={1}&keytype={2}&mac={3}", order, key, keytype, HttpUtility.UrlEncode(TestMode.MAC));
-            HttpResult result = http.GetHtml(item);
-            if (result.StatusCode == System.Net.HttpStatusCode.OK)
-            {
-                Log.WriteGetKeyLog("\r\nAutoquestKey :\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html);
-                if (Xmlconfig.AutoKeyStatusXml(result.Html, "response", out code, out desc))
-                {
-                    return true;
-                }
-                else
-                {
-                    CommonMethod.ReportErrormsg("Auto get key error", desc + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow);
-                    return false;
-                }
-            }
-            else
-            {
-                CommonMethod.ReportErrormsg("Auto get key error", result.StatusDescription + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow);
-                return false;
-            }
-        }
-
-        public static bool AutoGetKeyStatus(string url, string key, string keytype, SQLiteConnection errorDBNow)
-        {
-            string code;
-            string desc;
-            HttpHelper http = new HttpHelper();
-            HttpItem item = new HttpItem()
-            {
-                Encoding = Encoding.Default,
-                Method = "post",
-                ContentType = "application/x-www-form-urlencoded",
-                KeepAlive = false
-            };
-            url += "/autogetkeystatus.do?";
-            item.URL = url;
-            item.Postdata = string.Format("key={0}&keytype={1}", key, keytype);
-            HttpResult result = http.GetHtml(item);
-            if (result.StatusCode == System.Net.HttpStatusCode.OK)
-            {
-                Log.WriteGetKeyLog("\r\nAutoGetKeyStatus :\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html);
-                if (Xmlconfig.AutoKeyStatusXml(result.Html, "response", out code, out desc))
-                {
-                    return true;
-                }
-                else
-                {
-                    return false;
-                }
-            }
-            else
-            {
-                CommonMethod.ReportErrormsg("Auto get key status error", result.StatusDescription + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow);
-                return false;
-            }
-        }
-
-        public static bool GetFireTVDsn(string url, string ordernum, string deviceCode, string FSN, string PSN, out string dsn, out string error, SQLiteConnection errorDBNow)
-        {
-            // 计算函数耗时;
-            Stopwatch watch = new Stopwatch();
-            watch.Start();
-            dsn = "";
-            error = "";
-            HttpHelper http = new HttpHelper();
-            HttpItem item = new HttpItem()
-            {
-                Encoding = null,        // 编码格式(utf-8,gb2312,gbk)可选项 默认类会自动识别Encoding = Encoding.Default,
-                Method = "GET",         // URL 可选项 默认为Get
-                KeepAlive = false
-            };
-
-            item.URL = string.Format("{0}/getFiretvDsn.do?ordernum={1}&fsn={2}&psn={3}&deviceCode={4}&mac={5}", url, ordernum, FSN, PSN, deviceCode, HttpUtility.UrlEncode(TestMode.MAC));
-            HttpResult result = http.GetHtml(item);
-            if (result.StatusCode == System.Net.HttpStatusCode.OK)
-            {
-                string code;
-                string desc;
-                Log.WriteGetKeyLog("\r\nGetFireTVDsn :\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html);
-                if (Xmlconfig.GetDSNXml(result.Html, "response", out code, out desc, out dsn))
-                {
-                    Log.WriteGetKeyLog(string.Format("\r\nDSN= {0}\r\nHttp Get Dsn Elapsed = {1}", dsn, watch.Elapsed.TotalMilliseconds));
-                    return true;
-                }
-                else
-                {
-                    error = desc;
-                    CommonMethod.ReportErrormsg("GetFireTVDsn error", result.StatusDescription + "\r\n" + result.Html + "\r\nAddress: " + item.URL, errorDBNow);
-                    return false;
-                }
-            }
-            else
-            {
-                error = "Communication with server failed";
-                CommonMethod.ReportErrormsg("GetFireTVDsn error", result.StatusDescription + "\r\n" + result.Html + "\r\nAddress: " + item.URL, errorDBNow);
-                return false;
-            }
-        }
-
         /// <summary>
         /// 导出日本的SN与ACASID到文本中;
         /// </summary>

+ 0 - 20
FactoryTool_CShare/Views/Main.cs

@@ -230,7 +230,6 @@ namespace MOKA_Factory_Tools
                                     }
                                     operationPanel1.DeleteIntptr += new OperationPanel.DisplayUpdateDelegate(DeleteIntptr);
                                     operationPanel1.SNKeyDownEven += new OperationPanel.SNKeyDown(SNKeyDownEven);
-                                    operationPanel1.AutoKeyRequire += new OperationPanel.AutoKeyRequireDelegate(AutoKeyRequire);
                                     IntPtr intPtr = operationPanel1.Handle;
                                     Dictionary<IntPtr, Point> part1 = new Dictionary<IntPtr, Point>();
                                     part1.Add(intPtr, (Point)new Size(operationPanel1.Right, operationPanel1.Top));
@@ -365,7 +364,6 @@ namespace MOKA_Factory_Tools
                                                 }
                                                 operationPanel1.DeleteIntptr += new OperationPanel.DisplayUpdateDelegate(DeleteIntptr);
                                                 operationPanel1.SNKeyDownEven += new OperationPanel.SNKeyDown(SNKeyDownEven);
-                                                operationPanel1.AutoKeyRequire += new OperationPanel.AutoKeyRequireDelegate(AutoKeyRequire);
                                                 IntPtr intPtr = operationPanel1.Handle;
                                                 Dictionary<IntPtr, Point> part1 = new Dictionary<IntPtr, Point>();
                                                 part1.Add(intPtr, (Point)new Size(operationPanel1.Right, operationPanel1.Top));
@@ -466,7 +464,6 @@ namespace MOKA_Factory_Tools
                             }
                             operationPanel1.DeleteIntptr += new OperationPanel.DisplayUpdateDelegate(DeleteIntptr);
                             operationPanel1.SNKeyDownEven += new OperationPanel.SNKeyDown(SNKeyDownEven);
-                            operationPanel1.AutoKeyRequire += new OperationPanel.AutoKeyRequireDelegate(AutoKeyRequire);
                             IntPtr intPtr = operationPanel1.Handle;
                             Dictionary<IntPtr, Point> part1 = new Dictionary<IntPtr, Point>();
                             part1.Add(intPtr, (Point)new Size(operationPanel1.Right, operationPanel1.Top));
@@ -606,7 +603,6 @@ namespace MOKA_Factory_Tools
                     }
                     operationPanel1.DeleteIntptr += new OperationPanel.DisplayUpdateDelegate(DeleteIntptr);
                     operationPanel1.SNKeyDownEven += new OperationPanel.SNKeyDown(SNKeyDownEven);
-                    operationPanel1.AutoKeyRequire += new OperationPanel.AutoKeyRequireDelegate(AutoKeyRequire);
                     IntPtr intPtr = operationPanel1.Handle;
                     Dictionary<IntPtr, Point> part1 = new Dictionary<IntPtr, Point>();
                     part1.Add(intPtr, (Point)new Size(operationPanel1.Right, operationPanel1.Top));
@@ -1209,22 +1205,6 @@ namespace MOKA_Factory_Tools
             }
         }
 
-        private void AutoKeyRequire(IntPtr intPtr, string key, string keytype)
-        {
-            Task.Run(() =>
-            {
-                var a = ((Dictionary<IntPtr, Point>)formlocationmsg[0]).First();
-                if (a.Key == intPtr)
-                {
-                    ;//start autokey require
-                    if (CommonMethod.AutoGetKeyStatus(midList1.host, key, keytype, ErrorDB))
-                    {
-                        CommonMethod.AutoGetKey(midList1.host, OrderText.Text.Trim(), key, keytype, ErrorDB);
-                    }
-                }
-            });
-        }
-
         private void SNKeyDownEven(IntPtr intPtr)
         {
             this.KeyDownEvent(formlocationmsg, intPtr);

+ 0 - 5
FactoryTool_CShare/Views/OperationPanel.cs

@@ -61,11 +61,6 @@ namespace MOKA_Factory_Tools
         //扫描回车触发事件
         public event SNKeyDown SNKeyDownEven;
 
-        //自动key提取委托
-        public delegate void AutoKeyRequireDelegate(IntPtr intPtr, string key, string keytype);
-        //自动key提取事件
-        public event AutoKeyRequireDelegate AutoKeyRequire;
-
         //定义一个委托  调用Verify窗口;
         delegate void ShowVerifyCallback(string strMsg);