Exemplo n.º 1
0
        /// <summary>
        /// 同步检测单位信息
        /// </summary>
        /// <returns></returns>
        public static bool UpUnit(string unitinfo)
        {
            bool rtnu = false;

            object[] argsu = new object[1];
            argsu.SetValue(unitinfo, 0);
            object ob = DynamicWeb.InvokeWebService(Global.ServerAdd, "SyncFarmsInfoList2005", argsu);
            string rt = ob.ToString();

            if (rt == "success")
            {
                rtnu = true;
            }
            return(rtnu);
        }
Exemplo n.º 2
0
        public static bool InvokeAndCallWebService(SDUpdata sdd)
        {
            bool sendre = false;

            Global.ReturnMessage = "";
            int numunitcode = GetChkUnitCode(sdd.numunit == "" ? "3" : sdd.numunit);

            code = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(DateTime.Now.ToString("yyyyMMdd"), "MD5").ToLower();

            //测试

            string xmldata = "<NewDataSet> " +
                             "<Table>" +
                             "<VResultCollectID>" + sdd.CheckNumber + "</VResultCollectID>"
                             + "<FarmID>" + Global.ServerName + "</FarmID>"
                             + " <SPECIALSName>" + sdd.SampleName + "</SPECIALSName>"
                             + "<USERS>" + sdd.Operator + "</USERS> "
                             + "<RATE >" + sdd.InhibitionRatio + "</RATE >"
                             + "<TIMEDO >" + sdd.Chktime.ToString("yyyy-MM-dd HH:mm:ss") + "</TIMEDO >"
                             + "<UpLoadDate >" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "</UpLoadDate >"
                             + "<Producer>" + sdd.GoodsUnit + "</Producer>"
                             + "<ProduceAddress>" + sdd.ProductAddr + "</ProduceAddress>"
                             + "<ProduceDate>" + sdd.ProductionDate.ToString("yyyy-MM-dd HH:mm:ss") + " </ProduceDate>"
                             + "<BarCode>" + sdd.barcode + "</BarCode>"
                             + "<Company >" + sdd.ProductionUnit + "</Company > "
                             + "<VRESULTID >" + (sdd.Conclusion == "合格" ? 1 : 2) + "</VRESULTID >"
                             + "<VegetableTypeName>" + sdd.SampleType + "</VegetableTypeName>"
                             + "<HabitatName>" + sdd.ProductPlace + "</HabitatName>"
                             + "<SONGJIANDATE>" + sdd.SendTime.ToString("yyyy-MM-dd HH:mm:ss") + "</SONGJIANDATE>"
                             + "<SONGJIANBASENUM>" + sdd.samplenum + "</SONGJIANBASENUM>"
                             + "<UseUnitID>" + numunitcode + "</UseUnitID>"
                             + "<SampleNo>" + sdd.SampleCode + "</SampleNo>"
                             + "<DealWithResult>" + "已处理" + "</DealWithResult>"
                             + "</Table>"
                             + "</NewDataSet>";

            data = xmldata;

            XmlDocument doc = new XmlDocument();

            doc.LoadXml(data);
            XmlNode newNode = doc.DocumentElement;

            object[] args = new object[4];

            args.SetValue(Global.ServerName, 0);     //用户名
            args.SetValue(Global.ServerPassword, 1); //密码
            args.SetValue(code, 2);
            args.SetValue(newNode, 3);
            //args.SetValue("", 4);
            //完全动态调用
            object ob = DynamicWeb.InvokeWebService(Global.ServerAdd, "SyncMyzlCheckFoodData2005", args);
            string rt = ob.ToString();

            if (rt == "4")
            {
                sendre = true;
            }
            else
            {
                Global.ReturnMessage = rt;
            }
            //InvokeWebService(url, null, methodname, args);
            return(sendre);
        }