示例#1
0
        public MutableDocument ToMutableDocument() => new MutableDocument(CouchbaseId, new Dictionary <string, object>
        {
            { JsonProperties.EntryGuid, EntryGuid.ToString() },
            { JsonProperties.EntryType, EntryType },
            { JsonProperties.FirstName, FirstName },
            { JsonProperties.LastName, LastName },
            { JsonProperties.MaidenName, MaidenName },
            { JsonProperties.DisplayName, DisplayName },
            { JsonProperties.OrganizationName, OrganizationName },
            { JsonProperties.LocationGuid, LocationGuid.ToString() },
            { JsonProperties.SiteGuid, SiteGuid.ToString() },
            { JsonProperties.SiteName, SiteName },
            { JsonProperties.UserStatus, UserStatus },
            { JsonProperties.DepartmentName, DepartmentName },
            { JsonProperties.ResidenceArea, ResidenceArea },
            { JsonProperties.WorkAreaName, WorkAreaName },
            { JsonProperties.TeamName, TeamName },
            { JsonProperties.Contacts, Contacts?.Select(contact => contact.ToDictionary()).ToArray() },
            { JsonProperties.SpouseEntryGuid, SpouseEntryGuid.ToString() },
            { JsonProperties.PersonPrimaryPhotoGuid, PersonPrimaryPhotoGuid.ToString() },
            { JsonProperties.PrimaryPhotoUrl, PrimaryPhotoUrl },
            { JsonProperties.EmergencyContactGuids, EmergencyContactGuids?.Select(guid => guid.ToString()).ToArray() },

            { ICouchbaseDocumentExtensions.JsonProperties.CouchbaseType, CouchbaseType.ToString() },
            { ICouchbaseDocumentExtensions.JsonProperties.CouchbaseId, CouchbaseId },
            { IPerishableDataExtensions.JsonProperties.LastUpdated, LastUpdated },
            { IPerishableDataExtensions.JsonProperties.ExpirationDate, ExpirationDate }
        });
示例#2
0
 public override int GetHashCode()
 {
     unchecked {
         var hashCode = _hashCode;
         hashCode = (hashCode * 397) ^ FullKey.GetHashCode();
         hashCode = (hashCode * 397) ^ (LoadtypeGuid != null ? LoadtypeGuid.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ DeviceCategory.GetHashCode();
         hashCode = (hashCode * 397) ^ LocationGuid.GetHashCode();
         hashCode = (hashCode * 397) ^ DeviceGuid.GetHashCode();
         hashCode = (hashCode * 397) ^ HouseholdKey.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)ThisDeviceType;
         return(hashCode);
     }
 }
示例#3
0
        public OefcKey([NotNull] CalcDeviceDto dto, StrGuid loadtypeGuid)
        {
            HouseholdKey   = dto.HouseholdKey;
            ThisDeviceType = dto.DeviceType;
            DeviceGuid     = dto.Guid;
            LocationGuid   = dto.LocationGuid;
            LoadtypeGuid   = loadtypeGuid;
            DeviceCategory = dto.DeviceCategoryName;
            unchecked
            {
                _hashCode = LocationGuid.GetHashCode();
                if (loadtypeGuid != null)
                {
                    _hashCode = (_hashCode * 397) ^ loadtypeGuid.GetHashCode();
                }

                _hashCode = (_hashCode * 397) ^ DeviceGuid.GetHashCode();
                _hashCode = (_hashCode * 397) ^ HouseholdKey.Key.GetHashCode();
                _hashCode = (_hashCode * 397) ^ (int)ThisDeviceType;
            }
            //needed for the makekey due to compiler error
            FullKey = "";
            FullKey = MakeKey();
        }
示例#4
0
 public override string ToString()
 {
     return(LocationGuid.ToString());
 }
示例#5
0
 public bool Equals(OefcKey other)
 {
     return(_hashCode == other._hashCode && FullKey == other.FullKey && Equals(LoadtypeGuid, other.LoadtypeGuid) && DeviceCategory == other.DeviceCategory && LocationGuid.Equals(other.LocationGuid) && DeviceGuid.Equals(other.DeviceGuid) && HouseholdKey.Equals(other.HouseholdKey) && ThisDeviceType == other.ThisDeviceType);
 }
示例#6
0
 public void AddLocation([NotNull] CalcLocationDto calcloc)
 {
     LocationNames.Add(calcloc.Name);
     LocationGuid.Add(calcloc.Guid);
 }