Beispiel #1
0
        public static string updateM(string phone)
        {
            string VipCardNo = "";

            PosExistMemberInfo posExi   = new PosExistMemberInfo();
            MemberVO           memberVO = new MemberVO();

            memberVO.phone = phone;
            string mebxml = posExi.getPosExistMemberInfo(memberVO);

            if (!string.IsNullOrEmpty(mebxml))
            {
                XmlDocument xmldocx = new XmlDocument();

                xmldocx.LoadXml(mebxml);
                VipCardNo = xmldocx.SelectSingleNode("//VipCardNo[last()]").InnerText.ToString();
            }


            //  VipCardNo = "1825822403504";
            Random ran     = new Random();
            int    RandKey = ran.Next(1, 35);
            //  System.Guid guid = new Guid();
            string guid = Guid.NewGuid().ToString().Remove(20);

            XmlDocument xmldoc = new XmlDocument();

            xmldoc.Load(GetPublicKey.GetSysPath("XMLFile8.xml"));
            string ClientCode = xmldoc.SelectSingleNode("//ClientCode[last()]").InnerText.ToString();

            XmlDocument xmldoc2 = new XmlDocument();

            xmldoc2.Load(GetPublicKey.GetSysPath("XMLFile12_Request.xml"));
            string UserCode   = xmldoc2.SelectSingleNode("//UserCode[last()]").InnerText.ToString();
            string workKey    = xmldoc2.SelectSingleNode("//WorkKey[last()]").InnerText.ToString();
            string VerifyInfo = xmldoc2.SelectSingleNode("//VerifyInfo[last()]").InnerText.ToString();


            XmlDocument xmldoc1 = new XmlDocument();

            xmldoc1.Load(GetPublicKey.GetSysPathRespose("XMLFile12_Response.xml"));
            string workGuid = xmldoc1.SelectSingleNode("//WorkGuid[last()]").InnerText.ToString();



//            <InputParameter>
//<RandomNo>随机数</RandomNo>
//<ClientCode>交易客户端编码</ClientCode>
//<UserCode>CRM系统用户编码</UserCode>
//<WorkGuid>工作Guid</WorkGuid>
//<VipCardNo>会员卡号</ VipCardNo>
//<UDP1>店铺类型标识</UDP1>
//<UDP2>秘镜思语门店名称</UDP2>
//<UDP3>秘镜思语注册时间</UDP3>
//</InputParameter>


            String body = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><InputParameter><RandomNo>" + RandKey + "</RandomNo><ClientCode>" + ClientCode + "</ClientCode><UserCode>" + UserCode + "</UserCode><WorkGuid>" + workGuid + "</WorkGuid><OrgCode>86</OrgCode><VipCardNo>" + VipCardNo + "</VipCardNo><UDP1>店铺类型标识</UDP1><UDP2>店铺门店</UDP2><UDP3>" + DateTime.Now.ToShortTimeString() + "</UDP3></InputParameter>";



            String enBody = RSA_3DES.EncryStr3DES(workKey, body);

            String tag = enBody + VerifyInfo;

            tag = encryptMD5(tag).ToUpper();

            string psInputPara = "";

            psInputPara = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
                          + "<InputParameter>"
                          + "<Head>"
                          + "<ClientCode>" + ClientCode + "</ClientCode>"
                          + "<Tag>" + tag + "</Tag>"
                          + "</Head>"
                          + "<Body>"
                          + enBody
                          + "</Body>"
                          + "</InputParameter>";



            WebReferenceCC.TReturnInfo TReturnInfo = GetPublicKey.WebService(243, psInputPara);

            return(TReturnInfo.ReturnCode.ToString());
        }
Beispiel #2
0
        public static int GetRegister(MemberVO memberVO)
        {
            Random ran     = new Random();
            int    RandKey = ran.Next(1000, 9999);

            XmlDocument xmldoc = new XmlDocument();

            xmldoc.Load(GetPublicKey.GetSysPath("XMLFile8.xml"));
            string ClientCode = xmldoc.SelectSingleNode("//ClientCode[last()]").InnerText.ToString();

            XmlDocument xmldoc2 = new XmlDocument();

            xmldoc2.Load(GetPublicKey.GetSysPath("XMLFile12_Request.xml"));
            string UserCode   = xmldoc2.SelectSingleNode("//UserCode[last()]").InnerText.ToString();
            string workKey    = xmldoc2.SelectSingleNode("//WorkKey[last()]").InnerText.ToString();
            string VerifyInfo = xmldoc2.SelectSingleNode("//VerifyInfo[last()]").InnerText.ToString();


            XmlDocument xmldoc1 = new XmlDocument();

            xmldoc1.Load(GetPublicKey.GetSysPathRespose("XMLFile12_Response.xml"));
            string workGuid = xmldoc1.SelectSingleNode("//WorkGuid[last()]").InnerText.ToString();


            String body = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
                          + "<InputParameter>"
                          + "<Random>" + RandKey + "</Random>"
                          + "<ClientCode>" + ClientCode + "</ClientCode>"
                          + "<WorkGuid>" + workGuid + "</WorkGuid>"
                          + "<AppID></AppID>"
                          + "<CardTypeCode>501</CardTypeCode>"
                          + "<ExtCardNo></ExtCardNo>"
                          + "<YwType>4</YwType>"
                          + "<Mobile>" + memberVO.phone + "</Mobile>"
                          + "<Mailaddr></Mailaddr>"
                          + "<OrgCode>" + memberVO.OrgCode + "</OrgCode>"
                          + "<CertNo></CertNo>"
                          + "<Gender>1</Gender>"
                          + "<VipName>" + memberVO.memName + "</VipName>"
                          + "<OcUserCode>" + UserCode + "</OcUserCode>"
                          + "<OldBillNo>" + memberVO.idx + "</OldBillNo>"
                          + "<UserCode>" + UserCode + "</UserCode>"
                          + "<Birthday>" + memberVO.birthday + "</Birthday>"
                          + "</InputParameter>";


            String enBody = RSA_3DES.EncryStr3DES(workKey, body);

            String tag = enBody + VerifyInfo;

            tag = encryptMD5(tag).ToUpper();

            string psInputPara = "";

            psInputPara = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
                          + "<InputParameter>"
                          + "<Head>"
                          + "<Tag>" + tag + "</Tag>"
                          + "<ClientCode>" + ClientCode + "</ClientCode>"
                          + "</Head>"
                          + "<Body>"
                          + enBody
                          + "</Body>"
                          + "</InputParameter>";



            WebReferenceCC.TReturnInfo TReturnInfo = GetPublicKey.WebService(122, psInputPara);

            return(TReturnInfo.ReturnCode);

            //会员已存在 手机号重复
            //if (TReturnInfo.ReturnCode == 1221)
            //{
            //    PosExistMemberInfo posExistM = new PosExistMemberInfo();
            //     posExistM.getPosExistMemberInfo(memberVO);
            //}
        }
Beispiel #3
0
        public void getPosMemberInfo(MemberVO memberVO)
        {
            XmlDocument xmldoc = new XmlDocument();

            xmldoc.Load(GetPublicKey.GetSysPath("XMLFile8.xml"));
            string ClientCode = xmldoc.SelectSingleNode("//ClientCode[last()]").InnerText.ToString();

            XmlDocument xmldoc2 = new XmlDocument();

            xmldoc2.Load(GetPublicKey.GetSysPath("XMLFile12_Request.xml"));
            string UserCode   = xmldoc2.SelectSingleNode("//UserCode[last()]").InnerText.ToString();
            string workKey    = xmldoc2.SelectSingleNode("//WorkKey[last()]").InnerText.ToString();
            string VerifyInfo = xmldoc2.SelectSingleNode("//VerifyInfo[last()]").InnerText.ToString();


            XmlDocument xmldoc1 = new XmlDocument();

            xmldoc1.Load(GetPublicKey.GetSysPathRespose("XMLFile12_Response.xml"));
            string workGuid = xmldoc1.SelectSingleNode("//WorkGuid[last()]").InnerText.ToString();

            String psInputPara = "";


            String body = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
                          + "<InputParameter>"
                          + "<CardNo>" + memberVO.posCardNo + "</CardNo>"
                          + "<CardNoType>1</CardNoType>"
                          + "<Password></Password>"
                          + "<CardFaceChk></CardFaceChk>"
                          + "<CardFaceNoVerifyValue></CardFaceNoVerifyValue>"
                          + "<OrgCode>7001</OrgCode>"
                          + "<AccType></AccType>"
                          + "<YwType>101COMM</YwType>"
                          + "<QryKind>0</QryKind>"
                          + "<WorkGuid>" + workGuid + "</WorkGuid>"
                          + "<CardFaceNo>" + memberVO.posCardNo + "</CardFaceNo>"
                          + "</InputParameter>";



            String enBody = RSA_3DES.EncryStr3DES(workKey, body);

            String tag = enBody + VerifyInfo;

            tag = RSA_3DES.encryptMD5(tag).ToUpper();



            psInputPara = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
                          + "<InputParameter>"
                          + "<Head>"
                          + "<Tag>" + tag + "</Tag>"
                          + "<ClientCode>" + ClientCode + "</ClientCode>"
                          + "</Head>"
                          + "<Body>"
                          + enBody
                          + "</Body>"
                          + "</InputParameter>";



            WebReferenceCC.TReturnInfo TReturnInfo = GetPublicKey.WebService(3, psInputPara);

            string decodedMsg = Base64.DecodeBase64(TReturnInfo.RtnMsg);



            if (TReturnInfo.ReturnCode == 0)
            {
                String resultXml = RSA_3DES.DecryStr3DES(workKey, TReturnInfo.OutputPara);
            }
        }
Beispiel #4
0
        public static string getPosPoint(MemberVO memberVO, PointVO pointVO)
        {
            XmlDocument xmldoc = new XmlDocument();

            xmldoc.Load(GetPublicKey.GetSysPath("XMLFile8.xml"));
            string ClientCode = xmldoc.SelectSingleNode("//ClientCode[last()]").InnerText.ToString();

            XmlDocument xmldoc2 = new XmlDocument();

            xmldoc2.Load(GetPublicKey.GetSysPath("XMLFile12_Request.xml"));
            string UserCode   = xmldoc2.SelectSingleNode("//UserCode[last()]").InnerText.ToString();
            string workKey    = xmldoc2.SelectSingleNode("//WorkKey[last()]").InnerText.ToString();
            string VerifyInfo = xmldoc2.SelectSingleNode("//VerifyInfo[last()]").InnerText.ToString();


            XmlDocument xmldoc1 = new XmlDocument();

            xmldoc1.Load(GetPublicKey.GetSysPathRespose("XMLFile12_Response.xml"));
            string workGuid = xmldoc1.SelectSingleNode("//WorkGuid[last()]").InnerText.ToString();

            String psInputPara = "";

            //
            String body = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
                          + "<InputParameter>"
                          + "<CardNoType>1</CardNoType>"
                          + "<CardNo>" + memberVO.posCardNo + "</CardNo>"
                          + "<Year>" + pointVO.yyyy + "</Year>"
                          + "<Month>" + pointVO.mm + "</Month>"
                          + "<WorkGuid>" + workGuid + "</WorkGuid>"
                          + "<BgnRowNum>" + pointVO.bgnRowNum + "</BgnRowNum>"
                          + "<EndRowNum>" + pointVO.endRowNum + "</EndRowNum>"
                          + "</InputParameter>";



            String enBody = RSA_3DES.EncryStr3DES(workKey, body);

            String tag = enBody + VerifyInfo;

            tag = RSA_3DES.encryptMD5(tag).ToUpper();



            psInputPara = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
                          + "<InputParameter>"
                          + "<Head>"
                          + "<Tag>" + tag + "</Tag>"
                          + "<ClientCode>" + ClientCode + "</ClientCode>"
                          + "</Head>"
                          + "<Body>"
                          + enBody
                          + "</Body>"
                          + "</InputParameter>";



            WebReferenceCC.TReturnInfo TReturnInfo = GetPublicKey.WebService(903, psInputPara);

            string decodedMsg = Base64.DecodeBase64(TReturnInfo.RtnMsg);



            if (TReturnInfo.ReturnCode == 0)
            {
                //String resultXml = DES3.decrypt(result.getOutputPara(), workKey).trim();
                jsonString = RSA_3DES.DecryStr3DES(workKey, TReturnInfo.OutputPara);
                return(jsonString);
            }


            else
            {
                return(jsonString);
            }
        }