示例#1
0
        public List <GroupPermission> GetGroupPermissionInfoByGid(IDbCommand icmd, Guid gid)
        {
            icmd.Parameters.Clear();
            MySqlCommand cmd = icmd as MySqlCommand;

            cmd.CommandType = CommandType.Text;
            string sql = @"select id,gid,pid,updatetime from t_group_permission
                            where gid = '{0}'";

            cmd.CommandText = string.Format(sql, gid);
            List <GroupPermission> list = new List <GroupPermission>();
            DataTable dt = new DataTable();

            dt.Load(cmd.ExecuteReader());
            if (dt.Rows.Count > 0)
            {
                GroupPermission info = null;
                foreach (DataRow dr in dt.Rows)
                {
                    info = new GroupPermission();
                    info.AllParse(dr);
                    if (info != null)
                    {
                        list.Add(info);
                    }
                }
            }
            return(list);
        }
示例#2
0
        public GroupPermission GetGroupPermissionInfoById(IDbCommand icmd, Guid id)
        {
            icmd.Parameters.Clear();
            MySqlCommand cmd = icmd as MySqlCommand;

            cmd.CommandType = CommandType.Text;
            string sql = @"select id,gid,pid,updatetime from t_group_permission
                            where id = '{0}'";

            cmd.CommandText = string.Format(sql, id);
            DataTable       dt   = new DataTable();
            GroupPermission info = null;

            dt.Load(cmd.ExecuteReader());
            if (dt.Rows.Count > 0)
            {
                info = new GroupPermission();
                info.AllParse(dt.Rows[0]);
            }
            return(info);
        }