コード例 #1
0
ファイル: editaccessmask.ascx.cs プロジェクト: RH-Code/YAFNET
        /* Methods */

        /// <summary>
        /// Binds the data.
        /// </summary>
        private void BindData()
        {
            if (this.Request.QueryString.GetFirstOrDefault("i") != null)
            {
                // load access mask
                using (DataTable dataTable = this.GetRepository<AccessMask>().List(this.Request.QueryString.GetFirstOrDefaultAs<int>("i")))
                {
                    // we need just one
                    DataRow row = dataTable.Rows[0];

                    // get access mask properties
                    this.Name.Text = (string)row["Name"];
                    this.SortOrder.Text = row["SortOrder"].ToString();

                    // get flags
                    var flags = new AccessFlags(row["Flags"]);
                    this.ReadAccess.Checked = flags.ReadAccess;
                    this.PostAccess.Checked = flags.PostAccess;
                    this.ReplyAccess.Checked = flags.ReplyAccess;
                    this.PriorityAccess.Checked = flags.PriorityAccess;
                    this.PollAccess.Checked = flags.PollAccess;
                    this.VoteAccess.Checked = flags.VoteAccess;
                    this.ModeratorAccess.Checked = flags.ModeratorAccess;
                    this.EditAccess.Checked = flags.EditAccess;
                    this.DeleteAccess.Checked = flags.DeleteAccess;
                    this.UploadAccess.Checked = flags.UploadAccess;
                    this.DownloadAccess.Checked = flags.DownloadAccess;
                }
            }

            this.DataBind();
        }
コード例 #2
0
ファイル: editaccessmask.ascx.cs プロジェクト: vzrus/VZF
        /* Methods */

        /// <summary>
        /// Binds the data.
        /// </summary>
        private void BindData()
        {
            if (this.Request.QueryString.GetFirstOrDefault("i") != null)
            {
                // load access mask
                using (
                    var dt = CommonDb.accessmask_searchlist(mid: this.PageContext.PageModuleID, boardId: this.PageContext.PageBoardID, accessMaskId: this.Request.QueryString.GetFirstOrDefault("i"), excludeFlags: AccessFlags.Flags.None.ToInt(), pageUserId: null, isUserMask: false, isAdminMask: false, isCommonMask: false, pageIndex: 0, pageSize: 1000000))
                {
                    // we need just one
                    DataRow row = dt.Rows[0];

                    // get access mask properties
                    this.Name.Text = (string)row["Name"];
                    this.SortOrder.Text = row["SortOrder"].ToString();
                    this.IsAdminMaskChk.Checked = row["IsAdminMask"].ToType<bool>();
                    this.IsUserMaskChk.Checked = row["IsUserMask"].ToType<bool>();
                    this.CreatedByUser.Text = this.Get<YafBoardSettings>().EnableDisplayName ? row["CreatedByUserDisplayName"].ToString() : row["CreatedByUserName"].ToString();
                    this.UserID.Text = row["CreatedByUserID"].ToString();

                    // get flags
                    var flags = new AccessFlags(row["Flags"]);
                    this.ReadAccess.Checked = flags.ReadAccess;
                    this.PostAccess.Checked = flags.PostAccess;
                    this.ReplyAccess.Checked = flags.ReplyAccess;
                    this.PriorityAccess.Checked = flags.PriorityAccess;
                    this.PollAccess.Checked = flags.PollAccess;
                    this.VoteAccess.Checked = flags.VoteAccess;
                    this.ModeratorAccess.Checked = flags.ModeratorAccess;
                    this.EditAccess.Checked = flags.EditAccess;
                    this.DeleteAccess.Checked = flags.DeleteAccess;
                    this.UploadAccess.Checked = flags.UploadAccess;
                    this.DownloadAccess.Checked = flags.DownloadAccess;
                    this.UserForumAccess.Checked = flags.UserForumAccess;
                }
            }

            this.DataBind();
        }
コード例 #3
0
        /// <summary>
        /// Binds the data.
        /// </summary>
        private void BindData()
        {
            if (this.Request.QueryString.GetFirstOrDefault("i") != null)
            {
                var accessMask =
                    this.GetRepository<AccessMask>()
                        .ListTyped(this.Request.QueryString.GetFirstOrDefaultAs<int>("i"))
                        .FirstOrDefault();

                // get access mask properties
                this.Name.Text = accessMask.Name;
                this.SortOrder.Text = accessMask.SortOrder.ToString();

                // get flags
                var flags = new AccessFlags(accessMask.Flags);
                this.ReadAccess.Checked = flags.ReadAccess;
                this.PostAccess.Checked = flags.PostAccess;
                this.ReplyAccess.Checked = flags.ReplyAccess;
                this.PriorityAccess.Checked = flags.PriorityAccess;
                this.PollAccess.Checked = flags.PollAccess;
                this.VoteAccess.Checked = flags.VoteAccess;
                this.ModeratorAccess.Checked = flags.ModeratorAccess;
                this.EditAccess.Checked = flags.EditAccess;
                this.DeleteAccess.Checked = flags.DeleteAccess;
                this.UploadAccess.Checked = flags.UploadAccess;
                this.DownloadAccess.Checked = flags.DownloadAccess;
            }

            this.DataBind();
        }
コード例 #4
0
ファイル: editaccessmask.ascx.cs プロジェクト: vzrus/VZF
        /* Methods */

        /// <summary>
        /// Binds the data.
        /// </summary>
        private void BindData()
        {
            if (this.Request.QueryString.GetFirstOrDefault("i") != null)
            {
                // load access mask
                using (
                    var dt = CommonDb.accessmask_pforumlist(mid: this.PageContext.PageModuleID, boardId: this.PageContext.PageBoardID, accessMaskId: this.Request.QueryString.GetFirstOrDefault("i"), excludeFlags: 0, pageUserId: this.PageContext.PageUserID, isUserMask: true, isCommonMask: false))
                {
                    // we need just one
                    DataRow row = dt.Rows[0];

                    // get access mask properties
                    this.Name.Text = (string)row["Name"];
                    this.SortOrder.Text = row["SortOrder"].ToString();

                    // get flags
                    var flags = new AccessFlags(row["Flags"]);
                    this.ReadAccess.Checked = flags.ReadAccess;
                    this.PostAccess.Checked = flags.PostAccess;
                    this.ReplyAccess.Checked = flags.ReplyAccess;
                    this.PriorityAccess.Checked = flags.PriorityAccess;
                    this.PollAccess.Checked = flags.PollAccess;
                    this.VoteAccess.Checked = flags.VoteAccess;
                    this.ModeratorAccess.Checked = flags.ModeratorAccess;
                    this.EditAccess.Checked = flags.EditAccess;
                    this.DeleteAccess.Checked = flags.DeleteAccess;
                    this.UploadAccess.Checked = flags.UploadAccess;
                    this.DownloadAccess.Checked = flags.DownloadAccess;
                    this.UserForumAccess.Checked = flags.UserForumAccess;
                }
            }

            this.DataBind();
        }