private void setValue(Db_BaseUser row) { this.Id = row.Id; this.createdOn = row.createdOn; this.lastLoginIpAddress = row.lastLoginIpAddress; this.lastLoginTime = row.lastLoginTime; this.rolesString = String.Join(",", row.Db_BaseUserRole.Select(p => p.roleName)); this.rolesList = row.Db_BaseUserRole.Select(p => p.roleName).ToList(); this.isDeleted = row.isDeleted; this.isDisabled = row.isDisabled; //时间 this.createdOnString = this.createdOn.ToString("yyyy-MM-dd HH:mm"); if (this.lastLoginTime != null) { this.lastLoginShowTimeString = SysHelps.get2TimeShowString(this.lastLoginTime.Value); this.lastLoginTimeString = this.lastLoginTime.Value.ToString("yyyy-MM-dd HH:mm"); } }
/// <summary> /// 数据库构造 /// </summary> /// <param name="row"></param> public UserBase(Db_BaseUser row) { setValue(row); }