//------------------------------------------------------------------------------------------------------------- public static GroupAuthrity GetGroupRight() { string menu_uid = GetMenuID(); string strSql = @" select r.* from AdminRight r inner join AdminMenu m on r.MenuID=m.MenuID where m.ProgramID=@ProgramID and r.GroupID=@GroupID "; Dictionary<string, object> dict = new Dictionary<string, object>(); dict.Add("ProgramID", Util.GetSessionValue("ProgID")); CSessionInfo SessionInfo = page.Session["SessionInfo"] as CSessionInfo; dict.Add("GroupID", SessionInfo.GroupID); DataTable dt = NpoDB.GetDataTableS(strSql, dict); GroupAuthrity ga = new GroupAuthrity(); if (dt.Rows.Count > 0) { ga.AddNew = dt.Rows[0]["_AddNew"].ToString() == "True" ? true : false; ga.Update = dt.Rows[0]["_Update"].ToString() == "True" ? true : false; ga.Delete = dt.Rows[0]["_Delete"].ToString() == "True" ? true : false; ga.Query = dt.Rows[0]["_Query"].ToString() == "True" ? true : false; ga.Focus = dt.Rows[0]["_Focus"].ToString() == "True" ? true : false; ga.Print = dt.Rows[0]["_Print"].ToString() == "True" ? true : false; ga.Examine = dt.Rows[0]["_Examine"].ToString() == "True" ? true : false; ga.ReExamine1 = dt.Rows[0]["_ReExamine1"].ToString() == "True" ? true : false; ga.ReExamine2 = dt.Rows[0]["_ReExamine2"].ToString() == "True" ? true : false; ga.Approve = dt.Rows[0]["_Approve"].ToString() == "True" ? true : false; } return ga; }
//------------------------------------------------------------------------- private void AuthrityControl() { ga = Authrity.GetGroupRight(); if (Authrity.CheckPageRight(ga.Focus) == false) { return; } //btnAdd.Visible = ga.AddNew; //btnQuery.Visible = ga.Query; }
//------------------------------------------------------------------------- private void AuthrityControl() { ga = Authrity.GetGroupRight(); if (Authrity.CheckPageRight(ga.Focus) == false) { return; } btnUpdate.Visible = ga.Update; }