public static void ReadLogin(BSONDocument bson, MinIdpUserData data) { if (bson[_ID] is BSONStringElement id) { data.LoginId = id.Value; data.ScreenName = id.Value; } if (bson[FLD_SYSID] is BSONInt64Element sysid) { data.SysId = (ulong)sysid.Value; } if (bson[FLD_PASSWORD] is BSONStringElement pwd) { data.LoginPassword = pwd.Value; } if (bson[FLD_STARTUTC] is BSONDateTimeElement sdt) { data.LoginStartUtc = sdt.Value; } if (bson[FLD_ENDUTC] is BSONDateTimeElement edt) { data.LoginEndUtc = edt.Value; } }
public static void ReadRole(BSONDocument bson, MinIdpUserData data) { if (bson[_ID] is BSONStringElement role) { data.Role = role.Value; } if (bson[FLD_RIGHTS] is BSONStringElement rights) { data.Rights = rights.Value; } }
public static void ReadUser(BSONDocument bson, MinIdpUserData data) { if (bson[_ID] is BSONInt64Element sysid) { data.SysId = ((ulong)sysid.Value).ToString(System.Globalization.CultureInfo.InvariantCulture); } if (bson[FLD_STATUS] is BSONInt32Element status) { data.Status = (UserStatus)status.Value; } if (bson[FLD_ROLE] is BSONStringElement role) { data.Role = role.Value; } if (bson[FLD_CREATEUTC] is BSONDateTimeElement cdt) { data.CreateUtc = cdt.Value; } if (bson[FLD_STARTUTC] is BSONDateTimeElement sdt) { data.StartUtc = sdt.Value; } if (bson[FLD_ENDUTC] is BSONDateTimeElement edt) { data.EndUtc = edt.Value; } if (bson[FLD_NAME] is BSONStringElement name) { data.Name = name.Value; } if (bson[FLD_DESCRIPTION] is BSONStringElement descr) { data.Description = descr.Value; } if (bson[FLD_NOTE] is BSONStringElement note) { data.Note = note.Value; } if (bson[FLD_PROPS] is BSONStringElement props) { data.Props = new Data.ConfigVector(props.Value); } }
public static void ReadUser(BSONDocument bson, MinIdpUserData data) { if (bson[_ID] is BSONInt64Element sysid) { data.SysId = (ulong)sysid.Value; } if (bson[FLD_STATUS] is BSONInt32Element status) { data.Status = (UserStatus)status.Value; } if (bson[FLD_ROLE] is BSONStringElement role) { data.Role = role.Value; } if (bson[FLD_CREATEUTC] is BSONDateTimeElement cdt) { data.CreateUtc = cdt.Value; } if (bson[FLD_STARTUTC] is BSONDateTimeElement sdt) { data.StartUtc = sdt.Value; } if (bson[FLD_ENDUTC] is BSONDateTimeElement edt) { data.EndUtc = edt.Value; } if (bson[FLD_NAME] is BSONStringElement name) { data.Name = name.Value; } if (bson[FLD_DESCRIPTION] is BSONStringElement descr) { data.Description = descr.Value; } if (bson[FLD_NOTE] is BSONStringElement note) { data.Note = note.Value; } }