Ejemplo n.º 1
0
        public string UpdatePassengerInfoToDevice(string ids, string cardid, string idcard, string phone, string pass, string starttime, string endtime, string type)
        {
            //type 1-增加卡号,2-删除卡号,3-增加密码,4-删除密码,5-启用电子门锁,6-停用电子门锁,7-增加身份证,8-删除身份证
            LockServices.IhzbAttenServiceservice client = new LockServices.IhzbAttenServiceservice();
            string str = ids.PadRight(16, ' ') + cardid.PadRight(10, ' ') + idcard.PadRight(18, ' ') + phone.PadRight(13, ' ') + pass.PadRight(6, ' ') + starttime + endtime + type;
            string ret = client.hzb_SetPassengerInfo(99, "02500262", str);

            retStatus1 = ret;

            //if (ret.Substring(0,1) == "1")
            //{
            //    //statusRet = client.hzb_GetOprateResult(99, "02500262", ret.Substring(1));


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

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

            //    }

            //    AddLockLog(ids, str);
            //}

            return(retStatus1);
        }
Ejemplo n.º 2
0
        public void DeleteICCard(string id)
        {
            string    sql = "select * from Rent_Locks_ICCards where ID=" + id;
            DataTable dt  = MySQLHelper.ExecuteDataset(MySQLHelper.SqlConnString, MySQLHelper.CreateCommand(sql)).Tables[0];

            sql = "update Rent_Locks_ICCards set IsValid='0' where ID=" + id;
            MySQLHelper.ExecuteNonQuery(MySQLHelper.SqlConnString, MySQLHelper.CreateCommand(sql));
            string s = string.Empty;

            LockServices.IhzbAttenServiceservice client = new LockServices.IhzbAttenServiceservice();
            string str = dt.Rows[0]["LockID"].ToString().PadRight(16, ' ') + dt.Rows[0]["ICCard"].ToString().PadRight(10, ' ') + s.PadRight(18, ' ') + s.PadRight(13, ' ') + s.PadRight(6, ' ') + DateTime.Parse(dt.Rows[0]["StartDate"].ToString()).ToString("yyyyMMddHHmm").Substring(2, 10) + DateTime.Parse(dt.Rows[0]["EndDate"].ToString()).ToString("yyyyMMddHHmm").Substring(2, 10) + "2";
            string ret = client.hzb_SetPassengerInfo(99, "02500262", str);
        }
Ejemplo n.º 3
0
        public void UnFreezeLock(string ID)
        {
            LockServices.IhzbAttenServiceservice client = new LockServices.IhzbAttenServiceservice();
            string cardid    = string.Empty;
            string idcard    = string.Empty;
            string phone     = string.Empty;
            string pass      = string.Empty;
            string starttime = DateTime.Now.ToString("yyyyMMddHHmm").Substring(2, 10);
            string endtime   = DateTime.Now.ToString("yyyyMMddHHmm").Substring(2, 10);
            string str       = ID.PadRight(16, ' ') + cardid.PadRight(10, ' ') + idcard.PadRight(18, ' ') + phone.PadRight(13, ' ') + pass.PadRight(6, ' ') + starttime + endtime + "5";
            string ret       = client.hzb_SetPassengerInfo(99, "02500262", str);

            AddLockLog(ID, "UnFreeze");

            string sql = "update Rent_Locks set status='0' where DeviceID='" + ID + "'";

            MySQLHelper.ExecuteNonQuery(MySQLHelper.SqlConnString, MySQLHelper.CreateCommand(sql));
        }