示例#1
0
        public List <UserGroup> GetPrivilege(OleDbConnection conn)
        {
            string           strSql  = "select * from UserGroup";
            List <UserGroup> lstUser = OleDbHlper.GetList <UserGroup>(strSql, conn);

            return(lstUser);
        }
示例#2
0
        public List <Control> GetControl(OleDbConnection conn, string GroupID)
        {
            string           strSql     = "select *  from Control inner join Page on Page.PageID= Control.PageID ";
            List <Control>   lstControl = OleDbHlper.GetList <Control>(strSql, conn);
            OleDbTransaction trans      = conn.BeginTransaction();
            string           strsql     = "select Control.ControlID,Details  from Control inner join Page on Page.PageID= Control.PageID inner join ControlsByGroup on ControlsByGroup.GroupID=? and Control.ControlID=ControlsByGroup.ControlID";
            List <Control>   lstCheck   = OleDbHlper.GetList <Control>(strsql, conn, CommandType.Text, trans,
                                                                       new OleDbParameter("@GroupID", OleDbType.VarWChar)
            {
                Value = GroupID
            });

            for (int i = 0; i < lstCheck.Count; i++)
            {
                for (int j = 0; j < lstControl.Count; j++)
                {
                    if (lstControl[j].ControlID == lstCheck[i].ControlID)
                    {
                        lstControl[j].Details = lstCheck[i].Details;
                    }
                }
            }
            return(lstControl);
        }