Example #1
0
        public string UnLockDevice(string id)
        {
            string userId = "hzb_yskj".PadRight(30, ' ');

            //string doorId = "0201075500100001"; //Test
            LockServices.IhzbAttenServiceservice client = new LockServices.IhzbAttenServiceservice();
            string ret = client.hzb_SetDoorOpen(99, "02500262", userId + id);

            retStatus = ret;
            string returnStr = ret.Substring(0, 1);
            string doorId    = ret.Substring(1, 16);
            string serialNo  = ret.Substring(17, 12);
            string statusRet = string.Empty;

            //System.Timers.Timer t = new System.Timers.Timer(1000);
            if (returnStr == "1")
            {
                //statusRet = client.hzb_GetOprateResult(99, "02500262", ret.Substring(1));


                t.Elapsed  += new System.Timers.ElapsedEventHandler(theout); //到达时间的时候执行事件;
                t.AutoReset = true;                                          //设置是执行一次(false)还是一直执行(true);
                t.Enabled   = true;                                          //是否执行System.Timers.Timer.Elapsed事件;

                while (isLoop)
                {
                    //statusRet = client.hzb_GetOprateResult(99, "02500262", ret.Substring(1));
                }

                AddLockLog(id, "Open");
            }
            else
            {
                return("3");
            }
            return(retStatus);
        }