protected void btn_shortLeave(object sender, EventArgs e)
 {
     SeatManage.ClassModel.EnterOutLogInfo enterOutLog = SeatManage.Bll.T_SM_EnterOutLog.GetUsingEnterOutLogBySeatNo(seatNo);
     SeatManage.ClassModel.ReadingRoomInfo roomInfo    = SeatManage.Bll.T_SM_ReadingRoom.GetSingleRoomInfo(enterOutLog.ReadingRoomNo);
     if (btnShortLeave.Text == "暂离")
     {
         enterOutLog.EnterOutState = SeatManage.EnumType.EnterOutLogType.ShortLeave;
         enterOutLog.Flag          = SeatManage.EnumType.Operation.Admin;
         enterOutLog.Remark        = string.Format("在{0},{1}号座位,被管理员{2},在后台管理网站设置为暂离", roomInfo.Name, enterOutLog.ShortSeatNo, this.LoginId);
         int newId = -1;
         SeatManage.EnumType.HandleResult result = SeatManage.Bll.EnterOutOperate.AddEnterOutLog(enterOutLog, ref newId);
         if (result == SeatManage.EnumType.HandleResult.Successed)
         {
             FineUI.Alert.ShowInTop("设置读者暂离成功", "成功");
             PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
         }
         else
         {
             FineUI.Alert.ShowInTop("设置读者暂离失败", "失败");
         }
     }
     else
     {
         enterOutLog.EnterOutState = SeatManage.EnumType.EnterOutLogType.ComeBack;
         enterOutLog.Flag          = SeatManage.EnumType.Operation.Admin;
         enterOutLog.Remark        = string.Format("在{0},{1}号座位,被管理员{2},在后台管理网站设置为在座", roomInfo.Name, enterOutLog.ShortSeatNo, this.LoginId);
         int newId = -1;
         SeatManage.EnumType.HandleResult result = SeatManage.Bll.EnterOutOperate.AddEnterOutLog(enterOutLog, ref newId);
         if (result == SeatManage.EnumType.HandleResult.Successed)
         {
             List <SeatManage.ClassModel.WaitSeatLogInfo> waitSeatLogs = SeatManage.Bll.T_SM_SeatWaiting.GetWaitSeatList("", enterOutLog.EnterOutLogID, null, null, null);
             SeatManage.ClassModel.WaitSeatLogInfo        waitSeatLog  = null;
             if (waitSeatLogs.Count > 0)
             {
                 waitSeatLog              = waitSeatLogs[0];
                 waitSeatLog.NowState     = SeatManage.EnumType.LogStatus.Fail;
                 waitSeatLog.OperateType  = SeatManage.EnumType.Operation.OtherReader;
                 waitSeatLog.WaitingState = SeatManage.EnumType.EnterOutLogType.WaitingCancel;
                 if (SeatManage.Bll.T_SM_SeatWaiting.UpdateWaitLog(waitSeatLog))
                 {
                     FineUI.Alert.ShowInTop("取消读者暂离成功", "成功");
                     PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                 }
                 else
                 {
                     FineUI.Alert.ShowInTop("取消读者暂离成功,取消等待失败", "失败");
                 }
             }
             else
             {
                 FineUI.Alert.ShowInTop("取消读者暂离成功", "成功");
                 PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
             }
         }
         else
         {
             FineUI.Alert.ShowInTop("取消读者暂离失败", "失败");
         }
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 续时
        /// </summary>
        public void ContinuedTime()
        {
            clientobject.ReaderInfo.EnterOutLog.EnterOutState = SeatManage.EnumType.EnterOutLogType.ContinuedTime;//设置读者状态为暂回来
            clientobject.ReaderInfo.EnterOutLog.Flag          = SeatManage.EnumType.Operation.Reader;
            int newLogId = -1;

            if (clientobject.ReaderInfo.CanContinuedTime > ServiceDateTime.Now)
            {
                HandleResult(string.Format("    在座时间过短,请在{0}后续时。", clientobject.ReaderInfo.CanContinuedTime.ToShortTimeString()), SeatManage.EnumType.HandleResult.Successed);
                return;
            }
            if (clientobject.ReaderInfo.ContinuedTimeCount != 0 && (clientobject.ReaderInfo.ContinuedTimeCount >= clientobject.ReaderInfo.AtReadingRoom.Setting.SeatUsedTimeLimit.ContinuedTimes))
            {
                HandleResult("    续时次数不足,请重新选座。", SeatManage.EnumType.HandleResult.Successed);
                return;
            }
            clientobject.ReaderInfo.EnterOutLog.Remark      = string.Format("在续时终端刷卡延长{0},{1}号座位使用时间", clientobject.ReaderInfo.AtReadingRoom.Name, clientobject.ReaderInfo.EnterOutLog.ShortSeatNo);
            clientobject.ReaderInfo.EnterOutLog.TerminalNum = clientobject.ClientSetting.ClientNo;
            SeatManage.EnumType.HandleResult result = EnterOutOperate.AddEnterOutLog(clientobject.ReaderInfo.EnterOutLog, ref newLogId);//插入进出记录
            if (result == SeatManage.EnumType.HandleResult.Successed)
            {
                HandleResult(string.Format("    续时成功,延长{0},{1}号座位使用时间。", clientobject.ReaderInfo.AtReadingRoom.Name, clientobject.ReaderInfo.EnterOutLog.ShortSeatNo), SeatManage.EnumType.HandleResult.Successed);
                return;
            }
            else
            {
                //TODO:错误提示
            }
        }
        protected void btn_btnLeave(object sender, EventArgs e)
        {
            SeatManage.ClassModel.EnterOutLogInfo enterOutLog = SeatManage.Bll.T_SM_EnterOutLog.GetUsingEnterOutLogBySeatNo(seatNo);
            SeatManage.ClassModel.ReadingRoomInfo roomInfo    = SeatManage.Bll.T_SM_ReadingRoom.GetSingleRoomInfo(enterOutLog.ReadingRoomNo);
            enterOutLog.EnterOutState = SeatManage.EnumType.EnterOutLogType.Leave;
            enterOutLog.Flag          = SeatManage.EnumType.Operation.Admin;
            enterOutLog.Remark        = string.Format("在{0},{1}号座位,被管理员{2},在后台管理网站设置离开", roomInfo.Name, enterOutLog.ShortSeatNo, this.LoginId);
            int newId = -1;

            SeatManage.EnumType.HandleResult result = SeatManage.Bll.EnterOutOperate.AddEnterOutLog(enterOutLog, ref newId);
            if (result == SeatManage.EnumType.HandleResult.Successed)
            {
                SeatManage.ClassModel.RegulationRulesSetting rulesSet = SeatManage.Bll.T_SM_SystemSet.GetRegulationRulesSetting();
                if (roomInfo.Setting.IsRecordViolate)
                {
                    if (roomInfo.Setting.BlackListSetting.Used)
                    {
                        if (roomInfo.Setting.BlackListSetting.ViolateRoule[SeatManage.EnumType.ViolationRecordsType.LeaveByAdmin])
                        {
                            SeatManage.ClassModel.ViolationRecordsLogInfo violationRecords = new SeatManage.ClassModel.ViolationRecordsLogInfo();
                            violationRecords.CardNo        = enterOutLog.CardNo;
                            violationRecords.SeatID        = enterOutLog.SeatNo.Substring(enterOutLog.SeatNo.Length - roomInfo.Setting.SeatNumAmount, roomInfo.Setting.SeatNumAmount);
                            violationRecords.ReadingRoomID = enterOutLog.ReadingRoomNo;
                            violationRecords.EnterOutTime  = SeatManage.Bll.ServiceDateTime.Now.ToString();
                            violationRecords.EnterFlag     = SeatManage.EnumType.ViolationRecordsType.LeaveByAdmin;
                            violationRecords.Remark        = string.Format("在{0},{1}号座位,被管理员{2},在后台管理网站设置离开", roomInfo.Name, enterOutLog.ShortSeatNo, this.LoginId);
                            violationRecords.BlacklistID   = "-1";
                            SeatManage.Bll.T_SM_ViolateDiscipline.AddViolationRecords(violationRecords);
                        }
                    }
                    else if (rulesSet.BlacklistSet.Used && rulesSet.BlacklistSet.ViolateRoule[SeatManage.EnumType.ViolationRecordsType.LeaveByAdmin])
                    {
                        SeatManage.ClassModel.ViolationRecordsLogInfo violationRecords = new SeatManage.ClassModel.ViolationRecordsLogInfo();
                        violationRecords.CardNo        = enterOutLog.CardNo;
                        violationRecords.SeatID        = enterOutLog.SeatNo.Substring(enterOutLog.SeatNo.Length - roomInfo.Setting.SeatNumAmount, roomInfo.Setting.SeatNumAmount);
                        violationRecords.ReadingRoomID = enterOutLog.ReadingRoomNo;
                        violationRecords.EnterOutTime  = SeatManage.Bll.ServiceDateTime.Now.ToString();
                        violationRecords.EnterFlag     = SeatManage.EnumType.ViolationRecordsType.LeaveByAdmin;
                        violationRecords.Remark        = string.Format("在{0},{1}号座位,被管理员{2},在后台管理网站设置离开", roomInfo.Name, enterOutLog.ShortSeatNo, this.LoginId);
                        violationRecords.BlacklistID   = "-1";
                        SeatManage.Bll.T_SM_ViolateDiscipline.AddViolationRecords(violationRecords);
                    }
                }

                FineUI.Alert.ShowInTop("设置读者离开成功", "成功");
                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
            }
            else
            {
                FineUI.Alert.ShowInTop("设置读者离开失败", "失败");
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 暂时离开
        /// </summary>
        public void ShortLeave()
        {
            clientobject.ReaderInfo.EnterOutLog.TerminalNum   = clientobject.ClientSetting.ClientNo;
            clientobject.ReaderInfo.EnterOutLog.EnterOutState = SeatManage.EnumType.EnterOutLogType.ShortLeave;
            int newLogId = -1;

            clientobject.ReaderInfo.EnterOutLog.Remark = string.Format("在暂离终端刷卡暂离,保留{1} {2}号座位{3}分钟",
                                                                       clientobject.ClientSetting.ClientNo,
                                                                       clientobject.ReaderInfo.AtReadingRoom.Name,
                                                                       clientobject.ReaderInfo.EnterOutLog.ShortSeatNo,
                                                                       NowReadingRoomState.GetSeatHoldTime(clientobject.ReaderInfo.AtReadingRoom.Setting.SeatHoldTime, ServiceDateTime.Now));
            try
            {
                SeatManage.EnumType.HandleResult result = EnterOutOperate.AddEnterOutLog(clientobject.ReaderInfo.EnterOutLog, ref newLogId);//插入进出记录
                if (result == SeatManage.EnumType.HandleResult.Successed)
                {
                    if (HandleResult != null)
                    {
                        HandleResult(string.Format("   谢谢配合,请在{0}分钟内回来刷卡。", NowReadingRoomState.GetSeatHoldTime(clientobject.ReaderInfo.AtReadingRoom.Setting.SeatHoldTime, ServiceDateTime.Now)), SeatManage.EnumType.HandleResult.Successed);
                    }
                }
                else
                {
                    if (HandleResult != null)
                    {
                        HandleResult("    操作失败,请重试。", SeatManage.EnumType.HandleResult.Failed);
                    }
                }
            }
            catch (Exception ex)
            {
                SeatManage.SeatManageComm.WriteLog.Write(string.Format("读者{0}暂离操作失败:{1}", clientobject.ReaderInfo.CardNo, ex.Message));
                if (HandleResult != null)
                {
                    HandleResult("    操作失败,请重试。", SeatManage.EnumType.HandleResult.Failed);
                }
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 释放座位
        /// </summary>
        public void Leave()
        {
            int newLogId = -1;

            clientobject.ReaderInfo.EnterOutLog.EnterOutState = SeatManage.EnumType.EnterOutLogType.Leave;
            clientobject.ReaderInfo.EnterOutLog.TerminalNum   = clientobject.ClientSetting.ClientNo;
            clientobject.ReaderInfo.EnterOutLog.Remark        = string.Format("在离开终端刷卡释放{0} {1}号座位",
                                                                              clientobject.ReaderInfo.EnterOutLog.ReadingRoomName,
                                                                              clientobject.ReaderInfo.EnterOutLog.ShortSeatNo);
            try
            {
                SeatManage.EnumType.HandleResult result = EnterOutOperate.AddEnterOutLog(clientobject.ReaderInfo.EnterOutLog, ref newLogId);//插入进出记录
                if (result == SeatManage.EnumType.HandleResult.Successed)
                {
                    if (HandleResult != null)
                    {
                        HandleResult("    成功释放座位!", SeatManage.EnumType.HandleResult.Successed);
                    }
                }
                else
                {
                    if (HandleResult != null)
                    {
                        HandleResult("    座位释放失败,请重试!", SeatManage.EnumType.HandleResult.Failed);
                    }
                }
            }
            catch
            (Exception ex)
            {
                SeatManage.SeatManageComm.WriteLog.Write(string.Format("读者{0}释放座位操作失败:{1}", clientobject.ReaderInfo.CardNo, ex.Message));
                if (HandleResult != null)
                {
                    HandleResult("    座位释放失败,请重试!", SeatManage.EnumType.HandleResult.Failed);
                }
            }
        }
Exemplo n.º 6
0
        public string EnterLib(string CardNo)
        {
            string[] strs = CardNo.Split(',');
            CardNo = strs[0];
            if (!Verifylicensing())
            {
                return("非法操作,此接口未进行授权!");
            }
            //SeatManage.SeatManageComm.WriteLog.Write("传入卡号:" + strs[0]);
            //SeatManage.SeatManageComm.WriteLog.Write("传入图书馆号:" + strs[1]);
            StringBuilder message      = new StringBuilder();
            string        ReaderNo     = CardNo;
            string        ReaderName   = "";
            string        NowStatus    = "";
            string        BeforeStatus = "";
            string        Error        = "";

            message.Append("<ReaderInfo>");
            message.Append("<ReaderNo>{0}</ReaderNo>");
            message.Append("<ReaderName>{1}</ReaderName>");
            message.Append("<NowStatus>{2}</NowStatus>");
            message.Append("<BeforeStatus>{3}</BeforeStatus>");
            message.Append("<Error>{4}</Error>");
            message.Append("</ReaderInfo>");
            try
            {
                if (string.IsNullOrEmpty(CardNo))
                {
                    throw new Exception("输入的学号为空!");
                }
                SeatManage.ClassModel.AccessSetting accset = SeatManage.Bll.T_SM_SystemSet.GetAccessSetting();
                if (accset == null)
                {
                    throw new Exception("获取通道机设置失败!");
                }
                SeatManage.ClassModel.ReaderInfo reader = SeatManage.Bll.EnterOutOperate.GetReaderInfo(CardNo);
                if (reader == null)
                {
                    throw new Exception("获取不到此学生的信息!");
                }
                if (strs.Length > 1 && reader.AtReadingRoom != null && strs[1] != "00" && reader.AtReadingRoom.Libaray.No != strs[1])
                {
                    throw new Exception("学生在此图书馆未选座位!");
                }
                ReaderNo   = reader.CardNo;
                ReaderName = reader.Name;
                if (reader.EnterOutLog == null)
                {
                    NowStatus    = ((int)SeatManage.EnumType.EnterOutLogType.Leave).ToString();
                    BeforeStatus = ((int)SeatManage.EnumType.EnterOutLogType.Leave).ToString();
                }
                else
                {
                    NowStatus    = ((int)reader.EnterOutLog.EnterOutState).ToString();
                    BeforeStatus = ((int)reader.EnterOutLog.EnterOutState).ToString();
                }
                if (accset.IsUsed && accset.EnterLib)
                {
                    if (reader.EnterOutLog != null && reader.EnterOutLog.EnterOutState != SeatManage.EnumType.EnterOutLogType.Leave)
                    {
                        switch (reader.EnterOutLog.EnterOutState)
                        {
                        case SeatManage.EnumType.EnterOutLogType.BookingConfirmation:
                        case SeatManage.EnumType.EnterOutLogType.ComeBack:
                        case SeatManage.EnumType.EnterOutLogType.ContinuedTime:
                        case SeatManage.EnumType.EnterOutLogType.ReselectSeat:
                        case SeatManage.EnumType.EnterOutLogType.SelectSeat:
                        case SeatManage.EnumType.EnterOutLogType.WaitingSuccess:
                            if (accset.IsReleaseOnSeat && reader.EnterOutLog.EnterOutTime.AddMinutes(accset.LeaveTimeSpan) < SeatManage.Bll.ServiceDateTime.Now)
                            {
                                SeatManage.ClassModel.EnterOutLogInfo enterOutLog = reader.EnterOutLog;
                                enterOutLog.EnterOutState = SeatManage.EnumType.EnterOutLogType.Leave;
                                enterOutLog.TerminalNum   = "";
                                enterOutLog.Remark        = string.Format("读者离开图书馆未刷卡,再次通过通道机进入,系统自动释放{0} {1}号座位", reader.AtReadingRoom.Name, enterOutLog.ShortSeatNo);
                                enterOutLog.EnterOutTime  = SeatManage.Bll.ServiceDateTime.Now;
                                enterOutLog.Flag          = SeatManage.EnumType.Operation.Service;
                                int newId = 0;
                                if (SeatManage.Bll.EnterOutOperate.AddEnterOutLog(enterOutLog, ref newId) == SeatManage.EnumType.HandleResult.Failed)
                                {
                                    throw new Exception("更新进出记录失败!");
                                }
                                NowStatus = ((int)SeatManage.EnumType.EnterOutLogType.Leave).ToString();
                                if (accset.AddViolationRecords)
                                {
                                    SeatManage.ClassModel.ViolationRecordsLogInfo vrInfo = new SeatManage.ClassModel.ViolationRecordsLogInfo();
                                    vrInfo.CardNo        = enterOutLog.CardNo;
                                    vrInfo.EnterFlag     = SeatManage.EnumType.ViolationRecordsType.LeaveNotReadCard;
                                    vrInfo.EnterOutTime  = enterOutLog.EnterOutTime.ToString();
                                    vrInfo.Flag          = SeatManage.EnumType.LogStatus.Valid;
                                    vrInfo.ReadingRoomID = enterOutLog.ReadingRoomNo;
                                    vrInfo.SeatID        = enterOutLog.SeatNo;
                                    vrInfo.Remark        = string.Format("读者{0}离开图书馆未刷卡,再次通过通道机,记录违规", ReaderNo);
                                    if (!SeatManage.Bll.T_SM_ViolateDiscipline.AddViolationRecords(vrInfo))
                                    {
                                        throw new Exception("添加违规记录失败!");
                                    }
                                }
                            }
                            break;

                        case SeatManage.EnumType.EnterOutLogType.ShortLeave:
                            if (accset.IsComeBack)
                            {
                                DateTime NowTime = SeatManage.Bll.ServiceDateTime.Now;
                                SeatManage.ClassModel.EnterOutLogInfo enterOutLog = reader.EnterOutLog;
                                System.TimeSpan shortleavetimelong = NowTime - enterOutLog.EnterOutTime;
                                enterOutLog.EnterOutState = SeatManage.EnumType.EnterOutLogType.ComeBack;
                                enterOutLog.TerminalNum   = "";
                                enterOutLog.Remark        = string.Format("在通道机刷卡暂离回来,暂离时长{0}分钟,继续使用{1} {2}号座位", shortleavetimelong.TotalMinutes.ToString().Split('.')[0], enterOutLog.ReadingRoomName, enterOutLog.ShortSeatNo);
                                enterOutLog.EnterOutTime  = NowTime;
                                enterOutLog.Flag          = SeatManage.EnumType.Operation.Service;
                                int newId = 0;
                                if (SeatManage.Bll.EnterOutOperate.AddEnterOutLog(enterOutLog, ref newId) == SeatManage.EnumType.HandleResult.Failed)
                                {
                                    throw new Exception("更新进出记录失败!");
                                }
                                List <SeatManage.ClassModel.WaitSeatLogInfo> waitSeatLogs = SeatManage.Bll.T_SM_SeatWaiting.GetWaitSeatList("", enterOutLog.EnterOutLogID, null, null, null);
                                if (waitSeatLogs.Count > 0)
                                {
                                    SeatManage.ClassModel.WaitSeatLogInfo waitSeatLog = waitSeatLogs[0];
                                    waitSeatLog.NowState     = SeatManage.EnumType.LogStatus.Fail;
                                    waitSeatLog.OperateType  = SeatManage.EnumType.Operation.OtherReader;
                                    waitSeatLog.WaitingState = SeatManage.EnumType.EnterOutLogType.WaitingCancel;
                                    if (!SeatManage.Bll.T_SM_SeatWaiting.UpdateWaitLog(waitSeatLog))
                                    {
                                        throw new Exception("修改等待记录失败!");
                                    }
                                }
                                NowStatus = ((int)SeatManage.EnumType.EnterOutLogType.ComeBack).ToString();
                            }
                            break;
                        }
                    }
                    else
                    {
                        DateTime nowDate = SeatManage.Bll.ServiceDateTime.Now;
                        if (accset.IsBookingConfinmed && reader.BespeakLog.Count > 0)
                        {
                            SeatManage.ClassModel.BespeakLogInfo     bespeaklog = reader.BespeakLog[0];
                            SeatManage.ClassModel.ReadingRoomSetting set        = reader.AtReadingRoom.Setting;
                            DateTime dtBegin = bespeaklog.BsepeakTime.AddMinutes(-double.Parse(set.SeatBespeak.ConfirmTime.BeginTime));
                            DateTime dtEnd   = bespeaklog.BsepeakTime.AddMinutes(double.Parse(set.SeatBespeak.ConfirmTime.EndTime));
                            if (SeatManage.SeatManageComm.DateTimeOperate.DateAccord(dtBegin, dtEnd, nowDate) || (set.SeatBespeak.NowDayBespeak && bespeaklog.SubmitTime == bespeaklog.BsepeakTime))
                            {
                                SeatManage.ClassModel.EnterOutLogInfo seatUsedInfo = SeatManage.Bll.T_SM_EnterOutLog.GetUsingEnterOutLogBySeatNo(bespeaklog.SeatNo);
                                if (seatUsedInfo != null && seatUsedInfo.EnterOutState != SeatManage.EnumType.EnterOutLogType.Leave)
                                { //条件满足,说明座位正在使用。
                                    seatUsedInfo.EnterOutState = SeatManage.EnumType.EnterOutLogType.Leave;
                                    seatUsedInfo.EnterOutType  = SeatManage.EnumType.LogStatus.Valid;
                                    seatUsedInfo.Remark        = string.Format("预约该座位的读者在通道机刷卡确认入座,设置在座读者离开");
                                    seatUsedInfo.Flag          = SeatManage.EnumType.Operation.OtherReader;
                                    int newId = -1;
                                    SeatManage.Bll.EnterOutOperate.AddEnterOutLog(seatUsedInfo, ref newId);
                                }
                                SeatManage.ClassModel.EnterOutLogInfo newEnterOutLog = new SeatManage.ClassModel.EnterOutLogInfo();//构造
                                newEnterOutLog.CardNo        = bespeaklog.CardNo;
                                newEnterOutLog.EnterOutLogNo = SeatManage.SeatManageComm.SeatComm.RndNum();
                                newEnterOutLog.EnterOutState = SeatManage.EnumType.EnterOutLogType.BookingConfirmation;
                                newEnterOutLog.EnterOutType  = SeatManage.EnumType.LogStatus.Valid;
                                newEnterOutLog.Flag          = SeatManage.EnumType.Operation.Reader;
                                newEnterOutLog.ReadingRoomNo = bespeaklog.ReadingRoomNo;
                                newEnterOutLog.SeatNo        = bespeaklog.SeatNo;
                                newEnterOutLog.Remark        = string.Format("在通道机刷卡,入座预约的{0} {1}号座位", bespeaklog.ReadingRoomName, bespeaklog.ShortSeatNum);
                                NowStatus = ((int)SeatManage.EnumType.EnterOutLogType.BookingConfirmation).ToString();
                                int logid = -1;
                                SeatManage.EnumType.HandleResult result = SeatManage.Bll.EnterOutOperate.AddEnterOutLog(newEnterOutLog, ref logid); //添加入座记录
                                if (result == SeatManage.EnumType.HandleResult.Successed)
                                {
                                    bespeaklog.BsepeakState = SeatManage.EnumType.BookingStatus.Confinmed;
                                    bespeaklog.CancelPerson = SeatManage.EnumType.Operation.Reader;
                                    bespeaklog.CancelTime   = nowDate;
                                    bespeaklog.Remark       = string.Format("在通道机刷卡,入座预约的{0} {1}号座位", bespeaklog.ReadingRoomName, bespeaklog.ShortSeatNum);
                                    SeatManage.Bll.T_SM_SeatBespeak.UpdateBespeakList(bespeaklog);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Error = e.Message;
            }
            return(string.Format(message.ToString(), ReaderNo, ReaderName, NowStatus, BeforeStatus, Error));
        }
Exemplo n.º 7
0
        protected void btnBespeak_Click(object sender, EventArgs e)
        {
            SeatManage.ClassModel.BespeakLogInfo bespeakModel = new SeatManage.ClassModel.BespeakLogInfo();
            bespeakModel.BsepeakState = SeatManage.EnumType.BookingStatus.Waiting;
            DateTime bespeatDate = DateTime.Parse(string.Format("{0} {1}", DateTime.Parse(date).ToShortDateString(), roomOpenTime.Value));

            if (rblModel.SelectedValue == "1")
            {
                if (!DropDownList_Time.Hidden == true)
                {
                    bespeatDate = DateTime.Parse(string.Format("{0} {1}", DateTime.Parse(date).ToShortDateString(), DropDownList_Time.SelectedText));
                }
                else
                {
                    bespeatDate = DateTime.Parse(string.Format("{0} {1}", DateTime.Parse(date).ToShortDateString(), DropDownList_FreeTime.SelectedText));
                }
            }
            bespeakModel.BsepeakTime   = bespeatDate;
            bespeakModel.CardNo        = this.LoginId;
            bespeakModel.ReadingRoomNo = roomNo.Trim();
            bespeakModel.Remark        = string.Format("读者通过Web页面预约座位");
            bespeakModel.SeatNo        = seatNo;
            bespeakModel.SubmitTime    = SeatManage.Bll.ServiceDateTime.Now;
            try
            {
                SeatManage.ClassModel.ReadingRoomInfo room = SeatManage.Bll.T_SM_ReadingRoom.GetSingleRoomInfo(bespeakModel.ReadingRoomNo);
                if (!room.Setting.IsCanBespeakSeat(bespeakModel.BsepeakTime))
                {
                    FineUI.Alert.ShowInTop("对不起不能预约当前日期的座位,请刷新页面重新选择日期。");
                    PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                }
                if (bespeakModel.SubmitTime > bespeakModel.BsepeakTime)
                {
                    FineUI.Alert.ShowInTop("对不起不能预约时间错误,请刷新页面重新选择日期。");
                    PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                }
                if (room.Setting.SeatBespeak.BespeakArea.BespeakType == BespeakAreaType.Percentage)
                {
                    List <BespeakLogInfo> bespeaklogs = SeatManage.Bll.T_SM_SeatBespeak.GetNotCheckedBespeakLogInfo(new List <string>()
                    {
                        bespeakModel.ReadingRoomNo
                    }, bespeakModel.BsepeakTime);
                    double canbookCount = (double)((double)(room.SeatList.Seats.Count - room.SeatList.Seats.Where(u => u.Value.IsSuspended).ToArray().Count()) * room.Setting.SeatBespeak.BespeakArea.Scale);
                    if (bespeaklogs.Count >= canbookCount)
                    {
                        FineUI.Alert.ShowInTop("对不起当前阅览室已经没有可预约的座位。");
                        PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                    }
                }

                SeatManage.EnumType.HandleResult result = SeatManage.Bll.T_SM_SeatBespeak.AddBespeakLogInfo(bespeakModel);
                if (result == SeatManage.EnumType.HandleResult.Successed)
                {
                    FineUI.Alert.ShowInTop("座位预约成功,请在规定的时间内刷卡确认。");
                    PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                }
                else
                {
                    FineUI.Alert.ShowInTop("预约失败,该座位已经被别人预约。");
                    PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                }
            }
            catch (Exception ex)
            {
                FineUI.Alert.ShowInTop(string.Format("执行预约操作遇到错误:{0}", ex.Message));
                PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
            }
        }
        protected void btnBespeak_Click(object sender, EventArgs e)
        {
            SeatManage.ClassModel.BespeakLogInfo bespeakModel = new SeatManage.ClassModel.BespeakLogInfo();
            bespeakModel.BsepeakState = SeatManage.EnumType.BookingStatus.Waiting;
            DateTime bespeatDate = DateTime.Parse(string.Format("{0} {1}", DateTime.Parse(date).ToShortDateString(), roomOpenTime.Value));

            if (rblModel.SelectedValue == "1")
            {
                if (!DropDownList_Time.Hidden == true)
                {
                    bespeatDate = DateTime.Parse(string.Format("{0} {1}", DateTime.Parse(date).ToShortDateString(), DropDownList_Time.SelectedText));
                }
                else
                {
                    bespeatDate = DateTime.Parse(string.Format("{0} {1}", DateTime.Parse(date).ToShortDateString(), DropDownList_FreeTime.SelectedText));
                }
            }
            bespeakModel.BsepeakTime   = bespeatDate;
            bespeakModel.CardNo        = this.LoginId;
            bespeakModel.ReadingRoomNo = roomNo.Trim();
            bespeakModel.Remark        = string.Format("读者通过Web页面预约座位");
            bespeakModel.SeatNo        = seatNo;
            bespeakModel.SubmitTime    = SeatManage.Bll.ServiceDateTime.Now;

            List <SeatManage.ClassModel.BespeakLogInfo> list = SeatManage.Bll.T_SM_SeatBespeak.GetBespeakLogInfoBySeatNo(seatNo, DateTime.Parse(date).Date);

            foreach (SeatManage.ClassModel.BespeakLogInfo b in list)
            {
                if (b.BsepeakTime == bespeakModel.BsepeakTime)
                {
                    FineUI.Alert.ShowInTop("对不起,此时间段已被预约。");
                    btnBespeak.Enabled = false;
                    PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                    return;
                }
            }
            List <SeatManage.ClassModel.BespeakLogInfo> readerBespeaklist = SeatManage.Bll.T_SM_SeatBespeak.GetBespeakList(this.LoginId, null, DateTime.Parse(date).Date, 0, new List <SeatManage.EnumType.BookingStatus> {
                SeatManage.EnumType.BookingStatus.Waiting
            });

            foreach (SeatManage.ClassModel.BespeakLogInfo b in readerBespeaklist)
            {
                if (b.BsepeakTime == bespeakModel.BsepeakTime)
                {
                    FineUI.Alert.ShowInTop("对不起,同一时间段只能预约一个座位。");
                    btnBespeak.Enabled = false;
                    PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                    return;
                }
            }
            try
            {
                SeatManage.EnumType.HandleResult result = SeatManage.Bll.T_SM_SeatBespeak.AddBespeakLogInfo(bespeakModel);
                if (result == SeatManage.EnumType.HandleResult.Successed)
                {
                    FineUI.Alert.ShowInTop("座位预约成功,请在规定的时间内刷卡确认。");
                    PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                }
                else
                {
                    FineUI.Alert.ShowInTop("预约失败,该座位已经被别人预约。");
                    PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                }
            }
            catch (Exception ex)
            {
                FineUI.Alert.ShowInTop(string.Format("执行预约操作遇到错误:{0}", ex.Message));
                PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
            }
        }
Exemplo n.º 9
0
        /// <summary>
        ///暂离回来
        /// </summary>
        public void CometoBack()
        {
            clientobject.ReaderInfo.EnterOutLog.EnterOutState = SeatManage.EnumType.EnterOutLogType.ComeBack;//设置读者状态为暂回来
            clientobject.ReaderInfo.EnterOutLog.Flag          = SeatManage.EnumType.Operation.Reader;
            List <WaitSeatLogInfo> waitSeatLogs = T_SM_SeatWaiting.GetWaitSeatList("", clientobject.ReaderInfo.EnterOutLog.EnterOutLogID, null, null, null);
            WaitSeatLogInfo        waitSeatLog  = null;
            string clientType = "终端";

            switch (LeaveClientSetting.LeaveState)
            {
            case LeaveState.FreeSeat:
                clientType = "离开终端";
                break;

            case LeaveState.ShortLeave:
                clientType = "暂离终端";
                break;

            case LeaveState.ContinuedTime:
                clientType = "续时终端";
                break;

            case LeaveState.Choose:
                clientType = "自助终端";
                break;
            }
            int newLogId = -1;

            System.TimeSpan shortleavetimelong = ServiceDateTime.Now - clientobject.ReaderInfo.EnterOutLog.EnterOutTime;
            clientobject.ReaderInfo.EnterOutLog.Remark = string.Format("在{0}刷卡暂离回来,暂离时长{1}分钟,继续使用{2} {3}号座位",
                                                                       clientType,
                                                                       shortleavetimelong.Minutes,
                                                                       clientobject.ReaderInfo.EnterOutLog.ReadingRoomName,
                                                                       clientobject.ReaderInfo.EnterOutLog.ShortSeatNo);
            clientobject.ReaderInfo.EnterOutLog.TerminalNum = clientobject.ClientSetting.ClientNo;
            try
            {
                SeatManage.EnumType.HandleResult result = EnterOutOperate.AddEnterOutLog(clientobject.ReaderInfo.EnterOutLog, ref newLogId);//插入进出记录
                if (result == SeatManage.EnumType.HandleResult.Successed)
                {
                    if (waitSeatLogs.Count > 0)
                    {
                        waitSeatLog              = waitSeatLogs[0];
                        waitSeatLog.NowState     = SeatManage.EnumType.LogStatus.Fail;
                        waitSeatLog.OperateType  = SeatManage.EnumType.Operation.OtherReader;
                        waitSeatLog.WaitingState = SeatManage.EnumType.EnterOutLogType.WaitingCancel;
                        T_SM_SeatWaiting.UpdateWaitLog(waitSeatLog);//取消等待
                    }
                    if (HandleResult != null)
                    {
                        HandleResult(string.Format("    欢迎回来,您的座位在{0} {1}号。", clientobject.ReaderInfo.EnterOutLog.ReadingRoomName, clientobject.ReaderInfo.EnterOutLog.ShortSeatNo), SeatManage.EnumType.HandleResult.Successed);
                        if (clientobject.ReaderInfo.AtReadingRoom.Setting.SeatUsedTimeLimit.Used)
                        {
                            List <SeatManage.EnumType.EnterOutLogType> typeList = new List <SeatManage.EnumType.EnterOutLogType>();
                            typeList.Add(SeatManage.EnumType.EnterOutLogType.BookingConfirmation);
                            typeList.Add(SeatManage.EnumType.EnterOutLogType.SelectSeat);
                            typeList.Add(SeatManage.EnumType.EnterOutLogType.ReselectSeat);
                            typeList.Add(SeatManage.EnumType.EnterOutLogType.WaitingSuccess);
                            typeList.Add(SeatManage.EnumType.EnterOutLogType.ContinuedTime);
                            List <EnterOutLogInfo> seatTimeEnterOutLog = SeatManage.Bll.T_SM_EnterOutLog.GetEnterOutLogByNo(clientobject.ReaderInfo.EnterOutLog.EnterOutLogNo, typeList, 1);
                            if (seatTimeEnterOutLog.Count > 0)
                            {
                                if (seatTimeEnterOutLog[0].EnterOutState == SeatManage.EnumType.EnterOutLogType.ContinuedTime)
                                {
                                    if (seatTimeEnterOutLog[0].EnterOutTime.AddMinutes(clientobject.ReaderInfo.AtReadingRoom.Setting.SeatUsedTimeLimit.DelayTimeLength) < ServiceDateTime.Now)
                                    {
                                        if (clientobject.ReaderInfo.AtReadingRoom.Setting.SeatUsedTimeLimit.ContinuedTimes == 0 || clientobject.ReaderInfo.ContinuedTimeCount < clientobject.ReaderInfo.AtReadingRoom.Setting.SeatUsedTimeLimit.ContinuedTimes)
                                        {
                                            clientobject.ReaderInfo.EnterOutLog.EnterOutState = SeatManage.EnumType.EnterOutLogType.ContinuedTime;
                                            clientobject.ReaderInfo.EnterOutLog.TerminalNum   = clientobject.ClientSetting.ClientNo;
                                            clientobject.ReaderInfo.EnterOutLog.Remark        = string.Format("在{0}刷卡暂离回来,暂离期间在座超时,系统自动延长{1},{2}号座位使用时间", clientType, clientobject.ReaderInfo.AtReadingRoom.Name, clientobject.ReaderInfo.EnterOutLog.ShortSeatNo);
                                            result = EnterOutOperate.AddEnterOutLog(clientobject.ReaderInfo.EnterOutLog, ref newLogId);//插入进出记录
                                            if (result == SeatManage.EnumType.HandleResult.Successed)
                                            {
                                                HandleResult(string.Format("    暂离期间在座超时,系统自动延长{0},{1}号座位使用时间。", clientobject.ReaderInfo.EnterOutLog.ReadingRoomName, clientobject.ReaderInfo.EnterOutLog.ShortSeatNo), SeatManage.EnumType.HandleResult.Successed);
                                            }
                                            else
                                            {
                                                //TODO:错误提示
                                            }
                                        }
                                        else
                                        {
                                            clientobject.ReaderInfo.EnterOutLog.EnterOutState = SeatManage.EnumType.EnterOutLogType.Leave;
                                            clientobject.ReaderInfo.EnterOutLog.TerminalNum   = clientobject.ClientSetting.ClientNo;
                                            clientobject.ReaderInfo.EnterOutLog.Remark        = string.Format("在{0}刷卡暂离回来,暂离期间在座超时,续时次数已用完,系统自动释放{1},{2}号座位", clientType, clientobject.ReaderInfo.AtReadingRoom.Name, clientobject.ReaderInfo.EnterOutLog.ShortSeatNo);
                                            result = EnterOutOperate.AddEnterOutLog(clientobject.ReaderInfo.EnterOutLog, ref newLogId);//插入进出记录
                                            if (result == SeatManage.EnumType.HandleResult.Successed)
                                            {
                                                HandleResult(string.Format("    暂离期间在座超时,续时次数已用完,系统自动释放{0},{1}号座位。", clientobject.ReaderInfo.EnterOutLog.ReadingRoomName, clientobject.ReaderInfo.EnterOutLog.ShortSeatNo), SeatManage.EnumType.HandleResult.Successed);
                                            }
                                            else
                                            {
                                                //TODO:错误提示
                                            }
                                        }
                                    }
                                }
                                else
                                {
                                    if (seatTimeEnterOutLog[0].EnterOutTime.AddMinutes(clientobject.ReaderInfo.AtReadingRoom.Setting.SeatUsedTimeLimit.UsedTimeLength) < ServiceDateTime.Now)
                                    {
                                        if (clientobject.ReaderInfo.AtReadingRoom.Setting.SeatUsedTimeLimit.IsCanContinuedTime)
                                        {
                                            if (clientobject.ReaderInfo.AtReadingRoom.Setting.SeatUsedTimeLimit.ContinuedTimes == 0 || clientobject.ReaderInfo.ContinuedTimeCount < clientobject.ReaderInfo.AtReadingRoom.Setting.SeatUsedTimeLimit.ContinuedTimes)
                                            {
                                                clientobject.ReaderInfo.EnterOutLog.EnterOutState = SeatManage.EnumType.EnterOutLogType.ContinuedTime;
                                                clientobject.ReaderInfo.EnterOutLog.TerminalNum   = clientobject.ClientSetting.ClientNo;
                                                clientobject.ReaderInfo.EnterOutLog.Remark        = string.Format("在{0}刷卡暂离回来,暂离期间在座超时,系统自动延长{1},{2}号座位使用时间", clientType, clientobject.ReaderInfo.AtReadingRoom.Name, clientobject.ReaderInfo.EnterOutLog.ShortSeatNo);
                                                result = EnterOutOperate.AddEnterOutLog(clientobject.ReaderInfo.EnterOutLog, ref newLogId);//插入进出记录
                                                if (result == SeatManage.EnumType.HandleResult.Successed)
                                                {
                                                    HandleResult(string.Format("    暂离期间在座超时,系统自动延长{0},{1}号座位使用时间。", clientobject.ReaderInfo.EnterOutLog.ReadingRoomName, clientobject.ReaderInfo.EnterOutLog.ShortSeatNo), SeatManage.EnumType.HandleResult.Successed);
                                                }
                                                else
                                                {
                                                    //TODO:错误提示
                                                }
                                            }
                                            else
                                            {
                                                clientobject.ReaderInfo.EnterOutLog.EnterOutState = SeatManage.EnumType.EnterOutLogType.Leave;
                                                clientobject.ReaderInfo.EnterOutLog.TerminalNum   = clientobject.ClientSetting.ClientNo;
                                                clientobject.ReaderInfo.EnterOutLog.Remark        = string.Format("在{0}刷卡暂离回来,暂离期间在座超时,续时次数已用完,系统自动释放{1},{2}号座位", clientType, clientobject.ReaderInfo.AtReadingRoom.Name, clientobject.ReaderInfo.EnterOutLog.ShortSeatNo);
                                                result = EnterOutOperate.AddEnterOutLog(clientobject.ReaderInfo.EnterOutLog, ref newLogId);//插入进出记录
                                                if (result == SeatManage.EnumType.HandleResult.Successed)
                                                {
                                                    HandleResult(string.Format("    暂离期间在座超时,续时次数已用完,系统自动释放{0},{1}号座位。", clientobject.ReaderInfo.EnterOutLog.ReadingRoomName, clientobject.ReaderInfo.EnterOutLog.ShortSeatNo), SeatManage.EnumType.HandleResult.Successed);
                                                }
                                                else
                                                {
                                                    //TODO:错误提示
                                                }
                                            }
                                        }
                                        else
                                        {
                                            clientobject.ReaderInfo.EnterOutLog.EnterOutState = SeatManage.EnumType.EnterOutLogType.Leave;
                                            clientobject.ReaderInfo.EnterOutLog.TerminalNum   = clientobject.ClientSetting.ClientNo;
                                            clientobject.ReaderInfo.EnterOutLog.Remark        = string.Format("在{0}刷卡暂离回来,暂离期间在座超时,系统自动释放{1},{2}号座位", clientType, clientobject.ReaderInfo.AtReadingRoom.Name, clientobject.ReaderInfo.EnterOutLog.ShortSeatNo);
                                            result = EnterOutOperate.AddEnterOutLog(clientobject.ReaderInfo.EnterOutLog, ref newLogId);//插入进出记录
                                            if (result == SeatManage.EnumType.HandleResult.Successed)
                                            {
                                                HandleResult(string.Format("    暂离期间在座超时,系统自动释放{0},{1}号座位。", clientobject.ReaderInfo.EnterOutLog.ReadingRoomName, clientobject.ReaderInfo.EnterOutLog.ShortSeatNo), SeatManage.EnumType.HandleResult.Successed);
                                            }
                                            else
                                            {
                                                //TODO:错误提示
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                else
                {
                    if (HandleResult != null)
                    {
                        HandleResult("操作失败!", SeatManage.EnumType.HandleResult.Failed);
                    }
                }
            }
            catch (Exception ex)
            {
                SeatManage.SeatManageComm.WriteLog.Write(string.Format("读者{0}暂离回来操作失败:{1}", clientobject.ReaderInfo.CardNo, ex.Message));
                if (HandleResult != null)
                {
                    HandleResult("操作失败!", SeatManage.EnumType.HandleResult.Failed);
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["LoginId"] == null)
            {
                Response.Redirect("../Login.aspx");
            }
            if (!IsPostBack)
            {
                BindReadingRoomList(Session[CookiesManager.LoginID].ToString());
                GetSeatList(selectReadingRomm.Items[selectReadingRomm.SelectedIndex].Value, selectSeatState.Items[selectSeatState.SelectedIndex].Value);
            }

            cmd = Request.Form["subCmd"];
            if (cmd != null)
            {
                #region 座位相关操作
                switch (cmd)
                {
                case "search":    //查询座位
                    try
                    {
                        GetSeatList(selectReadingRomm.Items[selectReadingRomm.SelectedIndex].Value, selectSeatState.Items[selectSeatState.SelectedIndex].Value);
                    }
                    catch
                    {
                    }
                    break;

                case "ShortLeave":    //设置暂离
                    try
                    {
                        string   seatStr = hidSeatNo.Value;
                        string[] noArr   = seatStr.Split(',');
                        string   seatNo  = "";
                        for (int i = 0; i < noArr.Length; i++)
                        {
                            seatNo = noArr[i].Trim();
                            SeatManage.ClassModel.EnterOutLogInfo enterOutLog = SeatManage.Bll.T_SM_EnterOutLog.GetUsingEnterOutLogBySeatNo(seatNo);
                            if (enterOutLog != null && enterOutLog.EnterOutState != SeatManage.EnumType.EnterOutLogType.ShortLeave)
                            {
                                SeatManage.ClassModel.ReadingRoomInfo roomInfo = SeatManage.Bll.T_SM_ReadingRoom.GetSingleRoomInfo(enterOutLog.ReadingRoomNo);
                                enterOutLog.EnterOutState = SeatManage.EnumType.EnterOutLogType.ShortLeave;
                                enterOutLog.Flag          = SeatManage.EnumType.Operation.Admin;
                                enterOutLog.Remark        = string.Format("在{0},{1}号座位,被管理员{2},通过手持设备设置为暂离", roomInfo.Name, enterOutLog.ShortSeatNo, Session["LoginID"].ToString());
                                int newId = -1;
                                SeatManage.EnumType.HandleResult result = SeatManage.Bll.EnterOutOperate.AddEnterOutLog(enterOutLog, ref newId);
                                if (result == SeatManage.EnumType.HandleResult.Successed)
                                {
                                    Page.RegisterStartupScript("", "<script>alert('设置读者暂离成功');</script>");
                                    GetSeatList(selectReadingRomm.Items[selectReadingRomm.SelectedIndex].Value, selectSeatState.Items[selectSeatState.SelectedIndex].Value);
                                }
                                else
                                {
                                    Page.RegisterStartupScript("", "<script>alert('设置读者暂离失败');</script>");
                                }
                            }
                        }
                    }
                    catch
                    {
                    }
                    break;

                case "ReleaseShortLeave":    //取消暂离
                    try
                    {
                        string   seatStr = hidSeatNo.Value;
                        string[] noArr   = seatStr.Split(',');
                        string   seatNo  = "";
                        for (int i = 0; i < noArr.Length; i++)
                        {
                            seatNo = noArr[i].Trim();
                            SeatManage.ClassModel.EnterOutLogInfo enterOutLog = SeatManage.Bll.T_SM_EnterOutLog.GetUsingEnterOutLogBySeatNo(seatNo);
                            if (enterOutLog != null && enterOutLog.EnterOutState == SeatManage.EnumType.EnterOutLogType.ShortLeave)
                            {
                                SeatManage.ClassModel.ReadingRoomInfo roomInfo = SeatManage.Bll.T_SM_ReadingRoom.GetSingleRoomInfo(enterOutLog.ReadingRoomNo);
                                enterOutLog.EnterOutState = SeatManage.EnumType.EnterOutLogType.ComeBack;
                                enterOutLog.Flag          = SeatManage.EnumType.Operation.Admin;
                                enterOutLog.Remark        = string.Format("在{0},{1}号座位,被管理员{2},通过手持设备取消暂离,恢复为在座", roomInfo.Name, enterOutLog.ShortSeatNo, Session["LoginID"].ToString());
                                int newId = -1;
                                SeatManage.EnumType.HandleResult result = SeatManage.Bll.EnterOutOperate.AddEnterOutLog(enterOutLog, ref newId);
                                if (result == SeatManage.EnumType.HandleResult.Successed)
                                {
                                    List <SeatManage.ClassModel.WaitSeatLogInfo> waitSeatLogs = SeatManage.Bll.T_SM_SeatWaiting.GetWaitSeatList("", enterOutLog.EnterOutLogID, null, null, null);
                                    SeatManage.ClassModel.WaitSeatLogInfo        waitSeatLog  = null;
                                    if (waitSeatLogs.Count > 0)
                                    {
                                        waitSeatLog              = waitSeatLogs[0];
                                        waitSeatLog.NowState     = SeatManage.EnumType.LogStatus.Fail;
                                        waitSeatLog.OperateType  = SeatManage.EnumType.Operation.OtherReader;
                                        waitSeatLog.WaitingState = SeatManage.EnumType.EnterOutLogType.WaitingCancel;
                                        if (SeatManage.Bll.T_SM_SeatWaiting.UpdateWaitLog(waitSeatLog))
                                        {
                                            Page.RegisterStartupScript("", "<script>alert('取消读者暂离成功');</script>");
                                            GetSeatList(selectReadingRomm.Items[selectReadingRomm.SelectedIndex].Value, selectSeatState.Items[selectSeatState.SelectedIndex].Value);
                                        }
                                        else
                                        {
                                            Page.RegisterStartupScript("", "<script>alert('取消读者暂离成功,取消读者等待失败');</script>");
                                            GetSeatList(selectReadingRomm.Items[selectReadingRomm.SelectedIndex].Value, selectSeatState.Items[selectSeatState.SelectedIndex].Value);
                                        }
                                    }
                                    else
                                    {
                                        Page.RegisterStartupScript("", "<script>alert('取消读者暂离成功');</script>");
                                        GetSeatList(selectReadingRomm.Items[selectReadingRomm.SelectedIndex].Value, selectSeatState.Items[selectSeatState.SelectedIndex].Value);
                                    }
                                }
                                else
                                {
                                    Page.RegisterStartupScript("", "<script>alert('取消读者暂离失败');</script>");
                                }
                            }
                        }
                    }
                    catch
                    {
                    }
                    break;

                case "Release":    //释放座位
                    try
                    {
                        string   seatStr = hidSeatNo.Value;
                        string[] noArr   = seatStr.Split(',');
                        string   seatNo  = "";
                        for (int i = 0; i < noArr.Length; i++)
                        {
                            seatNo = noArr[i].Trim();
                            SeatManage.ClassModel.EnterOutLogInfo enterOutLog = SeatManage.Bll.T_SM_EnterOutLog.GetUsingEnterOutLogBySeatNo(seatNo);
                            if (enterOutLog != null && enterOutLog.EnterOutState != SeatManage.EnumType.EnterOutLogType.Leave)
                            {
                                SeatManage.ClassModel.ReadingRoomInfo roomInfo = SeatManage.Bll.T_SM_ReadingRoom.GetSingleRoomInfo(enterOutLog.ReadingRoomNo);

                                enterOutLog.EnterOutState = SeatManage.EnumType.EnterOutLogType.Leave;
                                enterOutLog.Flag          = SeatManage.EnumType.Operation.Admin;
                                enterOutLog.Remark        = string.Format("在{0},{1}号座位,被管理员{2},通过手持设备设置离开", roomInfo.Name, enterOutLog.ShortSeatNo, Session["LoginID"].ToString());
                                int newId = -1;
                                SeatManage.EnumType.HandleResult result = SeatManage.Bll.EnterOutOperate.AddEnterOutLog(enterOutLog, ref newId);
                                if (result == SeatManage.EnumType.HandleResult.Successed)
                                {
                                    SeatManage.ClassModel.RegulationRulesSetting rulesSet = SeatManage.Bll.T_SM_SystemSet.GetRegulationRulesSetting();
                                    if (roomInfo.Setting.IsRecordViolate)
                                    {
                                        if (roomInfo.Setting.BlackListSetting.Used)
                                        {
                                            if (roomInfo.Setting.BlackListSetting.ViolateRoule[SeatManage.EnumType.ViolationRecordsType.LeaveByAdmin])
                                            {
                                                SeatManage.ClassModel.ViolationRecordsLogInfo violationRecords = new SeatManage.ClassModel.ViolationRecordsLogInfo();
                                                violationRecords.CardNo        = enterOutLog.CardNo;
                                                violationRecords.SeatID        = enterOutLog.SeatNo.Substring(enterOutLog.SeatNo.Length - roomInfo.Setting.SeatNumAmount, roomInfo.Setting.SeatNumAmount);
                                                violationRecords.ReadingRoomID = enterOutLog.ReadingRoomNo;
                                                violationRecords.EnterOutTime  = SeatManage.Bll.ServiceDateTime.Now.ToString();
                                                violationRecords.EnterFlag     = SeatManage.EnumType.ViolationRecordsType.LeaveByAdmin;
                                                violationRecords.Remark        = string.Format("在{0},{1}号座位,被管理员{2},通过手持设备设置离开", roomInfo.Name, enterOutLog.ShortSeatNo, Session["LoginID"].ToString());
                                                violationRecords.BlacklistID   = "-1";
                                                SeatManage.Bll.T_SM_ViolateDiscipline.AddViolationRecords(violationRecords);
                                            }
                                        }
                                        else if (rulesSet.BlacklistSet.Used && rulesSet.BlacklistSet.ViolateRoule[SeatManage.EnumType.ViolationRecordsType.LeaveByAdmin])
                                        {
                                            SeatManage.ClassModel.ViolationRecordsLogInfo violationRecords = new SeatManage.ClassModel.ViolationRecordsLogInfo();
                                            violationRecords.CardNo        = enterOutLog.CardNo;
                                            violationRecords.SeatID        = enterOutLog.SeatNo.Substring(enterOutLog.SeatNo.Length - roomInfo.Setting.SeatNumAmount, roomInfo.Setting.SeatNumAmount);
                                            violationRecords.ReadingRoomID = enterOutLog.ReadingRoomNo;
                                            violationRecords.EnterOutTime  = SeatManage.Bll.ServiceDateTime.Now.ToString();
                                            violationRecords.EnterFlag     = SeatManage.EnumType.ViolationRecordsType.LeaveByAdmin;
                                            violationRecords.Remark        = string.Format("在{0},{1}号座位,被管理员{2},通过手持设备设置离开", roomInfo.Name, enterOutLog.ShortSeatNo, Session["LoginID"].ToString());
                                            violationRecords.BlacklistID   = "-1";
                                            SeatManage.Bll.T_SM_ViolateDiscipline.AddViolationRecords(violationRecords);
                                        }
                                    }
                                    Page.RegisterStartupScript("", "<script>alert('设置读者离开成功');</script>");
                                    GetSeatList(selectReadingRomm.Items[selectReadingRomm.SelectedIndex].Value, selectSeatState.Items[selectSeatState.SelectedIndex].Value);
                                }
                                else
                                {
                                    Page.RegisterStartupScript("", "<script>alert('设置读者离开失败');</script>");
                                }
                            }
                        }
                    }
                    catch
                    {
                    }
                    break;

                case "onTime":    //计时
                    try
                    {
                        string   seatStr = hidSeatNo.Value;
                        string[] noArr   = seatStr.Split(',');
                        string   seatNo  = "";
                        for (int i = 0; i < noArr.Length; i++)
                        {
                            seatNo = noArr[i].Trim();
                            SeatManage.ClassModel.EnterOutLogInfo enterOutLog = SeatManage.Bll.T_SM_EnterOutLog.GetUsingEnterOutLogBySeatNo(seatNo);
                            if (enterOutLog != null && enterOutLog.EnterOutState != SeatManage.EnumType.EnterOutLogType.ShortLeave)
                            {
                                DateTime markTime = SeatManage.Bll.ServiceDateTime.Now;
                                SeatManage.Bll.EnterOutOperate.UpdateMarkTime(enterOutLog.EnterOutLogID, markTime);
                                GetSeatList(selectReadingRomm.Items[selectReadingRomm.SelectedIndex].Value, selectSeatState.Items[selectSeatState.SelectedIndex].Value);
                            }
                        }
                    }
                    catch
                    {
                    }

                    break;

                case "offTime":    //取消计时
                    try
                    {
                        string   seatStr = hidSeatNo.Value;
                        string[] noArr   = seatStr.Split(',');
                        string   seatNo  = "";
                        for (int i = 0; i < noArr.Length; i++)
                        {
                            seatNo = noArr[i].Trim();
                            SeatManage.ClassModel.EnterOutLogInfo enterOutLog = SeatManage.Bll.T_SM_EnterOutLog.GetUsingEnterOutLogBySeatNo(seatNo);
                            if (enterOutLog != null && !string.IsNullOrEmpty(enterOutLog.MarkTime.ToString()) && enterOutLog.MarkTime.CompareTo(DateTime.Parse("1900/1/1")) != 0)
                            {
                                DateTime markTime = DateTime.Parse("1900-1-1");
                                SeatManage.Bll.EnterOutOperate.UpdateMarkTime(enterOutLog.EnterOutLogID, markTime);
                                GetSeatList(selectReadingRomm.Items[selectReadingRomm.SelectedIndex].Value, selectSeatState.Items[selectSeatState.SelectedIndex].Value);
                            }
                        }
                    }
                    catch
                    {
                    }

                    break;

                case "AddBlacklist":
                    try
                    {
                        string   seatStr = hidSeatNo.Value;
                        string[] noArr   = seatStr.Split(',');
                        string   seatNo  = "";
                        int      newId   = -1;
                        SeatManage.ClassModel.RegulationRulesSetting rulesSet = SeatManage.Bll.T_SM_SystemSet.GetRegulationRulesSetting();
                        for (int i = 0; i < noArr.Length; i++)
                        {
                            newId  = -1;
                            seatNo = noArr[i].Trim();
                            SeatManage.ClassModel.EnterOutLogInfo enterOutLog = SeatManage.Bll.T_SM_EnterOutLog.GetUsingEnterOutLogBySeatNo(seatNo);
                            if (enterOutLog != null && enterOutLog.EnterOutState != SeatManage.EnumType.EnterOutLogType.Leave)
                            {
                                SeatManage.ClassModel.ReadingRoomInfo roomInfo = SeatManage.Bll.T_SM_ReadingRoom.GetSingleRoomInfo(enterOutLog.ReadingRoomNo);
                                if (roomInfo != null && roomInfo.Setting.BlackListSetting.Used)
                                {
                                    SeatManage.ClassModel.BlackListInfo blacklistModel = new SeatManage.ClassModel.BlackListInfo();
                                    blacklistModel.AddTime          = SeatManage.Bll.ServiceDateTime.Now;
                                    blacklistModel.ReadingRoomID    = roomInfo.No;
                                    blacklistModel.BlacklistState   = SeatManage.EnumType.LogStatus.Valid;
                                    blacklistModel.CardNo           = enterOutLog.CardNo;
                                    blacklistModel.OutBlacklistMode = roomInfo.Setting.BlackListSetting.LeaveBlacklist;
                                    if (blacklistModel.OutBlacklistMode == SeatManage.EnumType.LeaveBlacklistMode.AutomaticMode)
                                    {
                                        blacklistModel.ReMark  = string.Format("管理员{0}通过手持设备{0}把读者加入黑名单,记录黑名单{1}天", Session["LoginID"].ToString(), roomInfo.Setting.BlackListSetting.LimitDays);
                                        blacklistModel.OutTime = blacklistModel.AddTime.AddDays(roomInfo.Setting.BlackListSetting.LimitDays);
                                    }
                                    else
                                    {
                                        blacklistModel.ReMark = string.Format("管理员{0}通过手持设备把读者加入黑名单,手动离开黑名单", Session["LoginID"].ToString());
                                    }
                                    blacklistModel.ReadingRoomID = roomInfo.No;
                                    newId = SeatManage.Bll.T_SM_Blacklist.AddBlackList(blacklistModel);
                                }
                                else if (rulesSet.BlacklistSet.Used)
                                {
                                    SeatManage.ClassModel.BlackListInfo blacklistModel = new SeatManage.ClassModel.BlackListInfo();
                                    blacklistModel.AddTime          = SeatManage.Bll.ServiceDateTime.Now;
                                    blacklistModel.OutTime          = blacklistModel.AddTime.AddDays(rulesSet.BlacklistSet.LimitDays);
                                    blacklistModel.BlacklistState   = SeatManage.EnumType.LogStatus.Valid;
                                    blacklistModel.CardNo           = enterOutLog.CardNo;
                                    blacklistModel.OutBlacklistMode = rulesSet.BlacklistSet.LeaveBlacklist;
                                    if (blacklistModel.OutBlacklistMode == SeatManage.EnumType.LeaveBlacklistMode.AutomaticMode)
                                    {
                                        blacklistModel.ReMark  = string.Format("管理员{0}通过手持设备把读者加入黑名单,记录黑名单{1}天", Session["LoginID"].ToString(), rulesSet.BlacklistSet.LimitDays);
                                        blacklistModel.OutTime = blacklistModel.AddTime.AddDays(rulesSet.BlacklistSet.LimitDays);
                                    }
                                    else
                                    {
                                        blacklistModel.ReMark = string.Format("管理员{0}通过手持设备把读者加入黑名单,手动离开黑名单", Session["LoginID"].ToString());
                                    }
                                    blacklistModel.ReadingRoomID = roomInfo.No;
                                    newId = SeatManage.Bll.T_SM_Blacklist.AddBlackList(blacklistModel);
                                }
                                else
                                {
                                    Page.RegisterStartupScript("", "<script>alert('对不起,此阅览室以及图书馆没有启用黑名单功能');</script>");
                                    return;
                                }
                                if (newId > 0)
                                {
                                    enterOutLog.EnterOutState = SeatManage.EnumType.EnterOutLogType.Leave;
                                    enterOutLog.Flag          = SeatManage.EnumType.Operation.Admin;
                                    enterOutLog.Remark        = string.Format("在{0},{1}号座位,被管理员{2},通过手持设备设置离开", roomInfo.Name, enterOutLog.ShortSeatNo, Session["LoginID"].ToString());

                                    SeatManage.EnumType.HandleResult result = SeatManage.Bll.EnterOutOperate.AddEnterOutLog(enterOutLog, ref newId);
                                    if (result == SeatManage.EnumType.HandleResult.Successed)
                                    {
                                        Page.RegisterStartupScript("", "<script>alert('设置读者黑名单成功');</script>");
                                        GetSeatList(selectReadingRomm.Items[selectReadingRomm.SelectedIndex].Value, selectSeatState.Items[selectSeatState.SelectedIndex].Value);
                                    }
                                    else
                                    {
                                        Page.RegisterStartupScript("", "<script>alert('设置读者黑名单失败');</script>");
                                    }
                                }
                                else
                                {
                                }
                            }
                        }
                    }
                    catch
                    {
                    }
                    break;

                case "LoginOut":
                    HttpCookie aCookie;
                    string     cookieName;
                    int        limit = Request.Cookies.Count;
                    for (int i = 0; i < limit; i++)
                    {
                        cookieName      = Request.Cookies[i].Name;
                        aCookie         = new HttpCookie(cookieName);
                        aCookie.Expires = DateTime.Now.AddDays(-1);
                        Response.Cookies.Add(aCookie);
                    }
                    Response.Redirect("../Login.aspx");
                    break;
                }
                #endregion
            }
        }
 /// <summary>
 /// 窗口关闭时间
 /// </summary>
 /// <param name="e"></param>
 void ViewModel_WindowClose(SeatManage.EnumType.HandleResult e)
 {
     viewModel.OperateResule = e;
     this.Close();
 }
        protected void btnSureAllotSeat_Click(object sender, EventArgs e)
        {
            SeatManage.ClassModel.Seat            seat     = SeatManage.Bll.T_SM_Seat.GetSeatInfoBySeatNo(seatNo);
            SeatManage.ClassModel.ReadingRoomInfo roomInfo = SeatManage.Bll.T_SM_ReadingRoom.GetSingleRoomInfo(seat.ReadingRoomNum);
            if (seat == null)
            {
                FineUI.Alert.ShowInTop("座位号错误,没有找到座位的相关信息");
                return;
            }
            //判断当前座位上是否有读者在座。
            SeatManage.ClassModel.EnterOutLogInfo enterOutLogByseatNo = SeatManage.Bll.T_SM_EnterOutLog.GetUsingEnterOutLogBySeatNo(seatNo);
            if (enterOutLogByseatNo != null && enterOutLogByseatNo.EnterOutState != SeatManage.EnumType.EnterOutLogType.Leave)
            {
                FineUI.Alert.ShowInTop("座位已经被其他读者选择");
                return;
            }
            //判断读者是否有座位
            string strCardNo = txtCardNo1.Text;
            List <SeatManage.ClassModel.BlackListInfo> blacklistInfoByCardNo = SeatManage.Bll.T_SM_Blacklist.GetBlackListInfo(strCardNo);

            SeatManage.ClassModel.RegulationRulesSetting rulesSet = SeatManage.Bll.T_SM_SystemSet.GetRegulationRulesSetting();
            if (roomInfo.Setting.UsedBlacklistLimit && blacklistInfoByCardNo.Count > 0)
            {
                if (roomInfo.Setting.BlackListSetting.Used)
                {
                    bool isblack = false;
                    foreach (SeatManage.ClassModel.BlackListInfo blinfo in blacklistInfoByCardNo)
                    {
                        if (blinfo.ReadingRoomID == roomInfo.No)
                        {
                            isblack = true;
                            break;
                        }
                    }
                    if (isblack)
                    {
                        FineUI.Alert.ShowInTop("该读者已进入黑名单,不能在该阅览室为其分配座位");
                        return;
                    }
                }
                else
                {
                    FineUI.Alert.ShowInTop("该读者已进入黑名单,不能在该阅览室为其分配座位");
                    return;
                }
            }
            SeatManage.ClassModel.EnterOutLogInfo enterOutLogByCardNo = SeatManage.Bll.T_SM_EnterOutLog.GetEnterOutLogInfoByCardNo(strCardNo);
            if (enterOutLogByCardNo != null && enterOutLogByCardNo.EnterOutState != SeatManage.EnumType.EnterOutLogType.Leave)
            {
                FineUI.Alert.ShowInTop(string.Format("读者已经在{0},{1}号座位就做", enterOutLogByCardNo.ReadingRoomName, enterOutLogByCardNo.ShortSeatNo));
                return;
            }

            SeatManage.ClassModel.EnterOutLogInfo enterOutLogModel = new SeatManage.ClassModel.EnterOutLogInfo();
            enterOutLogModel.CardNo        = strCardNo;
            enterOutLogModel.EnterOutLogNo = SeatManage.SeatManageComm.SeatComm.RndNum();
            enterOutLogModel.EnterOutState = SeatManage.EnumType.EnterOutLogType.SelectSeat;
            enterOutLogModel.EnterOutTime  = SeatManage.Bll.ServiceDateTime.Now;
            enterOutLogModel.EnterOutType  = SeatManage.EnumType.LogStatus.Valid;
            enterOutLogModel.Flag          = SeatManage.EnumType.Operation.Admin;
            enterOutLogModel.ReadingRoomNo = seat.ReadingRoomNum;
            enterOutLogModel.Remark        = string.Format("在后台管理网站被管理员{0},分配{1},{2}座位", this.LoginId, roomInfo.Name, seat.SeatNo.Substring(seat.SeatNo.Length - roomInfo.Setting.SeatNumAmount));
            enterOutLogModel.SeatNo        = seatNo;
            int newId = -1;

            SeatManage.EnumType.HandleResult result = SeatManage.Bll.EnterOutOperate.AddEnterOutLog(enterOutLogModel, ref newId);
            if (result == SeatManage.EnumType.HandleResult.Successed)
            {
                FineUI.Alert.ShowInTop("分配座位成功", "成功");
                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
            }
            else
            {
                FineUI.Alert.ShowInTop("分配座位失败", "失败");
            }
        }
        protected void btn_SureAddBlacklist(object sender, EventArgs e)
        {
            SeatManage.ClassModel.Seat seat = SeatManage.Bll.T_SM_Seat.GetSeatInfoBySeatNo(seatNo);
            SeatManage.ClassModel.RegulationRulesSetting rulesSet     = SeatManage.Bll.T_SM_SystemSet.GetRegulationRulesSetting();
            SeatManage.ClassModel.BlacklistSetting       blacklistSet = rulesSet.BlacklistSet;
            SeatManage.ClassModel.ReadingRoomInfo        readingroom  = SeatManage.Bll.T_SM_ReadingRoom.GetSingleRoomInfo(seat.ReadingRoomNum);
            int i = -1;

            if (readingroom != null && readingroom.Setting.BlackListSetting.Used)
            {
                SeatManage.ClassModel.BlackListInfo blacklistModel = new SeatManage.ClassModel.BlackListInfo();
                blacklistModel.AddTime          = SeatManage.Bll.ServiceDateTime.Now;
                blacklistModel.ReadingRoomID    = readingroom.No;
                blacklistModel.BlacklistState   = SeatManage.EnumType.LogStatus.Valid;
                blacklistModel.CardNo           = txtCardNo.Text;
                blacklistModel.OutBlacklistMode = readingroom.Setting.BlackListSetting.LeaveBlacklist;
                if (blacklistModel.OutBlacklistMode == SeatManage.EnumType.LeaveBlacklistMode.AutomaticMode)
                {
                    blacklistModel.ReMark  = string.Format("管理员{0}把读者加入黑名单,记录黑名单{1}天,备注:{2}", this.LoginId, readingroom.Setting.BlackListSetting.LimitDays, txtRemark.Text);
                    blacklistModel.OutTime = blacklistModel.AddTime.AddDays(readingroom.Setting.BlackListSetting.LimitDays);
                }
                else
                {
                    blacklistModel.ReMark = string.Format("管理员{0}把读者加入黑名单,手动离开黑名单,备注:{1}", this.LoginId, txtRemark.Text);
                }
                blacklistModel.ReadingRoomID = seat.ReadingRoomNum;
                i = SeatManage.Bll.T_SM_Blacklist.AddBlackList(blacklistModel);
                SeatManage.ClassModel.ReaderNoticeInfo blackRni = new SeatManage.ClassModel.ReaderNoticeInfo();
                blackRni.IsRead = SeatManage.EnumType.LogStatus.Valid;
                blackRni.CardNo = txtCardNo.Text;
                blackRni.Note   = string.Format("{0}", blacklistModel.ReMark);
                SeatManage.Bll.T_SM_ReaderNotice.AddReaderNotice(blackRni);
            }
            else if (blacklistSet.Used)
            {
                SeatManage.ClassModel.BlackListInfo blacklistModel = new SeatManage.ClassModel.BlackListInfo();
                blacklistModel.AddTime          = SeatManage.Bll.ServiceDateTime.Now;
                blacklistModel.OutTime          = blacklistModel.AddTime.AddDays(blacklistSet.LimitDays);
                blacklistModel.BlacklistState   = SeatManage.EnumType.LogStatus.Valid;
                blacklistModel.CardNo           = txtCardNo.Text;
                blacklistModel.OutBlacklistMode = blacklistSet.LeaveBlacklist;
                if (blacklistModel.OutBlacklistMode == SeatManage.EnumType.LeaveBlacklistMode.AutomaticMode)
                {
                    blacklistModel.ReMark  = string.Format("管理员{0}把读者加入黑名单,记录黑名单{1}天,备注:{2}", this.LoginId, blacklistSet.LimitDays, txtRemark.Text);
                    blacklistModel.OutTime = blacklistModel.AddTime.AddDays(blacklistSet.LimitDays);
                }
                else
                {
                    blacklistModel.ReMark = string.Format("管理员{0}把读者加入黑名单,手动离开黑名单,备注:{1}", this.LoginId, txtRemark.Text);
                }
                blacklistModel.ReadingRoomID = seat.ReadingRoomNum;
                i = SeatManage.Bll.T_SM_Blacklist.AddBlackList(blacklistModel);
                SeatManage.ClassModel.ReaderNoticeInfo blackRni = new SeatManage.ClassModel.ReaderNoticeInfo();
                blackRni.IsRead = SeatManage.EnumType.LogStatus.Valid;
                blackRni.CardNo = txtCardNo.Text;
                blackRni.Note   = string.Format("{0}", blacklistModel.ReMark);
                SeatManage.Bll.T_SM_ReaderNotice.AddReaderNotice(blackRni);
            }
            else
            {
                FineUI.Alert.ShowInTop("对不起,此阅览室以及图书馆没有启用黑名单功能", "失败");
                return;
            }
            if (i > 0)
            {
                SeatManage.ClassModel.EnterOutLogInfo enterOutLogModel = SeatManage.Bll.T_SM_EnterOutLog.GetEnterOutLogInfoByCardNo(txtCardNo.Text);
                enterOutLogModel.EnterOutState = SeatManage.EnumType.EnterOutLogType.Leave;
                enterOutLogModel.Flag          = SeatManage.EnumType.Operation.Admin;
                enterOutLogModel.Remark        = string.Format("在{0},{1}号座位,被管理员{2},在后台管理网站加入黑名单并释放座位", enterOutLogModel.ReadingRoomName, enterOutLogModel.ShortSeatNo, this.LoginId);
                SeatManage.EnumType.HandleResult result = SeatManage.Bll.EnterOutOperate.AddEnterOutLog(enterOutLogModel, ref i);
                if (result == SeatManage.EnumType.HandleResult.Successed)
                {
                    FineUI.Alert.ShowInTop("黑名单添加成功", "成功");
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                }
                else
                {
                    FineUI.Alert.ShowInTop("黑名单添加失败", "失败");
                }
            }
            else
            {
                FineUI.Alert.ShowInTop("黑名单添加失败", "失败");
            }
        }