Ejemplo n.º 1
0
        /// <summary>
        /// 根据主键获取实体
        /// </summary>
        /// <returns>实体</returns>
        public RelRoleActionModel Retrieve()
        {
            RelRoleActionModel relroleaction = new RelRoleActionModel();

            DataTable dt = DbUtil.Current.Retrieve(relroleaction);

            if (dt.Rows.Count < 1)
            {
                return(null);
            }

            relroleaction.ConvertFrom(dt);

            return(relroleaction);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 根据条件获取实体集合
        /// </summary>
        /// <param name="pc">pc</param>
        /// <param name="obc">obc</param>
        /// <returns>实体</returns>
        public List <RelRoleActionModel> RetrieveMultiple(ParameterCollection pc, OrderByCollection obc)
        {
            List <RelRoleActionModel> relroleactions = new List <RelRoleActionModel>();

            RelRoleActionModel relroleaction = new RelRoleActionModel();
            DataTable          dt            = DbUtil.Current.RetrieveMultiple(relroleaction, pc, obc);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                relroleaction = new RelRoleActionModel();
                relroleaction.ConvertFrom(dt, i);
                relroleactions.Add(relroleaction);
            }

            return(relroleactions);
        }