Exemple #1
0
        public string GetRegRelationShip(string callType, string xmlMessage)
        {
            string result = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                            "<" + callType + ">" +
                            "<Result>False</Result>" +
                            "<Description></Description></" + callType + ">";
            string logID = Guid.NewGuid().ToString();

            try
            {
                FileLogger.WriteLog(logID + "|Start:" + xmlMessage, 1, "", callType);

                if (Helper.CheckAuthCode("GetRegistrationData", xmlMessage))
                {
                    RegApplication regApp = new RegApplication();
                    result = regApp.GetRegRelationShip(xmlMessage);
                }
            }
            catch (Exception err)
            {
                result = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                         "<" + callType + ">" +
                         "<Result>False</Result>" +
                         "<Description>" + err.Message + "</Description></" + callType + ">";
            }
            FileLogger.WriteLog(logID + "|End:" + result, 1, "", callType);
            return(result);
        }
Exemple #2
0
        public string GetRegAuthData(string callType, string xmlMessage)
        {
            string result = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                            "<" + callType + ">" +
                            "<Result>False</Result>" +
                            "<Description></Description></" + callType + ">";
            string logID = Guid.NewGuid().ToString();

            try
            {
                FileLogger.WriteLog(logID + "|Start:" + xmlMessage, 1, "", callType);

                if (Helper.CheckAuthCode("GetRegistrationData", xmlMessage))
                {
                    XmlDocument doc = new XmlDocument();
                    doc.LoadXml(xmlMessage);
                    XmlNode pNode = doc.SelectSingleNode("GetRegistrationData");
                    XmlNode cNode = doc.CreateElement("Cols");
                    cNode.InnerText = "FID|FHospitalID|FProvinceID|FCityID|FCountryID|FHospitalName|FProvinceName|FCityName|FCountryName";
                    pNode.AppendChild(cNode);

                    RegApplication regApp = new RegApplication();
                    result = regApp.GetDetail(doc.OuterXml);
                }
            }
            catch (Exception err)
            {
                result = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                         "<" + callType + ">" +
                         "<Result>False</Result>" +
                         "<Description>" + err.Message + "</Description></" + callType + ">";
            }
            FileLogger.WriteLog(logID + "|End:" + result, 1, "", callType);
            return(result);
        }
Exemple #3
0
        private void button5_Click(object sender, EventArgs e)
        {
            //FileHelper.UploadImage(base64String, "", "cui.jpg", "1001", "wwwww1111");

            XmlDocument doc       = new XmlDocument();
            string      xmlString = "<UploadRegImage>" +
                                    "<AuthCode>1d340262-52e0-413f-b0e7-fc6efadc2ee5</AuthCode>" +
                                    "<Base64String></Base64String>" +
                                    "<FileName>cui.jpg</FileName>" +
                                    "<PageID>MKT001</PageID>" +
                                    "<OwnerID>082d3899-e880-4784-a09b-97ad407e08b5</OwnerID>" +
                                    "<FileNum>1|1</FileNum>" +
                                    "</UploadRegImage>";

            doc.LoadXml(xmlString);

            string path = @"D:\cui.jpg";         //本地路径

            byte[] bytes = GetBytesByPath(path); //获取文件byte[]

            string base64String = Convert.ToBase64String(bytes);

            doc.SelectSingleNode("UploadRegImage/Base64String").InnerText = base64String;

            xmlString = doc.InnerXml;
            RegApplication reg = new RegApplication();
            //doc.Save(@"D:\Work\yaodaibao\Release\uploadfile.xml");
            //reg.UploadFile(xmlString);
            //doc.LoadXml(xmlString);
            //string pstring = "UploadRegImage" + ";" + xmlString;
            WebInvoke invoke = new WebInvoke();
            //object[] p = pstring.Split(';');
            string result = reg.UploadImage(xmlString);


            //FileLogger.WriteLog("test", 1);
            //string path = @"D:\发票2.jpg";//本地路径
            //byte[] bytes = GetBytesByPath(path);//获取文件byte[]

            //string base64String = Convert.ToBase64String(bytes);

            //object[] parm = new object[] { "2", base64String };
            ////object result = invoke.Invoke("http://oa.tenrypharm.com:8888/seeyon/services/authorityService?wsdl", "authorityService", "authenticate", parm, null, 60);

            ////string url = @"http://duzy.top:8080/microService/api/invoice/check";
            ////object result =  Post(url, parm, 15);
            ////object[] parm = new object[] { "service-admin", "123456" };
            ////object result = invoke.Invoke("http://oa.tenrypharm.com:8888/seeyon/services/authorityService?wsdl", "authorityService", "authenticate", parm, null, 60);


            ////xmlString = invoke.Invoke(@"http://ydb.tenrypharm.com:6060/RegistrationInvoke.asmx", "RegistrationInvoke", "UploadRegImage", p).ToString();
            ////doc.LoadXml(result);
            ////doc.Save(@"D:\Work\yaodaibao\Release\result.xml");
        }
Exemple #4
0
        public string SaveRegPerformance(string callType, string xmlMessage)
        {
            string result = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                            "<" + callType + ">" +
                            "<Result>False</Result>" +
                            "<Description></Description></" + callType + ">";

            string logID = Guid.NewGuid().ToString();

            try
            {
                FileLogger.WriteLog(logID + "|Start:" + xmlMessage, 1, "", callType);

                if (Helper.CheckAuthCode("UpdateRegistration", xmlMessage))
                {
                    //RegApplication regApp = new RegApplication();
                    //result = regApp.Update(xmlMessage);

                    RegApplication regApp = new RegApplication();

                    string id = regApp.Update(xmlMessage);

                    if (id.Trim().Length == 36)
                    {
                        result = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                                 "<" + callType + ">" +
                                 "<Result>True</Result>" +
                                 "<ID>" + id + "</ID>" +
                                 "<Description>操作成功</Description></" + callType + ">";
                    }
                }
            }
            catch (Exception err)
            {
                result = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                         "<" + callType + ">" +
                         "<Result>False</Result>" +
                         "<Description>" + err.Message + "</Description></" + callType + ">";
            }
            FileLogger.WriteLog(logID + "|End:" + result, 1, "", callType);
            return(result);
        }