コード例 #1
0
        //---------------------------------------------------------------------------
        public RESTUnit()
        {
            //
            m_nSeqStep = 0;

            m_bDrngConnect = false;
            m_bDrngVersion = false;
            m_bDrngRFInfo  = false;
            m_bReqConnect  = false;
            m_bReqVersion  = false;
            m_bReqRFInfo   = false;
            m_bUpdateData  = false;
            m_bDataError   = false;

            m_sReqPlateId = string.Empty;

            this.client             = new HttpClient();
            this.client.BaseAddress = new Uri(this.apiUrl);
            this.client.Timeout     = TimeSpan.FromSeconds(5.0);

            RcvPlateRFIDInfo = new PlateRFIDInfo();
            RcvPlateRFIDInfo.Init();

            //
            m_Instance = this;
        }
コード例 #2
0
        //---------------------------------------------------------------------------
        public bool fn_GetRFIDInfo(string id)
        {
            try
            {
                //
                m_bUpdateData = false;
                m_bDataError  = false;

                //JUNG/2012015
                fn_Init();

                string str = Instance.REST_GET("/api/PlateRFIDInfo/" + id);

                if (str == DISCONNECTED)
                {
                    return(false);
                }
                if (str == "")
                {
                    m_bDataError = true;
                    return(false);
                }

                this.RcvPlateRFIDInfo          = (PlateRFIDInfo)JsonConvert.DeserializeObject(str, typeof(PlateRFIDInfo));
                this.RcvPlateRFIDInfo.sRcvTime = DateTime.Now.ToString("HH:mm:ss");

                m_bUpdateData = true;

                return(true);
            }
            catch
            {
                return(false);
            }
        }