/// <summary>
 /// 判断功能是否被授权
 /// </summary>
 /// <param name="functionName"></param>
 /// <returns></returns>
 public bool IsAuthorize(string functionName)
 {
     try
     {
         AuthorizeVerify.FunctionAuthorizeInfo model = GetFunctionAuthorize();
         string schoolNum = GetSchoolNum();
         if (string.IsNullOrEmpty(schoolNum))
         {
             return(false);
         }
         if (schoolNum != model.SchoolNum)
         {
             return(false);
         }
         if (model.SystemFunction.Contains(functionName))
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch
     {
         throw;
     }
 }
        /// <summary>
        /// 保存授权文件
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool SaveFunctionAuthorize(AuthorizeVerify.FunctionAuthorizeInfo model)
        {
            if (model == null)
            {
                return(false);
            }
            string       filePath = string.Format(@"{0}sf_authorized_keys", AppDomain.CurrentDomain.BaseDirectory);
            StreamWriter file     = new StreamWriter(filePath, false, Encoding.ASCII);

            try
            {
                string strJson    = SeatManage.SeatManageComm.JSONSerializer.Serialize(model);
                string ciphertext = SeatManage.SeatManageComm.AESAlgorithm.AESEncrypt(strJson);
                file.WriteLine(ciphertext);
                return(true);
            }
            catch
            {
                throw;
            }
            finally
            {
                file.Flush();
            }
        }
Пример #3
0
 /// <summary>
 /// 数据保存
 /// </summary>
 private void DataBind()
 {
     AuthorizeVerify.FunctionAuthorizeInfo   authorize = SeatManage.Bll.AuthorizationOperation.GetFunctionAuthorize();
     SeatManage.ClassModel.MoveWebAppSetting model     = SeatManage.Bll.T_SM_SystemSet.GetMoveWebAppSetting();
     if (model == null)
     {
         model = new SeatManage.ClassModel.MoveWebAppSetting();
     }
     //预约配置
     BespeakSeat.Checked = model.IsUseBespeak;
     //if (!model.IsUseBespeak)
     //{
     //    BespeakSeat_Area.Style["display"] = "none";
     //}
     BespeakNextDay.Checked = model.IsUseNextDayBespeak;
     BespeakNowDay.Checked  = model.IsUseNowDayBespeak;
     //if (authorize != null && !authorize.SystemFunction.Contains("Bespeak_NowDay"))
     //{
     //    nowDayTD.Style["display"] = "none";
     //}
     //座位操作配置
     ShortLeave.Checked = model.IsCanShortLeave;
     Leave.Checked      = model.IsCanLeave;
     Dcode.Checked      = model.IsUseDcode;
     //二维码配置
     //if (!model.IsUseDcode)
     //{
     //    Dcode_Area.Style["display"] = "none";
     //}
     DcodeCheck.Checked        = model.IsCanDcodeCheckTime;
     DcodeComeBack.Checked     = model.IsCanDcodeComeBack;
     DcodeContnueTime.Checked  = model.IsCanDcodeContinueTime;
     DcodeLeave.Checked        = model.IsCanDcodeLeave;
     DcodeReselectSeat.Checked = model.IsCanDcodeReselectSeat;
     DcodeSelectSeat.Checked   = model.IsCanDcodeSelectSeat;
     //if (authorize != null && !authorize.SystemFunction.Contains("MoveClient_SeatSelect"))
     //{
     //    selectSeatTR.Style["display"] = "none";
     //}
     DcodeShortLeave.Checked = model.IsCanDcodeShortLeave;
     DcodeWaitSeat.Checked   = model.IsCanDcodeWaitSeat;
     //if (authorize != null && !authorize.SystemFunction.Contains("MoveClient_SeatWait"))
     //{
     //    waitSeatTD.Style["display"] = "none";
     //}
     //if (authorize != null && !authorize.SystemFunction.Contains("MoveClient_QRcodeDecode"))
     //{
     //    dcodeT.Style["display"] = "none";
     //}
 }
 /// <summary>
 /// 获取指定位置权限文件
 /// </summary>
 /// <param name="filePath"></param>
 /// <returns></returns>
 public AuthorizeVerify.FunctionAuthorizeInfo GetFunctionAuthorizeFile(string filePath)
 {
     AuthorizeVerify.FunctionAuthorizeInfo model = new AuthorizeVerify.FunctionAuthorizeInfo();
     if (File.Exists(filePath))
     {
         try
         {
             model = AuthorizeVerify.FunctionAuthorizeInfo.AnalyzeAuthorize(filePath);
         }
         catch
         {
             throw;
         }
     }
     return(model);
 }
        /// <summary>
        /// 获取本地权限
        /// </summary>
        /// <returns></returns>
        public AuthorizeVerify.FunctionAuthorizeInfo GetFunctionAuthorize()
        {
            string filePath = string.Format(@"{0}sf_authorized_keys", AppDomain.CurrentDomain.BaseDirectory);

            AuthorizeVerify.FunctionAuthorizeInfo model = null;
            if (File.Exists(filePath))
            {
                try
                {
                    model = AuthorizeVerify.FunctionAuthorizeInfo.AnalyzeAuthorize(filePath);
                }
                catch
                {
                    throw;
                }
            }
            return(model);
        }
        protected void btn_funFileSave_Click(object sender, EventArgs e)
        {
            if (funFile.HasFile)
            {
                try
                {
                    Stream       stream       = funFile.FileContent;
                    StreamReader streamReader = new StreamReader(stream);
                    string       context      = streamReader.ReadToEnd();
                    AuthorizeVerify.FunctionAuthorizeInfo authorize
                        = SeatManage.SeatManageComm.JSONSerializer.Deserialize <AuthorizeVerify.FunctionAuthorizeInfo>(SeatManage.SeatManageComm.AESAlgorithm.AESDecrypt(context));
                    if (authorize.SchoolNum != SeatManage.Bll.Registry.GetSchoolNum())
                    {
                        FineUI.Alert.ShowInTop("请使用当前学校的授权文件!");
                        return;
                    }
                    if (SeatManage.Bll.AuthorizationOperation.SaveFunctionAuthorize(authorize))
                    {
                        FineUI.Alert.ShowInTop("保存成功!");
                        funFileMsg.InnerHtml = "";
                        foreach (string fun in authorize.SystemFunction)
                        {
                            string funName = "";
                            switch (fun)
                            {
                            case "Bespeak_AppointTime": funName = "指定时间预约"; break;

                            case "Bespeak_NowDay": funName = "预约当天座位"; break;

                            case "Client_SeachBespeak": funName = "触摸屏终端预约记录查询"; break;

                            case "Client_SeachBlasklist": funName = "触摸屏终端黑名单查询"; break;

                            case "Client_SeachViolation": funName = "触摸屏终端违规记录查询"; break;

                            case "Client_ShowLastSeat": funName = "触摸屏终端座位使用情况查询"; break;

                            case "Client_ShowReaderInfo": funName = "触摸屏终端读者信息显示"; break;

                            case "Client_ShowReaderMeg": funName = "触摸屏终端读者消息推送"; break;

                            case "LimitTime_SpanMode": funName = "计时功能时段模式"; break;

                            case "Media_MediaPlayer": funName = "媒体播放器视频广告"; break;

                            case "Media_PopAd": funName = "触摸屏终端弹窗广告"; break;

                            case "Media_SchoolNotice": funName = "触摸屏终端校园通知"; break;

                            case "Media_TitleAd": funName = "触摸屏终端冠名广告"; break;

                            case "MoveClient_AdminManage": funName = "移动终端管理员终端"; break;

                            case "MoveClient_ContinueTime": funName = "移动终端续时功能"; break;

                            case "MoveClient_QRcodeDecode": funName = "移动终端二维码功能"; break;

                            case "RoomOC_24HModel": funName = "24小时功能"; break;

                            case "MoveClient_SeatSelect": funName = "移动终端选座功能"; break;

                            case "MoveClient_SeatWait": funName = "移动终端座位等待功能"; break;

                            case "SendMsg": funName = "消息推送功能"; break;
                            }
                            if (funName != "")
                            {
                                funFileMsg.InnerHtml += funName + "</br>";
                            }
                        }
                        if (funFileMsg.InnerHtml != "")
                        {
                            upFunFileTR.Style["visibility"]  = "hidden";
                            rupFunFileTR.Style["visibility"] = "visible";
                        }
                    }
                    else
                    {
                        FineUI.Alert.ShowInTop("保存失败!");
                    }
                }
                catch
                {
                    FineUI.Alert.ShowInTop("读取文件错误!请保证文件正确!");
                }
            }
        }
        private void DataBinding()
        {
            AuthorizeVerify.FunctionAuthorizeInfo funAuthorize = SeatManage.Bll.AuthorizationOperation.GetFunctionAuthorize();
            if (funAuthorize != null)
            {
                funFileMsg.InnerHtml = "";
                foreach (string fun in funAuthorize.SystemFunction)
                {
                    string funName = "";
                    switch (fun)
                    {
                    case "Bespeak_AppointTime": funName = "指定时间预约"; break;

                    case "Bespeak_NowDay": funName = "预约当天座位"; break;

                    case "Client_SeachBespeak": funName = "触摸屏终端预约记录查询"; break;

                    case "Client_SeachBlasklist": funName = "触摸屏终端黑名单查询"; break;

                    case "Client_SeachViolation": funName = "触摸屏终端违规记录查询"; break;

                    case "Client_ShowLastSeat": funName = "触摸屏终端座位使用情况查询"; break;

                    case "Client_ShowReaderInfo": funName = "触摸屏终端读者信息显示"; break;

                    case "Client_ShowReaderMeg": funName = "触摸屏终端读者消息推送"; break;

                    case "LimitTime_SpanMode": funName = "计时功能时段模式"; break;

                    case "Media_MediaPlayer": funName = "媒体播放器视频广告"; break;

                    case "Media_PopAd": funName = "触摸屏终端弹窗广告"; break;

                    case "Media_SchoolNotice": funName = "触摸屏终端校园通知"; break;

                    case "Media_TitleAd": funName = "触摸屏终端冠名广告"; break;

                    case "MoveClient_AdminManage": funName = "移动终端管理员终端"; break;

                    case "MoveClient_ContinueTime": funName = "移动终端续时功能"; break;

                    case "MoveClient_QRcodeDecode": funName = "移动终端二维码功能"; break;

                    case "RoomOC_24HModel": funName = "24小时功能"; break;

                    case "MoveClient_SeatSelect": funName = "移动终端选座功能"; break;

                    case "MoveClient_SeatWait": funName = "移动终端座位等待功能"; break;

                    case "SendMsg": funName = "消息推送功能"; break;
                    }
                    if (funName != "")
                    {
                        funFileMsg.InnerHtml += funName + "</br>";
                    }
                }
                if (funFileMsg.InnerHtml != "")
                {
                    upFunFileTR.Style["visibility"]  = "hidden";
                    rupFunFileTR.Style["visibility"] = "visible";
                }
                else
                {
                    funFileMsg.InnerHtml = "暂无授权";
                }
            }
            else
            {
                upFunFileTR.Style["visibility"]  = "visible";
                rupFunFileTR.Style["visibility"] = "hidden";
            }
            try
            {
                Dictionary <string, AuthorizeVerify.ServiceAuthorize> serviceAuthorizes = AuthorizeVerify.ServiceAuthorize.AnalyzeAuthorize(Server.MapPath("~/WebService/ws_authorized_keys"));
                accessFileMsg.InnerHtml = "";
                foreach (KeyValuePair <string, AuthorizeVerify.ServiceAuthorize> item in serviceAuthorizes)
                {
                    string accessName = "账户:" + item.Key + "</br>";
                    foreach (AuthorizeVerify.ServiceAuthorizeItem access in item.Value.ServiceAuthorizeItems)
                    {
                        switch (access.ServiceName)
                        {
                        case "GetReaderInfoService":
                            accessName += "</br>获取用户信息接口:" + access.ServiceName + "</br>";
                            break;

                        case "GetReadingRoomInfoService":
                            accessName += "</br>获取阅览室信息:" + access.ServiceName + "</br>";
                            break;

                        case "DelaySeatUsedTimeService":
                            accessName += "</br>座位续时接口:" + access.ServiceName + "</br>";
                            break;

                        case "ShortLeaveService":
                            accessName += "</br>座位暂离接口:" + access.ServiceName + "</br>";
                            break;

                        case "BespeakSeatService":
                            accessName += "</br>座位预约接口:" + access.ServiceName + "</br>";
                            break;

                        case "ChooseSeatService":
                            accessName += "</br>座位选择接口:" + access.ServiceName + "</br>";
                            break;

                        case "FreeSeatService":
                            accessName += "</br>释放座位接口:" + access.ServiceName + "</br>";
                            break;
                        }
                        foreach (string function in access.AllowMethodName)
                        {
                            switch (function)
                            {
                            case "GetAllReadingRoomBaseInfo":
                                accessName += "获取全部阅览室信息方法:" + function + "</br>";
                                break;

                            case "GetReadingRoomSetInfoByRoomNum":
                                accessName += "获取阅览室设置方法:" + function + "</br>";
                                break;

                            case "GetSeatsLayoutByRoomNum":
                                accessName += "获取座位布局方法:" + function + "</br>";
                                break;

                            case "GetSeatsUsedInfoByRoomNum":
                                accessName += "获取座位使用情况方法:" + function + "</br>";
                                break;

                            case "GetCanBespeakSeatsLayout":
                                accessName += "获取可预约座位的布局方法:" + function + "</br>";
                                break;

                            case "GetSeatsBespeakInfoByRoomNum":
                                accessName += "获取座位预约信息方法:" + function + "</br>";
                                break;

                            case "GetBaseReaderInfoByCardId":
                                accessName += "获取用户信息方法:" + function + "</br>";
                                break;

                            case "GetBaseReaderInfo":
                                accessName += "获取用户信息方法:" + function + "</br>";
                                break;

                            case "GetReaderActualTimeRecord":
                                accessName += "获取用户实时记录方法:" + function + "</br>";
                                break;

                            case "GetReaderBespeakRecord":
                                accessName += "获取用户预约记录方法:" + function + "</br>";
                                break;

                            case "GetReaderChooseSeatRecord":
                                accessName += "获取用户选座记录方法:" + function + "</br>";
                                break;

                            case "GetReaderBlacklistRecord":
                                accessName += "获取用户黑名单记录方法:" + function + "</br>";
                                break;

                            case "GetReaderAccount":
                                accessName += "获取用户账号方法:" + function + "</br>";
                                break;

                            case "GetDelaySet":
                                accessName += "获取续时设置方法:" + function + "</br>";
                                break;

                            case "SubmitDelayResult":
                                accessName += "座位续时方法:" + function + "</br>";
                                break;

                            case "ShortLeave":
                                accessName += "座位暂离方法:" + function + "</br>";
                                break;

                            case "GetOpenBespeakRooms":
                                accessName += "获取开放预约的阅览室方法:" + function + "</br>";
                                break;

                            case "SubmitBespeakInfo":
                                accessName += "预约座位方法:" + function + "</br>";
                                break;

                            case "GetBespeakSeatRoomSet":
                                accessName += "获取预约的阅览室设置方法:" + function + "</br>";
                                break;

                            case "GetReaderActualTimeBespeakRecord":
                                accessName += "获取用户实时预约记录方法:" + function + "</br>";
                                break;

                            case "VerifyCanDoIt":
                                accessName += "验证用户是否能选座方法:" + function + "</br>";
                                break;

                            case "SeatLock":
                                accessName += "锁定座位方法:" + function + "</br>";
                                break;

                            case "SubmitChooseResult":
                                accessName += "更换座位方法:" + function + "</br>";
                                break;

                            case "FreeSeat":
                                accessName += "释放座位方法:" + function + "</br>";
                                break;
                            }
                        }
                    }
                    if (accessName != "")
                    {
                        accessFileMsg.InnerHtml += accessName + "</br>";
                    }
                }
                if (accessFileMsg.InnerHtml != "")
                {
                    upAccessFileTR.Style["visibility"]  = "hidden";
                    rupAccessFileTR.Style["visibility"] = "visible";
                }
                else
                {
                    accessFileMsg.InnerHtml = "暂无授权";
                }
            }
            catch
            {
                upAccessFileTR.Style["visibility"]  = "visible";
                rupAccessFileTR.Style["visibility"] = "hidden";
            }
        }
        /// <summary>
        /// 数据绑定
        /// </summary>
        private void DataBind()
        {
            AuthorizeVerify.FunctionAuthorizeInfo authorize = SeatManage.Bll.AuthorizationOperation.GetFunctionAuthorize();
            SeatManage.ClassModel.ReadingRoomInfo room      = SeatManage.Bll.T_SM_ReadingRoom.GetSingleRoomInfo(Request.QueryString["id"]);
            if (room == null)
            {
                room = new SeatManage.ClassModel.ReadingRoomInfo();
            }
            SeatManage.ClassModel.ReadingRoomSetting roomSet = room.Setting;
            if (roomSet == null)
            {
                roomSet = new SeatManage.ClassModel.ReadingRoomSetting();
            }
            //选座模式设置
            SeatSelectDefaultMode.SelectedValue = ((int)roomSet.SeatChooseMethod.DefaultChooseMethod).ToString();
            SeatSelectAdMode.Checked            = roomSet.SeatChooseMethod.UsedAdvancedSet;
            //SelectSeatPosTimes.Text = roomSet.PosTimes.Times.ToString();
            SelectSeatPosCount.Text = roomSet.PosTimes.Times.ToString();
            SelectSeatPosTimes.Text = roomSet.PosTimes.Minutes.ToString();
            SeatSelectPos.Checked   = roomSet.PosTimes.IsUsed;
            //if (SeatSelectAdMode.Checked)
            //{
            //    SeatSelectAdModeTable.Style["display"] = "block";
            //}
            //else
            //{
            //    SeatSelectAdModeTable.Style["display"] = "none";
            //}
            //高级设置
            foreach (KeyValuePair <DayOfWeek, SeatChooseMethodPlan> day in roomSet.SeatChooseMethod.AdvancedSelectSeatMode)
            {
                string   dayNum   = ((int)day.Value.Day).ToString();
                CheckBox DayCheck = FindControl("PanelSetting").FindControl("FormReadingRoomSet").FindControl("SeatSelectAdModeDay" + dayNum) as CheckBox;
                DayCheck.Checked = day.Value.Used;
                for (int i = 0; i < day.Value.PlanOption.Count; i++)
                {
                    string[]        begintime  = day.Value.PlanOption[i].UsedTime.BeginTime.Split(':');
                    string[]        endtime    = day.Value.PlanOption[i].UsedTime.EndTime.Split(':');
                    TextBox         begintimeH = FindControl("PanelSetting").FindControl("FormReadingRoomSet").FindControl("SeatSelectAdModeDay" + dayNum + "_Time" + (i + 1) + "_StartH") as TextBox;
                    TextBox         begintimeM = FindControl("PanelSetting").FindControl("FormReadingRoomSet").FindControl("SeatSelectAdModeDay" + dayNum + "_Time" + (i + 1) + "_StartM") as TextBox;
                    TextBox         endtimeH   = FindControl("PanelSetting").FindControl("FormReadingRoomSet").FindControl("SeatSelectAdModeDay" + dayNum + "_Time" + (i + 1) + "_EndH") as TextBox;
                    TextBox         endtimeM   = FindControl("PanelSetting").FindControl("FormReadingRoomSet").FindControl("SeatSelectAdModeDay" + dayNum + "_Time" + (i + 1) + "_EndM") as TextBox;
                    RadioButtonList selectmode = FindControl("PanelSetting").FindControl("FormReadingRoomSet").FindControl("SeatSelectAdModeDay" + dayNum + "_Time" + (i + 1) + "_SelectMode") as RadioButtonList;
                    begintimeH.Text          = begintime[0];
                    begintimeM.Text          = begintime[1];
                    endtimeH.Text            = endtime[0];
                    endtimeM.Text            = endtime[1];
                    selectmode.SelectedValue = ((int)day.Value.PlanOption[i].ChooseMethod).ToString();
                }
            }
            //暂离设置
            ShortLeaveDufaultTime.Text = roomSet.SeatHoldTime.DefaultHoldTimeLength.ToString();
            ShortLeaveAdMode.Checked   = roomSet.SeatHoldTime.UsedAdvancedSet;
            //if (ShortLeaveAdMode.Checked)
            //{
            //    ShortLeaveAdModeTable.Style["display"] = "block";
            //}
            //else
            //{
            //    ShortLeaveAdModeTable.Style["display"] = "none";
            //}
            //高级设置
            for (int i = 0; i < roomSet.SeatHoldTime.AdvancedSeatHoldTime.Count; i++)
            {
                string[] begintime  = roomSet.SeatHoldTime.AdvancedSeatHoldTime[i].UsedTime.BeginTime.Split(':');
                string[] endtime    = roomSet.SeatHoldTime.AdvancedSeatHoldTime[i].UsedTime.EndTime.Split(':');
                TextBox  begintimeH = FindControl("PanelSetting").FindControl("FormShortLeave").FindControl("ShortLeaveAdMode_Time" + (i + 1) + "_StartH") as TextBox;
                TextBox  begintimeM = FindControl("PanelSetting").FindControl("FormShortLeave").FindControl("ShortLeaveAdMode_Time" + (i + 1) + "_StartM") as TextBox;
                TextBox  endtimeH   = FindControl("PanelSetting").FindControl("FormShortLeave").FindControl("ShortLeaveAdMode_Time" + (i + 1) + "_EndH") as TextBox;
                TextBox  endtimeM   = FindControl("PanelSetting").FindControl("FormShortLeave").FindControl("ShortLeaveAdMode_Time" + (i + 1) + "_EndM") as TextBox;
                TextBox  leavetime  = FindControl("PanelSetting").FindControl("FormShortLeave").FindControl("ShortLeaveAdMode_Time" + (i + 1) + "_LeaveTime") as TextBox;
                CheckBox used       = FindControl("PanelSetting").FindControl("FormShortLeave").FindControl("ShortLeaveAdMode_Time" + (i + 1)) as CheckBox;
                begintimeH.Text = begintime[0];
                begintimeM.Text = begintime[1];
                endtimeH.Text   = endtime[0];
                endtimeM.Text   = endtime[1];
                leavetime.Text  = roomSet.SeatHoldTime.AdvancedSeatHoldTime[i].HoldTimeLength.ToString();
                used.Checked    = roomSet.SeatHoldTime.AdvancedSeatHoldTime[i].Used;
            }
            //开闭馆计划设置
            string[] opentime  = roomSet.RoomOpenSet.DefaultOpenTime.BeginTime.Split(':');
            string[] closetime = roomSet.RoomOpenSet.DefaultOpenTime.EndTime.Split(':');
            ReadingRoomDufaultOpenTimeH.Text  = opentime[0];
            ReadingRoomDufaultOpenTimeM.Text  = opentime[1];
            ReadingRoomBeforeOpenTime.Text    = roomSet.RoomOpenSet.OpenBeforeTimeLength.ToString();
            ReadingRoomDufaultCloseTimeH.Text = closetime[0];
            ReadingRoomDufaultCloseTimeM.Text = closetime[1];
            ReadingRoomBeforeCloseTime.Text   = roomSet.RoomOpenSet.CloseBeforeTimeLength.ToString();
            ReadingRoomOpen24H.Checked        = roomSet.RoomOpenSet.UninterruptibleModel;
            //验证授权
            //if (authorize != null && !authorize.SystemFunction.Contains("RoomOC_24HModel"))
            //{
            //    open24htr.Style["display"] = "none";
            //}
            //高级设置
            ReadingRoomOpenCloseAdMode.Checked = roomSet.RoomOpenSet.UsedAdvancedSet;
            //if (ReadingRoomOpenCloseAdMode.Checked)
            //{
            //    ReadingRoomOpenCloseAdModeTable.Style["display"] = "block";
            //}
            //else
            //{
            //    ReadingRoomOpenCloseAdModeTable.Style["display"] = "none";
            //}
            foreach (KeyValuePair <DayOfWeek, RoomOpenPlanSet> day in roomSet.RoomOpenSet.RoomOpenPlan)
            {
                string   dayNum   = ((int)day.Value.Day).ToString();
                CheckBox DayCheck = FindControl("PanelSetting").FindControl("FormReadingRoomOC").FindControl("ReadingRoomAdOpenTime_Day" + dayNum) as CheckBox;
                DayCheck.Checked = day.Value.Used;
                for (int i = 0; i < day.Value.OpenTime.Count; i++)
                {
                    string[] begintime  = day.Value.OpenTime[i].BeginTime.Split(':');
                    string[] endtime    = day.Value.OpenTime[i].EndTime.Split(':');
                    TextBox  begintimeH = FindControl("PanelSetting").FindControl("FormReadingRoomOC").FindControl("ReadingRoomAdOpenTime_Day" + dayNum + "_Time" + (i + 1) + "_OpenH") as TextBox;
                    TextBox  begintimeM = FindControl("PanelSetting").FindControl("FormReadingRoomOC").FindControl("ReadingRoomAdOpenTime_Day" + dayNum + "_Time" + (i + 1) + "_OpenM") as TextBox;
                    TextBox  endtimeH   = FindControl("PanelSetting").FindControl("FormReadingRoomOC").FindControl("ReadingRoomAdOpenTime_Day" + dayNum + "_Time" + (i + 1) + "_CloseH") as TextBox;
                    TextBox  endtimeM   = FindControl("PanelSetting").FindControl("FormReadingRoomOC").FindControl("ReadingRoomAdOpenTime_Day" + dayNum + "_Time" + (i + 1) + "_CloseM") as TextBox;
                    begintimeH.Text = begintime[0];
                    begintimeM.Text = begintime[1];
                    endtimeH.Text   = endtime[0];
                    endtimeM.Text   = endtime[1];
                }
            }
            ShortLeaveByAdmin.Checked        = roomSet.AdminShortLeave.IsUsed;
            ShortLeaveByAdmin_LeaveTime.Text = roomSet.AdminShortLeave.HoldTimeLength.ToString();
            //在座时长设置
            SeatTime.Checked                         = roomSet.SeatUsedTimeLimit.Used;
            SeatTime_Mode.SelectedValue              = roomSet.SeatUsedTimeLimit.Mode;
            SeatTime_SeatTime.Text                   = roomSet.SeatUsedTimeLimit.UsedTimeLength.ToString();
            SeatTime_OverTime_Mode.SelectedValue     = ((int)roomSet.SeatUsedTimeLimit.OverTimeHandle).ToString();
            SeatTime_ContinueTime.Checked            = roomSet.SeatUsedTimeLimit.IsCanContinuedTime;
            SeatTime_ContinueTime_Time.Text          = roomSet.SeatUsedTimeLimit.DelayTimeLength.ToString();
            SeatTime_ContinueTime_ContinueCount.Text = roomSet.SeatUsedTimeLimit.ContinuedTimes.ToString();
            SeatTime_ContinueTime_BeforeTime.Text    = roomSet.SeatUsedTimeLimit.CanDelayTime.ToString();
            for (int i = 0; i < roomSet.SeatUsedTimeLimit.FixedTimes.Count; i++)
            {
                SeatTime_TimeSpanList.Text += roomSet.SeatUsedTimeLimit.FixedTimes[i].ToShortTimeString() + ";";
                //TextBox timeH = FindControl("PanelSetting").FindControl("SeatTimeSetting").FindControl("SeatTime_TimeH_" + i) as TextBox;
                //timeH.Text = roomSet.SeatUsedTimeLimit.FixedTimes[i].ToShortTimeString().Split(':')[0];
                //TextBox timeM = FindControl("PanelSetting").FindControl("SeatTimeSetting").FindControl("SeatTime_TimeM_" + i) as TextBox;
                //timeM.Text = roomSet.SeatUsedTimeLimit.FixedTimes[i].ToShortTimeString().Split(':')[1];
            }
            //验证授权
            //if (authorize != null && !authorize.SystemFunction.Contains("LimitTime_SpanMode"))
            //{
            //    seatTimeModeltr.Style["display"] = "none";
            //    timespanlisttr.Style["display"] = "none";
            //}
            //预约功能设置
            SeatBook.Checked            = roomSet.SeatBespeak.Used;
            ckbDelayTime.Checked        = roomSet.SeatBespeak.AllowDelayTime;
            ckbLeave.Checked            = roomSet.SeatBespeak.AllowLeave;
            ckbShortLeave.Checked       = roomSet.SeatBespeak.AllowShortLeave;
            SeatBook_BeforeBookDay.Text = roomSet.SeatBespeak.BespeakBeforeDays.ToString();
            string[] beginbooktime = roomSet.SeatBespeak.CanBespeatTimeSpace.BeginTime.Split(':');
            string[] endbooktime   = roomSet.SeatBespeak.CanBespeatTimeSpace.EndTime.Split(':');
            SeatBook_BookTime_StartH.Text  = beginbooktime[0];
            SeatBook_BookTime_StartM.Text  = beginbooktime[1];
            SeatBook_BookTime_EndH.Text    = endbooktime[0];
            SeatBook_BookTime_EndM.Text    = endbooktime[1];
            SeatBook_SubmitBeforeTime.Text = roomSet.SeatBespeak.ConfirmTime.BeginTime;
            SeatBook_SubmitLateTime.Text   = roomSet.SeatBespeak.ConfirmTime.EndTime;
            if (roomSet.SeatBespeak.BespeakArea.BespeakType == BespeakAreaType.Percentage)
            {
                SeatBook_SeatBookRadioPercent.Checked = true;
            }
            else if (roomSet.SeatBespeak.BespeakArea.BespeakType == BespeakAreaType.AppointSeat)
            {
                SeatBook_SeatBookRadioSetted.Checked = true;
            }
            SeatBook_SeatBookRadioPercent_Percent.Text = ((roomSet.SeatBespeak.BespeakArea.Scale) * 100).ToString();
            foreach (SeatManage.ClassModel.TimeSpace cannotbookdate in roomSet.SeatBespeak.NoBespeakDates)
            {
                if (!string.IsNullOrEmpty(SeatBook_CanNotSeatBookDate.Text))
                {
                    SeatBook_CanNotSeatBookDate.Text += ";";
                }
                SeatBook_CanNotSeatBookDate.Text += cannotbookdate.BeginTime + "~" + cannotbookdate.EndTime;
            }
            cbNowDayBook.Checked               = roomSet.SeatBespeak.NowDayBespeak;
            NowDayBookTime.Text                = roomSet.SeatBespeak.SeatKeepTime.ToString();
            cbSpecifiedBook.Checked            = roomSet.SeatBespeak.SpecifiedBespeak;
            SeatBook_SelectBespeakSeat.Checked = roomSet.SeatBespeak.SelectBespeakSeat;
            SeatBook_SpecifiedTime.Checked     = roomSet.SeatBespeak.SpecifiedTime;
            SeatBook_BespeakSeatOnSeat.Checked = roomSet.SeatBespeak.BespeatWithOnSeat;
            SeatBook_BespeakSeatCount.Text     = roomSet.SeatBespeak.BespeakSeatCount.ToString();
            foreach (DateTime dt in roomSet.SeatBespeak.SpecifiedTimeList)
            {
                if (SeatBook_SpecifiedTimeList.Text != "")
                {
                    SeatBook_SpecifiedTimeList.Text += ";";
                }
                SeatBook_SpecifiedTimeList.Text += dt.ToShortTimeString();
            }
            //if (authorize != null && !authorize.SystemFunction.Contains("Bespeak_AppointTime"))
            //{
            //    cbSpecifiedBook.Visible = false;
            //    appointTimetr.Style["display"] = "none";
            //}
            //if (authorize != null && !authorize.SystemFunction.Contains("Bespeak_NowDay"))
            //{
            //    cbNowDayBook.Visible = false;
            //    nowDaytr1.Style["display"] = "none";
            //    nowDaytr2.Style["display"] = "none";
            //    nowDaytr3.Style["display"] = "none";
            //}

            //黑名单设置
            UseBlacklist.Checked        = roomSet.UsedBlacklistLimit;
            IsRecordViolate.Checked     = roomSet.IsRecordViolate;
            UseBlacklistSetting.Checked = roomSet.BlackListSetting.Used;
            //if (UseBlacklistSetting.Checked)
            //{
            //    UseBlacklistSettingTable.Style["display"] = "block";
            //}
            //else
            //{
            //    UseBlacklistSettingTable.Style["display"] = "none";
            //}
            RecordViolateCount.Text     = roomSet.BlackListSetting.ViolateTimes.ToString();
            LeaveBlackDays.Text         = roomSet.BlackListSetting.LimitDays.ToString();
            LeaveRecordViolateDays.Text = roomSet.BlackListSetting.ViolateFailDays.ToString();
            if (roomSet.BlackListSetting.LeaveBlacklist == LeaveBlacklistMode.AutomaticMode)
            {
                AutoLeave.Checked = true;
            }
            else
            {
                HardLeave.Checked = true;
            }
            RecordViolate_BookOverTime.Checked       = roomSet.BlackListSetting.ViolateRoule[ViolationRecordsType.BookingTimeOut];
            RecordViolate_LeaveByAdmin.Checked       = roomSet.BlackListSetting.ViolateRoule[ViolationRecordsType.LeaveByAdmin];
            RecordViolate_SeatOverTime.Checked       = roomSet.BlackListSetting.ViolateRoule[ViolationRecordsType.SeatOutTime];
            RecordViolate_ShortLeaveByAdmin.Checked  = roomSet.BlackListSetting.ViolateRoule[ViolationRecordsType.ShortLeaveByAdminOutTime];
            RecordViolate_ShortLeaveByReader.Checked = roomSet.BlackListSetting.ViolateRoule[ViolationRecordsType.ShortLeaveByReaderOutTime];
            RecordViolate_ShortLeaveOverTime.Checked = roomSet.BlackListSetting.ViolateRoule[ViolationRecordsType.ShortLeaveOutTime];
            //其他设置
            ShowSeatNumberCount.Text = roomSet.SeatNumAmount.ToString();
            NoManMode.Checked        = roomSet.NoManagement.Used;
            NoManMode_WaitTime.Text  = roomSet.NoManagement.OperatingInterval.ToString();

            ReaderLimit.Checked = roomSet.LimitReaderEnter.Used;
            if (roomSet.LimitReaderEnter.CanEnter)
            {
                ReaderLimit_LimitMode_Writelist.Checked = true;
            }
            else
            {
                ReaderLimit_LimitMode_Blacklist.Checked = true;
            }
            SeatManage.Bll.T_SM_Reader readerbll = new SeatManage.Bll.T_SM_Reader();
            List <string> readertype             = readerbll.GetReaderType();

            ReaderLimit_ReaderMode.Items.Clear();
            foreach (string reader in readertype)
            {
                if (string.IsNullOrEmpty(reader))
                {
                    ReaderLimit_ReaderMode.Items.Add("未指定");
                }
                else
                {
                    ReaderLimit_ReaderMode.Items.Add(reader);
                }
            }
            string[] readerType = roomSet.LimitReaderEnter.ReaderTypes.Split(';');
            foreach (ListItem ci in ReaderLimit_ReaderMode.Items)
            {
                foreach (string reader in readerType)
                {
                    if (string.IsNullOrEmpty(reader) && ci.Value == "未指定")
                    {
                        ci.Selected = true;
                        break;
                    }
                    else if (ci.Value == reader)
                    {
                        ci.Selected = true;
                        break;
                    }
                }
            }
            SameRoomSet.Items.Clear();
            List <SeatManage.ClassModel.ReadingRoomInfo> rooms = SeatManage.Bll.ClientConfigOperate.GetReadingRooms(null);

            foreach (SeatManage.ClassModel.ReadingRoomInfo roominfo in rooms)
            {
                if (roominfo.No != room.No)
                {
                    ListItem li = new ListItem(roominfo.Name + "&nbsp;&nbsp;", roominfo.No);
                    SameRoomSet.Items.Add(li);
                }
            }
            for (int i = 0; i < SameRoomSet.Items.Count; i++)
            {
                SameRoomSet.Items[i].Attributes.Add("onmouseover", "showToolTip(event,'" + SameRoomSet.Items[i].Value + "')");
            }
        }