コード例 #1
0
        protected override void OnSaving()
        {
            RolePayGroup found = GetRolePayGroup(this.角色, this.薪资组);

            if (found != null && found.标识 != this.标识)
            {
                throw new Exception("角色已具备这个薪资组的权限,不能重复设置.");
            }
            else
            {
                base.OnSaving();
            }
        }
コード例 #2
0
        /// <summary>
        /// 通过 Id 获取线路
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static RolePayGroup GetRolePayGroup(int id)
        {
            RolePayGroup obj = (RolePayGroup)Session.DefaultSession.GetObjectByKey(typeof(RolePayGroup), id);

            return(obj);
        }