Example #1
0
        /// <summary>
        /// 验证选座次数是否超过次数限制
        /// </summary>
        /// <param name="ChooseSeatTimesRestrict">刷卡次数设置</param>
        /// <returns></returns>
        public static bool CheckReaderChooseSeatTimesByReadingRoom(string cardNo, POSRestrict chooseSeatTimesRestrict, string roomNo)
        {
            IWCFService.ISeatManageService seatService = WcfAccessProxy.ServiceProxy.CreateChannelSeatManageService();
            bool error = false;

            try
            {
                int times = seatService.GetReaderChooseSeatTimesByReadingRoom(cardNo, chooseSeatTimesRestrict.Minutes, roomNo);
                if (times >= chooseSeatTimesRestrict.Times && chooseSeatTimesRestrict.IsUsed)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                error = true;
                SeatManageComm.WriteLog.Write("判断是否选座超过次数失败:" + ex.Message);
                return(false);
            }
            finally
            {
                ICommunicationObject ICommObjectService = seatService as ICommunicationObject;
                try
                {
                    if (ICommObjectService.State == CommunicationState.Faulted)
                    {
                        ICommObjectService.Abort();
                    }
                    else
                    {
                        ICommObjectService.Close();
                    }
                }
                catch
                {
                    ICommObjectService.Abort();
                }
            }
        }
Example #2
0
        /// <summary>
        /// 验证选座次数是否超过次数限制
        /// </summary>
        /// <param name="ChooseSeatTimesRestrict">刷卡次数设置</param>
        /// <returns></returns>
        public static bool CheckReaderChooseSeatTimesByReadingRoom(string cardNo, POSRestrict chooseSeatTimesRestrict, string roomNo)
        {
            IWCFService.ISeatManageService seatService = new WcfServiceForSeatManage.SeatManageDateService();
            bool error = false;

            try
            {
                int times = seatService.GetReaderChooseSeatTimesByReadingRoom(cardNo, chooseSeatTimesRestrict.Minutes, roomNo);
                if (times >= chooseSeatTimesRestrict.Times && chooseSeatTimesRestrict.IsUsed)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                error = true;
                SeatManageComm.WriteLog.Write("判断是否选座超过次数失败:" + ex.Message);
                return(false);
            }
        }