public override bool Update(QcDbTransaction trans = null) { if (IsNew()) { this.Code = QcRoleEnum.GetNextCode(); } bool ret = base.Update(trans); if (ret == false && IsNew()) { this.Code = ""; } //新建的角色加入到列表 if (ret && !RolesEnums.Contains(this)) { RolesEnums.Add(this); } return(ret); }
/// <summary> /// /// </summary> /// <param name="code">角色编码</param> /// <param name="name">角色名称</param> /// <param name="content"> 备注</param> public QcRoleEnum(string name, string content = "") : this(null) { RoleCode = QcRoleEnum.GetNextCode(); RoleName = name; RoleContent = content; }