Ejemplo n.º 1
0
        public static DataTable SPP_list_owner(string usb_key)
        {
            string        corp_id = "<?xml version=\"1.0\"?><QueryOwnerCorpListRequest xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><entSeqNo>320000000000141855</entSeqNo></QueryOwnerCorpListRequest>";
            StringBuilder xml_key = new StringBuilder();

            xml_key.Append("<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?><RequestContext><Group name=\"SystemInfo\"><Key name=\"SessionId\">");
            //xml_key.Append(richTextBox1.Text.Substring(3,32));
            xml_key.Append(usb_key);
            xml_key.Append("</Key></Group><Group name=\"DataPresentation\"><Key name=\"SignatureAlgorithm\" /><Key name=\"EncryptAlgorithm\" /><Key name=\"CompressAlgorithm\" /></Group></RequestContext>");
            //base64 encode
            byte[] key_bytes  = Encoding.Default.GetBytes(xml_key.ToString());
            byte[] corp_bytes = Encoding.Default.GetBytes(corp_id);
            byte[] result     = new byte[1000];
            //string key_str_base64 = Convert.ToBase64String(key_bytes);
            //post to webservice
            com.drugadmin.sp.SuperPass ws = new gsp_nbr_verify.com.drugadmin.sp.SuperPass();
            ws.service("piats.superpass.tpl.QueryOwnerCorpListService", key_bytes, corp_bytes, out result);
            //DataSet ds=GetDataSetByXml(Encoding.GetEncoding("UTF-8").GetString(result));
            DataSet ds = XmlDatasetConvert.ConvertXMLToDataSet(Encoding.GetEncoding("UTF-8").GetString(result));

            return(ds.Tables[0]);
        }
Ejemplo n.º 2
0
        public static DataTable SPP_list_order(string usb_key, string asn_nbr, string owner_nbr)
        {
            StringBuilder order_id = new StringBuilder();

            order_id.Append("<?xml version=\"1.0\"?><QueryChkInOutListsRequest xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><chkInOutRequest><dataType>A</dataType><entStoreInoutId>");
            order_id.Append(asn_nbr);
            order_id.Append("</entStoreInoutId><entSeqNo>");
            order_id.Append(owner_nbr);
            order_id.Append("</entSeqNo><corpSeqNo>320000000000141855</corpSeqNo><corpName>国药集团医药物流有限公司</corpName></chkInOutRequest><PageResquest><curPage>1</curPage><pageSize>10</pageSize></PageResquest></QueryChkInOutListsRequest>");
            StringBuilder xml_key = new StringBuilder();

            xml_key.Append("<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?><RequestContext><Group name=\"SystemInfo\"><Key name=\"SessionId\">");
            //xml_key.Append(richTextBox1.Text.Substring(3,32));
            xml_key.Append(usb_key);

            xml_key.Append("</Key></Group><Group name=\"DataPresentation\"><Key name=\"SignatureAlgorithm\" /><Key name=\"EncryptAlgorithm\" /><Key name=\"CompressAlgorithm\" /></Group></RequestContext>");
            //base64 encode
            byte[] key_bytes   = Encoding.Default.GetBytes(xml_key.ToString());
            byte[] order_bytes = Encoding.GetEncoding("UTF-8").GetBytes(order_id.ToString());
            byte[] result      = new byte[1000];
            //string key_str_base64 = Convert.ToBase64String(key_bytes);
            //post to webservice
            com.drugadmin.sp.SuperPass ws = new gsp_nbr_verify.com.drugadmin.sp.SuperPass();
            ws.service("piats.superpass.bill.QueryChkInOutListsService", key_bytes, order_bytes, out result);
            //DataSet ds=GetDataSetByXml(Encoding.GetEncoding("UTF-8").GetString(result));
            DataSet ds = XmlDatasetConvert.ConvertXMLToDataSet(Encoding.GetEncoding("UTF-8").GetString(result));

            if (ds.Tables.Count != 0)
            {
                return(ds.Tables[1]);
            }
            else
            {
                return(null);
            }
        }