Ejemplo n.º 1
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(SeatManage.ClassModel.Seat model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into T_SM_Seat(");
            strSql.Append("SeatNo,ReadingRoomNo,IsUsing,SeatUI,IsLock)");
            strSql.Append(" values (");
            strSql.Append("@SeatNo,@ReadingRoomNo,@IsUsing,@SeatUI,@IsLock)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@SeatNo",        SqlDbType.NVarChar, 100),
                new SqlParameter("@ReadingRoomNo", SqlDbType.NVarChar, 100),
                new SqlParameter("@IsUsing",       SqlDbType.Bit),
                new SqlParameter("@SeatUI",        SqlDbType.NVarChar, 100),
                new SqlParameter("@IsLock",        SqlDbType.Int, 4)
            };
            parameters[0].Value = model.SeatNo;
            parameters[1].Value = model.ReadingRoomNum;
            parameters[2].Value = false;
            parameters[3].Value = string.Format("{0},{1}", model.PositionX, model.PositionY);
            parameters[4].Value = false;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            seatNo = Request.QueryString["seatNo"];
            string seatShortNo = Request.QueryString["seatShortNo"];
            string seatUsed    = Request.QueryString["used"];

            if (!IsPostBack)
            {
                if (Request.ServerVariables["HTTP_REFERER"] != null)
                {
                    string url      = Request.ServerVariables["HTTP_REFERER"].Trim();
                    string pageName = SeatManage.SeatManageComm.SeatComm.GetPageName(url);
                    if (pageName != "SeatGraph.aspx" && pageName != "FormSYS.aspx" && pageName != "MonitorListMode.aspx")
                    {
                        WriteLogs(url);
                        Response.Write("请通过正确方式访问网站!");
                        Response.End();
                        return;
                        //PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                    }
                }
                else
                {
                    WriteLogs(HttpContext.Current.Request.Url.AbsoluteUri);
                    Response.Write("请通过正确方式访问网站!");
                    Response.End();
                    return;
                    //PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                }
                BindUIElement(seatNo, seatShortNo, seatUsed);
            }
            SeatManage.ClassModel.Seat seat = SeatManage.Bll.T_SM_Seat.GetSeatInfoBySeatNo(seatNo);
            SeatManage.ClassModel.RegulationRulesSetting rulesSet    = SeatManage.Bll.T_SM_SystemSet.GetRegulationRulesSetting();
            SeatManage.ClassModel.ReadingRoomInfo        readingroom = SeatManage.Bll.T_SM_ReadingRoom.GetSingleRoomInfo(seat.ReadingRoomNum);
            if ((!rulesSet.BlacklistSet.Used) && (!readingroom.Setting.BlackListSetting.Used))
            {
                btnAddBlackList.Enabled = false;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 绑定UI元素
        /// </summary>
        /// <param name="seatNo"></param>
        /// <param name="seatShortNo"></param>GetBespeakLogInfoBySeatNo
        void BindUIElement(string seatNo, string seatShortNo, DateTime date)
        {
            SeatManage.ClassModel.ReadingRoomInfo room           = SeatManage.Bll.T_SM_ReadingRoom.GetSingleRoomInfo(roomNo);
            SeatManage.Bll.T_SM_ReadingRoom       bllReadingRoom = new SeatManage.Bll.T_SM_ReadingRoom();
            if (room.Setting.SeatBespeak.SpecifiedTime && room.Setting.SeatBespeak.CanBookMultiSpan)
            {
                foreach (DateTime dt in timeSpan)
                {
                    if (dt <= date)
                    {
                        continue;
                    }
                    DropDownList_Time.Items.Add(new FineUI.ListItem(dt.ToShortTimeString(), dt.ToShortTimeString()));
                }
            }
            else
            {
                foreach (DateTime dt in room.Setting.SeatBespeak.SpecifiedTimeList)
                {
                    if (dt <= date)
                    {
                        continue;
                    }
                    DropDownList_Time.Items.Add(new FineUI.ListItem(dt.ToShortTimeString(), dt.ToShortTimeString()));
                }
            }
            DateTime minTime = date.AddMinutes(10 - date.Minute % 10);

            while (true)
            {
                minTime = minTime.AddMinutes(10);
                if (minTime.Date > date.Date)
                {
                    break;
                }
                if (Code.NowReadingRoomState.ReadingRoomOpenState(room.Setting.RoomOpenSet, minTime) == SeatManage.EnumType.ReadingRoomStatus.Close)
                {
                    continue;
                }
                DropDownList_FreeTime.Items.Add(new FineUI.ListItem(minTime.ToShortTimeString(), minTime.ToShortTimeString()));
            }
            if (!room.Setting.SeatBespeak.SpecifiedBespeak)
            {
                rblModel.Hidden = true;
            }
            if (rblModel.SelectedValue == "0")
            {
                DropDownList_FreeTime.Hidden = true;
                DropDownList_Time.Hidden     = true;
            }
            else
            {
                if (!room.Setting.SeatBespeak.SpecifiedTime)
                {
                    DropDownList_Time.Hidden     = true;
                    DropDownList_FreeTime.Hidden = false;
                }
                else
                {
                    DropDownList_FreeTime.Hidden = true;
                    DropDownList_Time.Hidden     = false;
                }
            }
            lblbeginDate.Text     = date.ToShortDateString();
            this.lblSeatNo.Text   = seatShortNo;
            this.lblRoomName.Text = room.Name;
            //判断自己是否已经预约座位
            List <SeatManage.EnumType.BookingStatus> bespeakStatus = new List <SeatManage.EnumType.BookingStatus>();

            bespeakStatus.Add(SeatManage.EnumType.BookingStatus.Waiting);
            List <SeatManage.ClassModel.BespeakLogInfo> readerBespeaklist = SeatManage.Bll.T_SM_SeatBespeak.GetBespeakLogInfoByCardNo(this.LoginId, date);//.GetBespeakList(this.LoginId, null, date, 0, bespeakStatus);

            //判断可预约次数是否超过
            readerBespeaklist = SeatManage.Bll.T_SM_SeatBespeak.GetBespeakList(this.LoginId, null, date, 0, new List <SeatManage.EnumType.BookingStatus> {
                SeatManage.EnumType.BookingStatus.Confinmed, SeatManage.EnumType.BookingStatus.Waiting
            });                                                                                                                                                                                                                                     //.GetBespeakList(this.LoginId, null, date, 0, bespeakStatus);
            if (readerBespeaklist.Count >= room.Setting.SeatBespeak.BespeakSeatCount)
            {
                FineUI.Alert.ShowInTop("您一天只能预约" + room.Setting.SeatBespeak.BespeakSeatCount + "次座位。");
                btnBespeak.Enabled = false;
                PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                return;
            }
            if (readerBespeaklist.Find(u => u.BsepeakState == SeatManage.EnumType.BookingStatus.Waiting) != null && (!room.Setting.SeatBespeak.CanBookMultiSpan || !room.Setting.SeatBespeak.SpecifiedTime))
            {
                FineUI.Alert.ShowInTop("您今天已有预约的座位,请先取消原来的预约。");
                btnBespeak.Enabled = false;
                PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                return;
            }


            //判断读者是否有座位
            if (!room.Setting.SeatBespeak.BespeatWithOnSeat)
            {
                SeatManage.ClassModel.EnterOutLogInfo eol = SeatManage.Bll.T_SM_EnterOutLog.GetEnterOutLogInfoByCardNo(this.LoginId);
                if (eol != null && eol.EnterOutState != SeatManage.EnumType.EnterOutLogType.Leave)
                {
                    FineUI.Alert.ShowInTop("您已有座位,不能再预约座位");
                    btnBespeak.Enabled = false;
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                    return;
                }
            }
            //判断操作次数
            if (SeatManage.Bll.EnterOutOperate.CheckReaderChooseSeatTimesByReadingRoom(this.LoginId, room.Setting.PosTimes, room.No))
            {
                FineUI.Alert.ShowInTop("您的选座/预约操作过于频繁,请稍后重试");
                btnBespeak.Enabled = false;
                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                return;
            }
            //判断座位是否被别人使用
            SeatManage.ClassModel.Seat seat = SeatManage.Bll.T_SM_Seat.GetSeatInfoBySeatNo(seatNo);
            if (seat.SeatUsedState != SeatManage.EnumType.EnterOutLogType.Leave)
            {
                FineUI.Alert.ShowInTop("座位已经被别人选择,请预约其他座位");
                btnBespeak.Enabled = false;
                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                return;
            }
            //判断座位是否被预约
            List <SeatManage.ClassModel.BespeakLogInfo> list = SeatManage.Bll.T_SM_SeatBespeak.GetBespeakLogInfoBySeatNo(seatNo, date);

            seatKeepTime.Value   = room.Setting.SeatBespeak.SeatKeepTime.ToString();
            this.lblEndDate.Text = string.Format("{0}至{1}", date.ToShortTimeString(), date.AddMinutes(room.Setting.SeatBespeak.SeatKeepTime).ToShortTimeString());
            for (int i = 0; i < list.Count; i++)
            {
                if (list[i].BsepeakState == SeatManage.EnumType.BookingStatus.Waiting)
                {
                    FineUI.Alert.ShowInTop("座位已经被别人预约,请预约其他座位");
                    btnBespeak.Enabled = false;
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                    return;
                }
            }
            //判断是否已加入黑名单
            List <SeatManage.ClassModel.BlackListInfo> blacklistInfoByCardNo = SeatManage.Bll.T_SM_Blacklist.GetBlackListInfo(this.LoginId);

            SeatManage.ClassModel.RegulationRulesSetting rulesSet = SeatManage.Bll.T_SM_SystemSet.GetRegulationRulesSetting();
            if (room.Setting.UsedBlacklistLimit && blacklistInfoByCardNo.Count > 0)
            {
                if (room.Setting.BlackListSetting.Used)
                {
                    bool isblack = false;
                    foreach (SeatManage.ClassModel.BlackListInfo blinfo in blacklistInfoByCardNo)
                    {
                        if (blinfo.ReadingRoomID == room.No)
                        {
                            isblack = true;
                            break;
                        }
                    }
                    if (isblack)
                    {
                        FineUI.Alert.ShowInTop("你已进入黑名单,不能在该阅览室预约座位");
                        PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                        return;
                    }
                }
                else
                {
                    FineUI.Alert.ShowInTop("你已进入黑名单,不能在该阅览室预约座位");
                    PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                    return;
                }
            }
            if (room.Setting.LimitReaderEnter.Used)
            {
                SeatManage.ClassModel.ReaderInfo readerInfo = SeatManage.Bll.EnterOutOperate.GetReaderInfo(this.LoginId);
                string[] litype = room.Setting.LimitReaderEnter.ReaderTypes.Split(';');
                if (!room.Setting.LimitReaderEnter.CanEnter)
                {
                    foreach (string type in litype)
                    {
                        if (type == readerInfo.ReaderType)
                        {
                            FineUI.Alert.ShowInTop("你的读者类型不能在该阅览室预约座位");
                            PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                            return;
                        }
                    }
                }
                else
                {
                    bool isintype = false;
                    foreach (string type in litype)
                    {
                        if (type == readerInfo.ReaderType)
                        {
                            isintype = true;
                            break;
                        }
                    }
                    if (!isintype)
                    {
                        FineUI.Alert.ShowInTop("你的读者类型不能在该阅览室预约座位");
                        PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
                        return;
                    }
                }
            }

            btnBespeak.Enabled = true;
        }
 /// <summary>
 /// 绑定UI元素
 /// </summary>
 private void BindUIElement(string seatNo, string seatShortNo, string seatUsed)
 {
     if (!string.IsNullOrEmpty(seatNo))
     {
         lblSeatNo.Text = seatShortNo;
         if (seatUsed == "0")
         {
             lblCardNo.Text            = "无";
             lblName.Text              = "无";
             lblSeatStatus.Text        = "空闲";
             lblTimeLength.Text        = "";
             txtSeat.Text              = seatShortNo;
             btnAddBlackList.Enabled   = false;
             btnShortLeave.Enabled     = false;
             btnShortLeave.Text        = "暂离";
             btnShortLeave.ConfirmText = "是否确定把该读者设置为暂离?";
             btnLeave.Enabled          = false;
             btnAllotSeat.Enabled      = true;
         }
         else if (seatUsed == "2")
         {
             List <SeatManage.ClassModel.BespeakLogInfo> list = SeatManage.Bll.T_SM_SeatBespeak.GetBespeakLogInfoBySeatNo(seatNo, SeatManage.Bll.ServiceDateTime.Now);
             if (list == null)
             {
                 FineUI.Alert.ShowInTop("没有获取到相关的座位信息", "错误");
             }
             else
             {
                 txtSeat.Text              = seatShortNo;
                 lblCardNo.Text            = list[0].CardNo;
                 lblName.Text              = list[0].ReaderName;
                 lblSeatStatus.Text        = "已被预约";
                 lblTimeLength.Text        = string.Format("{0:MM月dd日 HH:mm:ss}", list[0].BsepeakTime);
                 btnAddBlackList.Enabled   = false;
                 btnShortLeave.Enabled     = false;
                 btnShortLeave.Text        = "暂离";
                 btnShortLeave.ConfirmText = "是否确定把该读者设置为暂离?";
                 btnLeave.Enabled          = false;
                 btnAllotSeat.Enabled      = false;
             }
         }
         else if (seatUsed == "3")
         {
             FineUI.Alert.ShowInTop("此座位已暂停使用", "提示");
             btnAddBlackList.Enabled   = false;
             btnShortLeave.Enabled     = false;
             btnShortLeave.ConfirmText = "此座位已暂停使用,请重新选择";
             btnLeave.Enabled          = false;
             btnAllotSeat.Enabled      = false;
         }
         else
         {
             SeatManage.ClassModel.Seat seat = SeatManage.Bll.T_SM_Seat.GetSeatInfoBySeatNo(seatNo);
             if (seat == null)
             {
                 FineUI.Alert.ShowInTop("没有获取到相关的座位信息", "错误");
             }
             else
             {
                 if (seat.SeatUsedState == SeatManage.EnumType.EnterOutLogType.Leave)
                 {
                     lblCardNo.Text            = "无";
                     lblName.Text              = "无";
                     lblSeatStatus.Text        = "空闲";
                     lblTimeLength.Text        = "";
                     txtSeat.Text              = seat.ShortSeatNo;
                     btnAddBlackList.Enabled   = false;
                     btnShortLeave.Enabled     = false;
                     btnShortLeave.Text        = "暂离";
                     btnShortLeave.ConfirmText = "是否确定把该读者设置为暂离?";
                     btnLeave.Enabled          = false;
                     btnAllotSeat.Enabled      = true;
                 }
                 else if (seat.SeatUsedState == SeatManage.EnumType.EnterOutLogType.ShortLeave)
                 {
                     txtCardNo.Text            = seat.UserCardNo;
                     txtCardNo1.Text           = seat.UserCardNo;
                     txtReaderName.Text        = seat.UserName;
                     txtSeat.Text              = seat.ShortSeatNo;
                     lblCardNo.Text            = seat.UserCardNo;
                     lblName.Text              = seat.UserName;
                     lblSeatStatus.Text        = SeatManage.SeatManageComm.SeatComm.ConvertReaderState(seat.SeatUsedState);
                     lblTimeLength.Text        = string.Format("{0:MM月dd日 HH:mm:ss}", seat.BeginUsedTime);
                     btnAddBlackList.Enabled   = true;
                     btnShortLeave.Enabled     = true;
                     btnShortLeave.Text        = "取消暂离";
                     btnShortLeave.ConfirmText = "是否取消此读者的暂离状态,并还原为在座状态?";
                     btnLeave.Enabled          = true;
                     btnAllotSeat.Enabled      = false;
                 }
                 else
                 {
                     txtCardNo.Text            = seat.UserCardNo;
                     txtCardNo1.Text           = seat.UserCardNo;
                     txtReaderName.Text        = seat.UserName;
                     txtSeat.Text              = seat.ShortSeatNo;
                     lblCardNo.Text            = seat.UserCardNo;
                     lblName.Text              = seat.UserName;
                     lblSeatStatus.Text        = SeatManage.SeatManageComm.SeatComm.ConvertReaderState(seat.SeatUsedState);
                     lblTimeLength.Text        = string.Format("{0:MM月dd日 HH:mm:ss}", seat.BeginUsedTime);
                     btnAddBlackList.Enabled   = true;
                     btnShortLeave.Enabled     = true;
                     btnShortLeave.Text        = "暂离";
                     btnShortLeave.ConfirmText = "是否确定把该读者设置为暂离?";
                     btnLeave.Enabled          = true;
                     btnAllotSeat.Enabled      = false;
                 }
             }
         }
     }
     else
     {
         FineUI.Alert.ShowInTop("座位号不能为空", "错误");
     }
 }
        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("黑名单添加失败", "失败");
            }
        }
Ejemplo n.º 7
0
 /// <summary>
 /// 获取座位信息
 /// </summary>
 /// <param name="cardNo"></param>
 /// <returns></returns>
 public SeatManage.ClassModel.Seat GetSeatUsedInfoBySeatNo(string cardNo)
 {
     SeatManage.ClassModel.Seat seat = SeatManage.Bll.T_SM_Seat.GetSeatInfoBySeatNo(cardNo);
     return(seat);
 }