예제 #1
0
        public int logout()
        {
            string MemberidLoc   = Memberid;
            string UserIdLoc     = UserId;
            string ReturnMsgLoc  = string.Empty;
            int    ReturnCodeLoc = 0;

            try
            {
                sessionService sessionService = new sessionService();
                ReturnCodeLoc = sessionService.logout(MemberidLoc, UserIdLoc, out ReturnMsgLoc);
            }
            catch (Exception err)
            {
                System.Diagnostics.Trace.TraceError(err.ToString());
            }

            return(ReturnCodeLoc);
        }
예제 #2
0
        public int GetSessionId()
        {
            if (string.IsNullOrEmpty(Memberid) || string.IsNullOrEmpty(UserId) ||
                string.IsNullOrEmpty(Pin) || string.IsNullOrEmpty(ProducerVatNum))
            {
                return(-1);
            }

            string ret               = string.Empty;
            string MemberidLoc       = Memberid;
            string UserIdLoc         = UserId;
            string PinLoc            = Pin;
            string ProducerVatNumLoc = ProducerVatNum;

            int    ReturnCodeLoc = 0;
            string ReturnMsgLoc  = string.Empty;
            string strName       = string.Empty;
            string strAddress    = string.Empty;

            try
            {
                //x509certificate2 cert = new x509certificate2();
                //x509keystorageflags defaultkeyset = default(x509keystorageflags);
                //cert.import("thawte_primary_root_ca-g3_sha256.pem", "", defaultkeyset);
                sessionService sessionService = new sessionService();
                //sessionservice.clientcertificates.add(cert);
                SessionId  = sessionService.login(MemberidLoc, UserIdLoc, PinLoc, ProducerVatNumLoc, out ReturnCodeLoc, out ReturnMsgLoc);
                ReturnCode = ReturnCodeLoc;
                ReturnMsg  = ReturnMsgLoc;
                //    MessageBox.Show(text: ReturnMsg);
                return(ReturnCode);
            }
            catch (Exception err)
            {
                System.Diagnostics.Trace.TraceError(err.ToString());
                ReturnCode = -1;
                ReturnMsg  = err.ToString();
                //MessageBox.Show(err.Message);
                return(-1);
            }
        }