Selaa lähdekoodia

访问ERP接口生成下载链接

callm 5 vuotta sitten
vanhempi
commit
72789dbb45
1 muutettua tiedostoa jossa 12 lisäystä ja 5 poistoa
  1. 12 5
      UAS-出货标签管理(贸易版)/PublicMethod/HttpHandler.cs

+ 12 - 5
UAS-出货标签管理(贸易版)/PublicMethod/HttpHandler.cs

@@ -88,14 +88,21 @@ namespace UAS_LabelMachine.PublicMethod
         {
             SystemInf.dh.ExecuteSql("delete from ProdDownLink where pl_inoutno='" + Inoutno + "'", "delete");
             SystemInf.dh.ExecuteSql("insert into ProdDownLink(pl_inoutno,pl_outboxcode) select distinct '" + Inoutno + "',pib_outboxcode1 from prodiobarcode where pib_inoutno='" + Inoutno + "'", "insert");
-            //string url = "http://localhost:8080/uas_war_exploded/common/form/reqDemo.action?Pi_inoutno=" + Inoutno;//html调用的地址              
-            string url = DataHelper.ERPAddesss + "common/form/reqDemo.action?Pi_inoutno=" + Inoutno;//html调用的地址              
+            SystemInf.dh.GetConfig("DownLoadLink", "Prodinout!Down");
+            string url = SystemInf.dh.GetConfig("DownLoadLink", "Prodinout!Down") + "/common/form/reqDemo.action?Pi_inoutno=" + Inoutno;//html调用的地址              
             HttpWebRequest webrequest = (HttpWebRequest)WebRequest.Create(url);
-            if (webrequest == null)
+            try
+            {
+                if (webrequest == null)
+                {
+                    return false;
+                }
+                WebResponse myResponse = webrequest.GetResponse();
+            }
+            catch (Exception e)
             {
-                return false;
+                LogManager.DoLog(e.Message + e.StackTrace);
             }
-            WebResponse myResponse = webrequest.GetResponse();
             return true;
         }
     }