Ejemplo n.º 1
0
        /// <summary>
        /// 获取授权 信息
        /// </summary>
        /// <returns></returns>
        private List <ServiceAuthorizeItem> getGetReaderInfoService()
        {
            List <ServiceAuthorizeItem> items = new List <ServiceAuthorizeItem>();
            List <CheckBox>             cbl   = new List <CheckBox>();

            cbl.Add(cb_GetReaderInfoService);
            cbl.Add(cb_SeatOperationService);
            cbl.Add(cb_GetSeatInfoService);
            cbl.Add(cb_GetReadingRoomInfoService);
            foreach (CheckBox cb in cbl)
            {
                if (cb.Checked)
                {
                    ServiceAuthorizeItem authorizeItem = new ServiceAuthorizeItem();
                    authorizeItem.ServiceName = cb.Name.Split('_')[1];
                    GroupBox gb = Controls.Find("gb_" + cb.Name.Split('_')[1], false)[0] as GroupBox;
                    for (int i = 0; i < gb.Controls.Count; i++)
                    {
                        if (((CheckBox)gb.Controls[i]) != cb && ((CheckBox)gb.Controls[i]).Checked)
                        {
                            authorizeItem.AllowMethodName.Add(((CheckBox)gb.Controls[i]).Name.Split('_')[2]);
                        }
                    }
                    items.Add(authorizeItem);
                }
            }
            return(items);
        }
        /// <summary>
        /// 获取授权 信息
        /// </summary>
        /// <returns></returns>
        private List <ServiceAuthorizeItem> getGetReaderInfoService()
        {
            List <ServiceAuthorizeItem> items = new List <ServiceAuthorizeItem>();

            #region 读者服务授权
            if (ckbReaderService.Checked)
            {
                ServiceAuthorizeItem GetReaderInfoService = new ServiceAuthorizeItem();
                GetReaderInfoService.ServiceName = "GetReaderInfoService";
                if (ckbGetBaseReaderInfoByCardId.Checked)
                {
                    GetReaderInfoService.AllowMethodName.Add("GetBaseReaderInfoByCardId");
                }
                if (ckbGetBaseReaderInfoByCardNo.Checked)
                {
                    GetReaderInfoService.AllowMethodName.Add("GetBaseReaderInfo");
                }
                if (ckbGetReaderActualTimeRecord.Checked)
                {
                    GetReaderInfoService.AllowMethodName.Add("GetReaderActualTimeRecord");
                }
                if (ckbGetReaderBespeakRecord.Checked)
                {
                    GetReaderInfoService.AllowMethodName.Add("GetReaderBespeakRecord");
                }
                if (ckbGetReaderChooseSeatRecord.Checked)
                {
                    GetReaderInfoService.AllowMethodName.Add("GetReaderChooseSeatRecord");
                }
                if (ckbGetReaderAccount.Checked)
                {
                    GetReaderInfoService.AllowMethodName.Add("GetReaderAccount");
                }
                if (ckbGetReaderBlacklistRecord.Checked)
                {
                    GetReaderInfoService.AllowMethodName.Add("GetReaderBlacklistRecord");
                }
                if (ckbViolationRecordsLog_ReaderService.Checked)
                {
                    GetReaderInfoService.AllowMethodName.Add("GetViolateDiscipline");
                }
                items.Add(GetReaderInfoService);
            }
            #endregion

            #region 阅览室服务授权
            if (ckbRoomService.Checked)
            {
                ServiceAuthorizeItem GetReadingRoomInfoService = new ServiceAuthorizeItem();
                GetReadingRoomInfoService.ServiceName = "GetReadingRoomInfoService";
                if (ckbGetReadingRoomSetInfoByRoomNum.Checked)
                {
                    GetReadingRoomInfoService.AllowMethodName.Add("GetReadingRoomSetInfoByRoomNum");
                }
                if (ckbGetSeatsBespeakInfoByRoomNum.Checked)
                {
                    GetReadingRoomInfoService.AllowMethodName.Add("GetSeatsBespeakInfoByRoomNum");
                }
                if (ckbGetSeatsLayoutByRoomNum.Checked)
                {
                    GetReadingRoomInfoService.AllowMethodName.Add("GetSeatsLayoutByRoomNum");
                }
                if (ckbGetCanBespeakSeatsLayout.Checked)
                {
                    GetReadingRoomInfoService.AllowMethodName.Add("GetCanBespeakSeatsLayout");
                }
                if (ckbGetSeatsUsedInfoByRoomNum.Checked)
                {
                    GetReadingRoomInfoService.AllowMethodName.Add("GetSeatsUsedInfoByRoomNum");
                }
                if (ckbGetAllReadingRoomBaseInfo.Checked)
                {
                    GetReadingRoomInfoService.AllowMethodName.Add("GetAllReadingRoomBaseInfo");
                }
                if (ckbGetAllRoomSeatUsedInfo_RoomService.Checked)
                {
                    GetReadingRoomInfoService.AllowMethodName.Add("GetAllRoomSeatUsedInfo");
                }
                items.Add(GetReadingRoomInfoService);
            }
            #endregion

            #region 延时服务授权
            if (ckbDelaySeatUsedTimeService.Checked)
            {
                ServiceAuthorizeItem DelaySeatUsedTimeService = new ServiceAuthorizeItem();
                DelaySeatUsedTimeService.ServiceName = "DelaySeatUsedTimeService";
                if (ckbGetReaderActualTimeRecord_delay.Checked)
                {
                    DelaySeatUsedTimeService.AllowMethodName.Add("GetReaderActualTimeRecord");
                }
                if (ckbSubmitDelayResult_delay.Checked)
                {
                    DelaySeatUsedTimeService.AllowMethodName.Add("SubmitDelayResult");
                }
                if (ckb_GetBaseReaderInfo_delay.Checked)
                {
                    DelaySeatUsedTimeService.AllowMethodName.Add("GetBaseReaderInfo");
                }
                if (ckbGetDelaySet_delayTime.Checked)
                {
                    DelaySeatUsedTimeService.AllowMethodName.Add("GetDelaySet");
                }
                items.Add(DelaySeatUsedTimeService);
            }
            #endregion

            #region 暂离服务授权
            if (ckbShortLeaveService.Checked)
            {
                ServiceAuthorizeItem shortLeaveService = new ServiceAuthorizeItem();
                shortLeaveService.ServiceName = "ShortLeaveService";
                if (ckbGetReaderActualTimeRecord_shortLeave.Checked)
                {
                    shortLeaveService.AllowMethodName.Add("GetReaderActualTimeRecord");
                }
                if (ckbGetBaseReaderInfo_shortLeave.Checked)
                {
                    shortLeaveService.AllowMethodName.Add("GetBaseReaderInfo");
                }
                if (ckbShortLeave_shortLeave.Checked)
                {
                    shortLeaveService.AllowMethodName.Add("ShortLeave");
                }

                items.Add(shortLeaveService);
            }
            #endregion

            #region 预约功能服务授权
            if (ckbBespeakService.Checked)
            {
                ServiceAuthorizeItem bespeakSeatService = new ServiceAuthorizeItem();
                bespeakSeatService.ServiceName = "BespeakSeatService";

                if (ckbGetBaseReaderInfo_bespeak.Checked)
                {
                    bespeakSeatService.AllowMethodName.Add("GetBaseReaderInfo");
                }
                if (ckbGetBespeakSeatRoomSet_bespeak.Checked)
                {
                    bespeakSeatService.AllowMethodName.Add("GetBespeakSeatRoomSet");
                }
                if (ckbGetReaderBespeakRecord_bespeak.Checked)
                {
                    bespeakSeatService.AllowMethodName.Add("GetReaderBespeakRecord");
                }
                if (ckbGetReaderActualTimeBespeakRecord.Checked)
                {
                    bespeakSeatService.AllowMethodName.Add("GetReaderActualTimeBespeakRecord");
                }
                if (ckbSubmitBespeakInfo.Checked)
                {
                    bespeakSeatService.AllowMethodName.Add("SubmitBespeakInfo");
                }
                if (ckbGetOpenBespeakRooms.Checked)
                {
                    bespeakSeatService.AllowMethodName.Add("GetOpenBespeakRooms");
                }
                if (ckbGetReaderAccount_bespeak.Checked)
                {
                    bespeakSeatService.AllowMethodName.Add("GetReaderAccount");
                }
                if (ckbCancelBespeakLog_bespeak.Checked)
                {
                    bespeakSeatService.AllowMethodName.Add("CancelBespeakLog");
                }
                items.Add(bespeakSeatService);
            }
            #endregion

            #region  座功能服务授权
            if (ckbChooseSeatService.Checked)
            {
                ServiceAuthorizeItem chooseSeatAuthorizeItem = new ServiceAuthorizeItem();
                chooseSeatAuthorizeItem.ServiceName = "ChooseSeatService";

                if (ckbGetReaderChooseSeatRecord_chooseSeat.Checked)
                {
                    chooseSeatAuthorizeItem.AllowMethodName.Add("GetReaderChooseSeatRecord");
                }
                if (ckbGetBaseReaderInfo_chooseSeat.Checked)
                {
                    chooseSeatAuthorizeItem.AllowMethodName.Add("GetBaseReaderInfo");
                }
                if (ckbGetReaderActualTimeRecord_chooseSeat.Checked)
                {
                    chooseSeatAuthorizeItem.AllowMethodName.Add("GetReaderActualTimeRecord");
                }
                if (ckbGetReaderBlacklistRecord_chooseSeat.Checked)
                {
                    chooseSeatAuthorizeItem.AllowMethodName.Add("GetReaderBlacklistRecord");
                }
                if (ckbGetReadingRoomSetInfoByRoomNum_chooseSeat.Checked)
                {
                    chooseSeatAuthorizeItem.AllowMethodName.Add("GetReadingRoomSetInfoByRoomNum");
                }
                if (ckbGetAllReadingRoomBaseInfo_chooseSeat.Checked)
                {
                    chooseSeatAuthorizeItem.AllowMethodName.Add("GetAllReadingRoomBaseInfo");
                }
                if (ckbGetSeatsUsedInfoByRoomNum_chooseSeat.Checked)
                {
                    chooseSeatAuthorizeItem.AllowMethodName.Add("GetSeatsUsedInfoByRoomNum");
                }
                if (ckbVerifyCanDoIt_chooseSeat.Checked)
                {
                    chooseSeatAuthorizeItem.AllowMethodName.Add("VerifyCanDoIt");
                }
                if (ckbSubmitChooseResult.Checked)
                {
                    chooseSeatAuthorizeItem.AllowMethodName.Add("SubmitChooseResult");
                }
                if (ckbSeatLock_chooseSeat.Checked)
                {
                    chooseSeatAuthorizeItem.AllowMethodName.Add("SeatLock");
                }
                items.Add(chooseSeatAuthorizeItem);
            }
            #endregion

            #region 释放座位功能服务授权
            if (ckbFreeSeatService.Checked)
            {
                ServiceAuthorizeItem freeSeatAuthorizeItem = new ServiceAuthorizeItem();
                freeSeatAuthorizeItem.ServiceName = "FreeSeatService";
                if (ckbGetReaderActualTimeRecord_freeSeat.Checked)
                {
                    freeSeatAuthorizeItem.AllowMethodName.Add("GetReaderActualTimeRecord");
                }
                if (ckbGetBaseReaderInfo_freeSeat.Checked)
                {
                    freeSeatAuthorizeItem.AllowMethodName.Add("GetBaseReaderInfo");
                }
                if (ckbFreeSeat.Checked)
                {
                    freeSeatAuthorizeItem.AllowMethodName.Add("FreeSeat");
                }
                items.Add(freeSeatAuthorizeItem);
            }
            #endregion

            #region 其他服务授权
            ServiceAuthorizeItem OtherAuthorizeItem = new ServiceAuthorizeItem();
            OtherAuthorizeItem.ServiceName = "Other";
            if (ckbOther_postMsg.Checked)
            {
                OtherAuthorizeItem.AllowMethodName.Add("PostMsg");
            }
            items.Add(OtherAuthorizeItem);
            #endregion

            return(items);
        }