Ejemplo n.º 1
0
 void grid_HtmlCommandCellPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableCommandCellEventArgs e)
 {
     if (e.CommandCellType == GridViewTableCommandCellType.Data)
     {
         if (!AuthUser.RoleName.Contains("Admin"))
         {
             e.Cell.Controls[0].Visible = false;
             e.Cell.Controls[1].Visible = false;
             e.Cell.Controls[2].Visible = false;
             e.Cell.Controls[3].Visible = false;
         }
     }
 }
Ejemplo n.º 2
0
 void grid_HtmlCommandCellPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableCommandCellEventArgs e)
 {
     if (e.CommandCellType == GridViewTableCommandCellType.Data)
     {
         if (grid.GetRowValuesByKeyValue(e.KeyValue, "NF_CAT").ToString() == "生日" ||
             AuthUser.RoleName == AuthenUserType.TW_Browser ||
             AuthUser.RoleName == AuthenUserType.TW_Finance
             )
         {
             e.Cell.Controls[0].Visible = false;
         }
     }
 }
Ejemplo n.º 3
0
    void grid_HtmlCommandCellPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableCommandCellEventArgs e)
    {
        //--Admin和团委管理员不做限制,如果当前行在编辑中则不控制按钮
        if (AuthUser.RoleName == AuthenUserType.Admin || grid.EditingRowVisibleIndex == e.VisibleIndex)
        {
            return;
        }

        if (e.CommandCellType == GridViewTableCommandCellType.Data)
        {
            if (grid.GetRowValuesByKeyValue(e.KeyValue, "BA_STATUS").ToString() == "等待审核中")
            {
                //--只有团支部管理员有删除权限
                if (e.Cell.Controls.Count > 1)
                {
                    e.Cell.Controls[1].Visible = (AuthUser.RoleName == AuthenUserType.TZB_Admin);
                }

                //--团委管理员2无法进行编辑
                if (e.Cell.Controls.Count > 0 && AuthUser.RoleName == AuthenUserType.TW_Browser)
                {
                    ((System.Web.UI.WebControls.HyperLink)(e.Cell.Controls[0].Controls[0])).Enabled = false;
                    ((DevExpress.Web.ASPxGridView.Rendering.GridViewCommandColumnButtonControl)(e.Cell.Controls[0])).Enabled = false;
                }
            }
            else
            {
                //--审核通过就不允许删除
                if (e.Cell.Controls.Count > 1)
                {
                    e.Cell.Controls[1].Visible = false;
                }

                //--审核通过就不允许编辑
                if (e.Cell.Controls.Count > 0)
                {
                    ((System.Web.UI.WebControls.HyperLink)(e.Cell.Controls[0].Controls[0])).Enabled = false;
                    ((DevExpress.Web.ASPxGridView.Rendering.GridViewCommandColumnButtonControl)(e.Cell.Controls[0])).Enabled = false;
                }
            }
        }
    }
Ejemplo n.º 4
0
    void grid_HtmlCommandCellPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableCommandCellEventArgs e)
    {
        if (grid.EditingRowVisibleIndex == e.VisibleIndex)
        {
            return;
        }

        if (e.CommandCellType == GridViewTableCommandCellType.Data)
        {
            if (grid.GetRowValuesByKeyValue(e.KeyValue, "OL_STATUS").ToString() == "已发放" ||
                (AuthUser.RoleName != AuthenUserType.TW_Finance && AuthUser.RoleName != AuthenUserType.Admin && AuthUser.RoleName != AuthenUserType.TW_Admin)
                )
            {
                if (e.Cell.Controls.Count > 1)
                {
                    e.Cell.Controls[1].Visible = false;
                }

                ((System.Web.UI.WebControls.HyperLink)(e.Cell.Controls[0].Controls[0])).Enabled = false;
                ((DevExpress.Web.ASPxGridView.Rendering.GridViewCommandColumnButtonControl)(e.Cell.Controls[0])).Enabled = false;
            }
        }
    }