Esempio n. 1
0
        private bool Save(ICollection <PmConfiguratorData> changes)
        {
            if (!HasChanges(changes))
            {
                return(true);
            }

            try
            {
                WaitStart();

                var pm2Operations = new List <PM2Operation>();
                var pmConfigs     = new List <PMConfig>();
                GetPmEntities(changes, null, ref pm2Operations, ref pmConfigs);

                var deletePm2Operations = new List <PM2Operation>();
                var deletePmConfigs     = new List <PMConfig>();
                var dataForDelete       = DataForDelete.Select(p => p.Value).ToArray();
                GetPmEntities(dataForDelete, (item => item != null && !string.IsNullOrEmpty(item.PmCode)), ref deletePm2Operations, ref deletePmConfigs);

                List <string> errors;
                using (var manager = IoC.Instance.Resolve <IBPProcessManager>())
                {
                    errors = manager.SavePmConfiguratorData(pm2Operations, pmConfigs, deletePm2Operations, deletePmConfigs);
                }

                if (errors != null && errors.Count > 0)
                {
                    var message = string.Format(Properties.Resources.ValidationError, Environment.NewLine,
                                                string.Join(Environment.NewLine, errors.Distinct()));

                    var vs = GetViewService();
                    vs.ShowDialog(StringResources.Error
                                  , message
                                  , MessageBoxButton.OK
                                  , MessageBoxImage.Error
                                  , MessageBoxResult.Yes);

                    return(false);
                }

                AcceptChanges(ItemsSource);
                IsDeleted.Clear();
                DataForDelete.Clear();

                return(true);
            }
            catch (Exception ex)
            {
                if (!ExceptionHandler(ex, ExceptionResources.ItemCantSave))
                {
                    throw;
                }
                return(false);
            }
            finally
            {
                WaitStop();
            }
        }
Esempio n. 2
0
 /// <summary>
 /// 删除权限
 /// </summary>
 /// <param name="isDeleted"></param>
 /// <param name="ids">权限ID字符串,多个以逗号隔开</param>
 /// <returns></returns>
 private ResponseModel UpdateIsDelete(IsDeleted isDeleted, string ids)
 {
     using (_dbContext)
     {
         if (ToolService.DbType.Equals("mysql"))
         {
             var parameters     = ids.Split(",").Select((id, index) => new MySqlParameter(string.Format("@p{0}", index), id)).ToList();
             var parameterNames = string.Join(", ", parameters.Select(p => p.ParameterName));
             var sql            = string.Format("UPDATE DncPermission SET IsDeleted=@IsDeleted WHERE Code IN ({0})", parameterNames);
             parameters.Add(new MySqlParameter("@IsDeleted", (int)isDeleted));
             _dbContext.Database.ExecuteSqlCommand(sql, parameters);
             var response = ResponseModelFactory.CreateInstance;
             return(response);
         }
         else
         {
             var parameters     = ids.Split(",").Select((id, index) => new SqlParameter(string.Format("@p{0}", index), id)).ToList();
             var parameterNames = string.Join(", ", parameters.Select(p => p.ParameterName));
             var sql            = string.Format("UPDATE DncPermission SET IsDeleted=@IsDeleted WHERE Code IN ({0})", parameterNames);
             parameters.Add(new SqlParameter("@IsDeleted", (int)isDeleted));
             _dbContext.Database.ExecuteSqlCommand(sql, parameters);
             var response = ResponseModelFactory.CreateInstance;
             return(response);
         }
     }
 }
Esempio n. 3
0
        private async void GetData()
        {
            ItemsSource = null;

            try
            {
                WaitStart();
                IsDeleted.Clear();
                DataForDelete.Clear();
                var data = await GetDataAsync();

                if (data == null)
                {
                    return;
                }

                var itemsSource = new ObservableCollection <PmConfiguratorData>(data);
                AcceptChanges(itemsSource);
                ItemsSource = itemsSource;
            }
            catch (Exception ex)
            {
                if (!ExceptionHandler(ex, ExceptionResources.ItemCantRefresh))
                {
                    throw;
                }
            }
            finally
            {
                WaitStop();
            }
        }
 protected void ToString(List <string> toStringOutput)
 {
     toStringOutput.Add($"Type = {(Type == null ? "null" : Type.ToString())}");
     toStringOutput.Add($"Id = {(Id == null ? "null" : Id == string.Empty ? "" : Id)}");
     toStringOutput.Add($"UpdatedAt = {(UpdatedAt == null ? "null" : UpdatedAt == string.Empty ? "" : UpdatedAt)}");
     toStringOutput.Add($"Version = {(Version == null ? "null" : Version.ToString())}");
     toStringOutput.Add($"IsDeleted = {(IsDeleted == null ? "null" : IsDeleted.ToString())}");
     toStringOutput.Add($"CustomAttributeValues = {(CustomAttributeValues == null ? "null" : CustomAttributeValues.ToString())}");
     toStringOutput.Add($"CatalogV1Ids = {(CatalogV1Ids == null ? "null" : $"[{ string.Join(", ", CatalogV1Ids)} ]")}");
     toStringOutput.Add($"PresentAtAllLocations = {(PresentAtAllLocations == null ? "null" : PresentAtAllLocations.ToString())}");
     toStringOutput.Add($"PresentAtLocationIds = {(PresentAtLocationIds == null ? "null" : $"[{ string.Join(", ", PresentAtLocationIds)} ]")}");
     toStringOutput.Add($"AbsentAtLocationIds = {(AbsentAtLocationIds == null ? "null" : $"[{ string.Join(", ", AbsentAtLocationIds)} ]")}");
     toStringOutput.Add($"ImageId = {(ImageId == null ? "null" : ImageId == string.Empty ? "" : ImageId)}");
     toStringOutput.Add($"ItemData = {(ItemData == null ? "null" : ItemData.ToString())}");
     toStringOutput.Add($"CategoryData = {(CategoryData == null ? "null" : CategoryData.ToString())}");
     toStringOutput.Add($"ItemVariationData = {(ItemVariationData == null ? "null" : ItemVariationData.ToString())}");
     toStringOutput.Add($"TaxData = {(TaxData == null ? "null" : TaxData.ToString())}");
     toStringOutput.Add($"DiscountData = {(DiscountData == null ? "null" : DiscountData.ToString())}");
     toStringOutput.Add($"ModifierListData = {(ModifierListData == null ? "null" : ModifierListData.ToString())}");
     toStringOutput.Add($"ModifierData = {(ModifierData == null ? "null" : ModifierData.ToString())}");
     toStringOutput.Add($"TimePeriodData = {(TimePeriodData == null ? "null" : TimePeriodData.ToString())}");
     toStringOutput.Add($"ProductSetData = {(ProductSetData == null ? "null" : ProductSetData.ToString())}");
     toStringOutput.Add($"PricingRuleData = {(PricingRuleData == null ? "null" : PricingRuleData.ToString())}");
     toStringOutput.Add($"ImageData = {(ImageData == null ? "null" : ImageData.ToString())}");
     toStringOutput.Add($"MeasurementUnitData = {(MeasurementUnitData == null ? "null" : MeasurementUnitData.ToString())}");
     toStringOutput.Add($"SubscriptionPlanData = {(SubscriptionPlanData == null ? "null" : SubscriptionPlanData.ToString())}");
     toStringOutput.Add($"ItemOptionData = {(ItemOptionData == null ? "null" : ItemOptionData.ToString())}");
     toStringOutput.Add($"ItemOptionValueData = {(ItemOptionValueData == null ? "null" : ItemOptionValueData.ToString())}");
     toStringOutput.Add($"CustomAttributeDefinitionData = {(CustomAttributeDefinitionData == null ? "null" : CustomAttributeDefinitionData.ToString())}");
     toStringOutput.Add($"QuickAmountsSettingsData = {(QuickAmountsSettingsData == null ? "null" : QuickAmountsSettingsData.ToString())}");
 }
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                var hashCode = 41;
                // Suitable nullity checks etc, of course :)
                if (Uuid != null)
                {
                    hashCode = hashCode * 59 + Uuid.GetHashCode();
                }
                if (Username != null)
                {
                    hashCode = hashCode * 59 + Username.GetHashCode();
                }
                if (Name != null)
                {
                    hashCode = hashCode * 59 + Name.GetHashCode();
                }
                if (Surname != null)
                {
                    hashCode = hashCode * 59 + Surname.GetHashCode();
                }
                if (Email != null)
                {
                    hashCode = hashCode * 59 + Email.GetHashCode();
                }
                if (PhoneNumber != null)
                {
                    hashCode = hashCode * 59 + PhoneNumber.GetHashCode();
                }
                if (Password != null)
                {
                    hashCode = hashCode * 59 + Password.GetHashCode();
                }
                if (HashedPassword != null)
                {
                    hashCode = hashCode * 59 + HashedPassword.GetHashCode();
                }

                hashCode = hashCode * 59 + IsDeleted.GetHashCode();
                if (DeletedTime != null)
                {
                    hashCode = hashCode * 59 + DeletedTime.GetHashCode();
                }
                if (Avatar != null)
                {
                    hashCode = hashCode * 59 + Avatar.GetHashCode();
                }
                if (LdapAuthenticationMode != null)
                {
                    hashCode = hashCode * 59 + LdapAuthenticationMode.GetHashCode();
                }
                if (Roles != null)
                {
                    hashCode = hashCode * 59 + Roles.GetHashCode();
                }
                return(hashCode);
            }
        }
        public override int GetHashCode()
        {
            int hashResult = Name == null ? 0 : Name.GetHashCode();

            hashResult ^= IsVisible.GetHashCode();
            hashResult ^= IsSystem.GetHashCode();
            hashResult ^= IsDeleted.GetHashCode();
            return(hashResult);
        }
Esempio n. 7
0
        public override int GetHashCode()
        {
            int hash = 17;

            hash = hash * 31 + (Id == null ? 0 : Id.GetHashCode());
            hash = hash * 31 + (Author == null ? 0 : Author.GetHashCode());
            hash = hash * 31 + (Kind == null ? 0 : Kind.GetHashCode());
            hash = hash * 31 + (CreateDate == null ? 0 : CreateDate.GetHashCode());
            hash = hash * 31 + IsDeleted.GetHashCode();
            return(hash);
        }
 private void FileSystemWatcherRegEx_Deleted(object sender, FileSystemEventArgs e)
 {
     if (RegexPattern == null)
     {
         IsDeleted?.Invoke(sender, e);
     }
     else if (Matches(e.Name))
     {
         IsDeleted?.Invoke(sender, e);
     }
 }
Esempio n. 9
0
        internal IDictionary <string, object> GetAllValues()
        {
            var values = new Dictionary <string, object>();

            values.Add("Id", Id);
            values.Add("NodeTypeId", NodeTypeId);
            values.Add("NodeType", FormatNodeType(NodeTypeId));
            values.Add("ContentListId", ContentListId);
            values.Add("ContentListTypeId", ContentListTypeId);
            values.Add("ParentId", ParentId);
            values.Add("Name", Name);
            values.Add("DisplayName", DisplayName);
            values.Add("Path", Path);
            values.Add("Index", Index);
            values.Add("CreatingInProgress", CreatingInProgress.ToString().ToLower());
            values.Add("IsDeleted", IsDeleted.ToString().ToLower());
            values.Add("IsInherited", IsInherited.ToString().ToLower());
            values.Add("CreationDate", FormatDate(CreationDate));
            values.Add("ModificationDate", FormatDate(ModificationDate));
            values.Add("CreatedById", CreatedById);
            values.Add("CreatedBy", FormatUser(CreatedById));
            values.Add("ModifiedById", ModifiedById);
            values.Add("ModifiedBy", FormatUser(ModifiedById));
            values.Add("VersionId", VersionId);
            values.Add("Version", Version.ToString());
            values.Add("VersionCreationDate", FormatDate(VersionCreationDate));
            values.Add("VersionModificationDate", FormatDate(VersionModificationDate));
            values.Add("VersionCreatedById", VersionCreatedById);
            values.Add("VersionCreatedBy", FormatUser(VersionCreatedById));
            values.Add("VersionModifiedById", VersionModifiedById);
            values.Add("VersionModifiedBy", FormatUser(VersionModifiedById));
            values.Add("Locked", Locked.ToString().ToLower());
            values.Add("LockedById", LockedById);
            values.Add("LockedBy", FormatUser(LockedById));
            values.Add("ETag", ETag);
            values.Add("LockType", LockType);
            values.Add("LockTimeout", LockTimeout);
            values.Add("LockDate", FormatDate(LockDate));
            values.Add("LockToken", LockToken);
            values.Add("LastLockUpdate", FormatDate(LastLockUpdate));
            values.Add("IsSystem", IsSystem.ToString().ToLower());
            values.Add("ClosestSecurityNodeId", ClosestSecurityNodeId);
            values.Add("SavingState", SavingState);

            foreach (var key in dynamicData.Keys)
            {
                var propType = ActiveSchema.PropertyTypes.GetItemById(key);
                if (propType != null)
                {
                    values.Add(propType.Name.Replace("#", "_"), FormatDynamicData(dynamicData[key] ?? string.Empty, propType.DataType));
                }
            }
            return(values);
        }
Esempio n. 10
0
 public override int GetHashCode()
 {
     unchecked {
         int result = (ProviderKey != null ? ProviderKey.GetHashCode() : 0);
         result = (result * 397) ^ IsDeleted.GetHashCode();
         result = (result * 397) ^ Id.GetHashCode();
         result = (result * 397) ^ (Fields != null ? Fields.GetHashCode() : 0);
         result = (result * 397) ^ (Tags != null ? Tags.GetHashCode() : 0);
         result = (result * 397) ^ (Notes != null ? Notes.GetHashCode() : 0);
         return(result);
     }
 }
Esempio n. 11
0
 public override int GetHashCode()
 {
     unchecked
     {
         int result = Id.GetHashCode();
         result = (result * 397) ^ (IsDeleted.GetHashCode());
         result = (result * 397) ^ (Title != null ? Title.GetHashCode() : 0);
         result = (result * 397) ^ (Description != null ? Description.GetHashCode() : 0);
         result = (result * 397) ^ (TotalHours.HasValue ? TotalHours.Value : 0).GetHashCode();
         return(result);
     }
 }
Esempio n. 12
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = (NodeRef != null ? NodeRef.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ IsDeleted.GetHashCode();
         hashCode = (hashCode * 397) ^ CreationTime.GetHashCode();
         hashCode = (hashCode * 397) ^ ModificationTime.GetHashCode();
         hashCode = (hashCode * 397) ^ (Properties != null ? Properties.GetHashCode() : 0);
         return(hashCode);
     }
 }
Esempio n. 13
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Payload != null ? Payload.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Sender != null ? Sender.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (PersistenceId != null ? PersistenceId.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ IsDeleted.GetHashCode();
         hashCode = (hashCode * 397) ^ SequenceNr.GetHashCode();
         hashCode = (hashCode * 397) ^ (Manifest != null ? Manifest.GetHashCode() : 0);
         return(hashCode);
     }
 }
Esempio n. 14
0
        public override bool Equals(object obj)
        {
            CountEntry other = obj as CountEntry;

            if (other != null)
            {
                if (!Itmref.Equals(other.Itmref))
                {
                    return(false);
                }
                if (!LabelNumber.Equals(other.LabelNumber))
                {
                    return(false);
                }
                if (!Value.Equals(other.Value))
                {
                    return(false);
                }
                if (!Unit.Equals(other.Unit))
                {
                    return(false);
                }
                if (!Time.Equals(other.Time))
                {
                    return(false);
                }
                if (!IsDeleted.Equals(other.IsDeleted))
                {
                    return(false);
                }
                if (!Hash.Equals(other.Hash))
                {
                    return(false);
                }
                if (!Sync.Equals(other.Sync))
                {
                    return(false);
                }
                if (SyncCode != other.SyncCode)
                {
                    return(false);
                }
                if (!Location.Equals(other.Location))
                {
                    return(false);
                }
                return(true);
            }

            return(base.Equals(obj));
        }
        /// <summary>
        /// 删除权限
        /// </summary>
        /// <param name="isDeleted"></param>
        /// <param name="ids">权限ID字符串,多个以逗号隔开</param>
        /// <returns></returns>
        private async Task <ResponseModel> UpdateIsDelete(IsDeleted isDeleted, string ids)
        {
            await using (_dbContext)
            {
                var parameters     = ids.Split(",").Select((id, index) => new SqlParameter(string.Format("@p{0}", index), id)).ToList();
                var parameterNames = string.Join(", ", parameters.Select(p => p.ParameterName));
                var sql            = $"UPDATE DncPermission SET IsDeleted=@IsDeleted WHERE Code IN ({parameterNames})";
                parameters.Add(new SqlParameter("@IsDeleted", (int)isDeleted));
                await _dbContext.Database.ExecuteSqlCommandAsync(sql, parameters);

                var response = ResponseModelFactory.CreateInstance;
                return(response);
            }
        }
Esempio n. 16
0
        public string GetProperty(string propertyName, string format, System.Globalization.CultureInfo formatProvider, Entities.Users.UserInfo accessingUser, Scope accessLevel, ref bool propertyNotFound)
        {
            string OutputFormat = string.Empty;

            if (format == string.Empty)
            {
                OutputFormat = "g";
            }
            else
            {
                OutputFormat = format;
            }
            propertyName = propertyName.ToLowerInvariant();
            switch (propertyName)
            {
            case "journalid":
                return(PropertyAccess.FormatString(JournalId.ToString(), format));

            case "journaltypeid":
                return(PropertyAccess.FormatString(JournalTypeId.ToString(), format));

            case "profileid":
                return(PropertyAccess.FormatString(ProfileId.ToString(), format));

            case "socialgroupid":
                return(PropertyAccess.FormatString(SocialGroupId.ToString(), format));

            case "datecreated":
                return(PropertyAccess.FormatString(DateCreated.ToString(), format));

            case "title":
                return(PropertyAccess.FormatString(Title, format));

            case "summary":
                return(PropertyAccess.FormatString(Summary, format));

            case "body":
                return(PropertyAccess.FormatString(Body, format));

            case "timeframe":
                return(PropertyAccess.FormatString(TimeFrame, format));

            case "isdeleted":
                return(IsDeleted.ToString());
            }

            propertyNotFound = true;
            return(string.Empty);
        }
Esempio n. 17
0
 /// <inheritdoc/>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Payload != null ? Payload.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Manifest != null ? Manifest.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (PersistenceId != null ? PersistenceId.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ SequenceNr.GetHashCode();
         hashCode = (hashCode * 397) ^ IsDeleted.GetHashCode();
         hashCode = (hashCode * 397) ^ (Sender != null ? Sender.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (WriterGuid != null ? WriterGuid.GetHashCode() : 0);
         // timestamp not included in equals for backwards compatibility
         return(hashCode);
     }
 }
 /*
  * If ContinueOnError argument is 'true', return the exception else nope.
  */
 private void DeleteBlobFromAzureStorage(CodeActivityContext context)
 {
     try {
         AzureParamHelper azureStorageHelper = new AzureParamHelper(StorageConnectionString.Get(context), StorageBlobContainer.Get(context));
         IsDeleted.Set(context, AzureHelper.DeleteBlobFromAzureStorage(BlobReference.Get(context)));
     } catch (Exception ex) {
         if (Convert.ToBoolean((int)ContinueOnError))
         {
         }
         else
         {
             throw ex;
         }
     }
 }
Esempio n. 19
0
        public Task Handle(object command)
        {
            return(command switch
            {
                V1.RegisterCustomer cmd =>
                HandleCreate(cmd),
                V1.UpdateCustomerFullName cmd =>
                HandleUpdate(cmd.CustomerId, profile => profile.UpdateName(FullName.FromString(cmd.FullName))),

                V1.UpdateCustomerEmail cmd =>
                HandleUpdate(
                    cmd.CustomerId,
                    profile => profile.UpdateEmail(
                        Email.FromString(cmd.Email)
                        )
                    ),
                V1.UpdateCustomerAdresse cmd =>
                HandleUpdate(
                    cmd.CustomerId,
                    profile => profile.UpdateAdresse(
                        new Adresse(Street.FromString(cmd.Street), ZipCode.FromInt(cmd.ZipCode), City.FromString(cmd.City))
                        )
                    ),
                V1.ChangeCustomerType cmd =>
                HandleUpdate(
                    cmd.CustomerId,
                    profile => profile.ChangeCustomerType(
                        CustomerType.FromString(cmd.CustomerType.ToString())
                        )
                    ),
                V1.UpdateCustomerPhoneNo cmd =>
                HandleUpdate(
                    cmd.CustomerId,
                    profile => profile.UpdatePhoneNo(
                        PhoneNo.FromInt(cmd.PhoneNo)
                        )
                    ),

                V1.DeleteCustomer cmd =>
                HandleUpdate(
                    cmd.CustomerId,
                    profile => profile.DeleteCustomer(
                        IsDeleted.FromBool(cmd.IsDeleted)
                        )
                    ),
                _ => Task.CompletedTask
            });
Esempio n. 20
0
 /// <summary>
 /// 删除用户
 /// </summary>
 /// <param name="isDeleted"></param>
 /// <param name="ids">用户ID字符串,多个以逗号隔开</param>
 /// <returns></returns>
 private ResponseModel UpdateIsDelete(IsDeleted isDeleted, string ids)
 {
     using (_dbContext)
     {
         //var idList = ids.Split(",").ToList();
         ////idList.ForEach(x => {
         ////  _dbContext.Database.ExecuteSqlCommand($"UPDATE DncUser SET IsDeleted=1 WHERE Id = {x}");
         ////});
         //_dbContext.Database.ExecuteSqlCommand($"UPDATE DncUser SET IsDeleted={(int)isDeleted} WHERE Id IN ({ids})");
         var parameters     = ids.Split(",").Select((id, index) => new SqlParameter(string.Format("@p{0}", index), id)).ToList();
         var parameterNames = string.Join(", ", parameters.Select(p => p.ParameterName));
         var sql            = string.Format("UPDATE DncUser SET IsDeleted=@IsDeleted WHERE Id IN ({0})", parameterNames);
         parameters.Add(new SqlParameter("@IsDeleted", (int)isDeleted));
         _dbContext.Database.ExecuteSqlCommand(sql, parameters);
         var response = ResponseModelFactory.CreateInstance;
         return(response);
     }
 }
Esempio n. 21
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is CatalogObject other &&
                   ((Type == null && other.Type == null) || (Type?.Equals(other.Type) == true)) &&
                   ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) &&
                   ((UpdatedAt == null && other.UpdatedAt == null) || (UpdatedAt?.Equals(other.UpdatedAt) == true)) &&
                   ((Version == null && other.Version == null) || (Version?.Equals(other.Version) == true)) &&
                   ((IsDeleted == null && other.IsDeleted == null) || (IsDeleted?.Equals(other.IsDeleted) == true)) &&
                   ((CustomAttributeValues == null && other.CustomAttributeValues == null) || (CustomAttributeValues?.Equals(other.CustomAttributeValues) == true)) &&
                   ((CatalogV1Ids == null && other.CatalogV1Ids == null) || (CatalogV1Ids?.Equals(other.CatalogV1Ids) == true)) &&
                   ((PresentAtAllLocations == null && other.PresentAtAllLocations == null) || (PresentAtAllLocations?.Equals(other.PresentAtAllLocations) == true)) &&
                   ((PresentAtLocationIds == null && other.PresentAtLocationIds == null) || (PresentAtLocationIds?.Equals(other.PresentAtLocationIds) == true)) &&
                   ((AbsentAtLocationIds == null && other.AbsentAtLocationIds == null) || (AbsentAtLocationIds?.Equals(other.AbsentAtLocationIds) == true)) &&
                   ((ImageId == null && other.ImageId == null) || (ImageId?.Equals(other.ImageId) == true)) &&
                   ((ItemData == null && other.ItemData == null) || (ItemData?.Equals(other.ItemData) == true)) &&
                   ((CategoryData == null && other.CategoryData == null) || (CategoryData?.Equals(other.CategoryData) == true)) &&
                   ((ItemVariationData == null && other.ItemVariationData == null) || (ItemVariationData?.Equals(other.ItemVariationData) == true)) &&
                   ((TaxData == null && other.TaxData == null) || (TaxData?.Equals(other.TaxData) == true)) &&
                   ((DiscountData == null && other.DiscountData == null) || (DiscountData?.Equals(other.DiscountData) == true)) &&
                   ((ModifierListData == null && other.ModifierListData == null) || (ModifierListData?.Equals(other.ModifierListData) == true)) &&
                   ((ModifierData == null && other.ModifierData == null) || (ModifierData?.Equals(other.ModifierData) == true)) &&
                   ((TimePeriodData == null && other.TimePeriodData == null) || (TimePeriodData?.Equals(other.TimePeriodData) == true)) &&
                   ((ProductSetData == null && other.ProductSetData == null) || (ProductSetData?.Equals(other.ProductSetData) == true)) &&
                   ((PricingRuleData == null && other.PricingRuleData == null) || (PricingRuleData?.Equals(other.PricingRuleData) == true)) &&
                   ((ImageData == null && other.ImageData == null) || (ImageData?.Equals(other.ImageData) == true)) &&
                   ((MeasurementUnitData == null && other.MeasurementUnitData == null) || (MeasurementUnitData?.Equals(other.MeasurementUnitData) == true)) &&
                   ((SubscriptionPlanData == null && other.SubscriptionPlanData == null) || (SubscriptionPlanData?.Equals(other.SubscriptionPlanData) == true)) &&
                   ((ItemOptionData == null && other.ItemOptionData == null) || (ItemOptionData?.Equals(other.ItemOptionData) == true)) &&
                   ((ItemOptionValueData == null && other.ItemOptionValueData == null) || (ItemOptionValueData?.Equals(other.ItemOptionValueData) == true)) &&
                   ((CustomAttributeDefinitionData == null && other.CustomAttributeDefinitionData == null) || (CustomAttributeDefinitionData?.Equals(other.CustomAttributeDefinitionData) == true)) &&
                   ((QuickAmountsSettingsData == null && other.QuickAmountsSettingsData == null) || (QuickAmountsSettingsData?.Equals(other.QuickAmountsSettingsData) == true)));
        }
 /// <summary>
 /// Equality method between two objects of the same type.
 /// Because the Equals method is strongly typed by generic constraints,
 /// it is not necessary to test for the correct object type.
 /// For safety we just want to match on business key value - in this case the fields
 /// that cannot be different between the two objects if they are supposedly equal.
 /// </summary>
 /// <param name="obj">The other object of this type that we are testing equality with</param>
 /// <returns></returns>
 public virtual bool Equals(DomainEntityBase <TIdType> obj)
 {
     if (obj != null)
     {
         // Transient objects are not considered as equal
         if (IsTransient() && obj.IsTransient())
         {
             return(false);
         }
         else
         {
             // For safe equality we need to match on business key equality.
             // Base domain entities are functionally equal if their key and metadata are equal.
             // Subclasses should extend to include their own enhanced equality checks, as required.
             return(Id.Equals(obj.Id) && Culture.Equals(obj.Culture) &&
                    IsActive.Equals(obj.IsActive) && IsDeleted.Equals(obj.IsDeleted));
         }
     }
     return(false);
 }
Esempio n. 23
0
 public FindRoleSpecification(Status status, IsDeleted isDeleted)
 {
     Query.Where(x => x.Status == status && x.IsDeleted == isDeleted);
 }
Esempio n. 24
0
 public override string ToString()
 {
     return("Id:" + Id.ToString()
            + "\nLastDate:" + LastDate.ToString()
            + "\nIsDeleted:" + IsDeleted.ToString());
 }
Esempio n. 25
0
        public bool Equals(GeneralUser input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     MembershipId == input.MembershipId ||
                     (MembershipId.Equals(input.MembershipId))
                     ) &&
                 (
                     UniqueName == input.UniqueName ||
                     (UniqueName != null && UniqueName.Equals(input.UniqueName))
                 ) &&
                 (
                     NormalizedName == input.NormalizedName ||
                     (NormalizedName != null && NormalizedName.Equals(input.NormalizedName))
                 ) &&
                 (
                     DisplayName == input.DisplayName ||
                     (DisplayName != null && DisplayName.Equals(input.DisplayName))
                 ) &&
                 (
                     ProfilePicture == input.ProfilePicture ||
                     (ProfilePicture.Equals(input.ProfilePicture))
                 ) &&
                 (
                     ProfileTheme == input.ProfileTheme ||
                     (ProfileTheme.Equals(input.ProfileTheme))
                 ) &&
                 (
                     UserTitle == input.UserTitle ||
                     (UserTitle.Equals(input.UserTitle))
                 ) &&
                 (
                     SuccessMessageFlags == input.SuccessMessageFlags ||
                     (SuccessMessageFlags.Equals(input.SuccessMessageFlags))
                 ) &&
                 (
                     IsDeleted == input.IsDeleted ||
                     (IsDeleted != null && IsDeleted.Equals(input.IsDeleted))
                 ) &&
                 (
                     About == input.About ||
                     (About != null && About.Equals(input.About))
                 ) &&
                 (
                     FirstAccess == input.FirstAccess ||
                     (FirstAccess != null && FirstAccess.Equals(input.FirstAccess))
                 ) &&
                 (
                     LastUpdate == input.LastUpdate ||
                     (LastUpdate != null && LastUpdate.Equals(input.LastUpdate))
                 ) &&
                 (
                     LegacyPortalUid == input.LegacyPortalUid ||
                     (LegacyPortalUid.Equals(input.LegacyPortalUid))
                 ) &&
                 (
                     Context == input.Context ||
                     (Context != null && Context.Equals(input.Context))
                 ) &&
                 (
                     PsnDisplayName == input.PsnDisplayName ||
                     (PsnDisplayName != null && PsnDisplayName.Equals(input.PsnDisplayName))
                 ) &&
                 (
                     XboxDisplayName == input.XboxDisplayName ||
                     (XboxDisplayName != null && XboxDisplayName.Equals(input.XboxDisplayName))
                 ) &&
                 (
                     FbDisplayName == input.FbDisplayName ||
                     (FbDisplayName != null && FbDisplayName.Equals(input.FbDisplayName))
                 ) &&
                 (
                     ShowActivity == input.ShowActivity ||
                     (ShowActivity != null && ShowActivity.Equals(input.ShowActivity))
                 ) &&
                 (
                     Locale == input.Locale ||
                     (Locale != null && Locale.Equals(input.Locale))
                 ) &&
                 (
                     LocaleInheritDefault == input.LocaleInheritDefault ||
                     (LocaleInheritDefault != null && LocaleInheritDefault.Equals(input.LocaleInheritDefault))
                 ) &&
                 (
                     LastBanReportId == input.LastBanReportId ||
                     (LastBanReportId.Equals(input.LastBanReportId))
                 ) &&
                 (
                     ShowGroupMessaging == input.ShowGroupMessaging ||
                     (ShowGroupMessaging != null && ShowGroupMessaging.Equals(input.ShowGroupMessaging))
                 ) &&
                 (
                     ProfilePicturePath == input.ProfilePicturePath ||
                     (ProfilePicturePath != null && ProfilePicturePath.Equals(input.ProfilePicturePath))
                 ) &&
                 (
                     ProfilePictureWidePath == input.ProfilePictureWidePath ||
                     (ProfilePictureWidePath != null && ProfilePictureWidePath.Equals(input.ProfilePictureWidePath))
                 ) &&
                 (
                     ProfileThemeName == input.ProfileThemeName ||
                     (ProfileThemeName != null && ProfileThemeName.Equals(input.ProfileThemeName))
                 ) &&
                 (
                     UserTitleDisplay == input.UserTitleDisplay ||
                     (UserTitleDisplay != null && UserTitleDisplay.Equals(input.UserTitleDisplay))
                 ) &&
                 (
                     StatusText == input.StatusText ||
                     (StatusText != null && StatusText.Equals(input.StatusText))
                 ) &&
                 (
                     StatusDate == input.StatusDate ||
                     (StatusDate != null && StatusDate.Equals(input.StatusDate))
                 ) &&
                 (
                     ProfileBanExpire == input.ProfileBanExpire ||
                     (ProfileBanExpire != null && ProfileBanExpire.Equals(input.ProfileBanExpire))
                 ) &&
                 (
                     BlizzardDisplayName == input.BlizzardDisplayName ||
                     (BlizzardDisplayName != null && BlizzardDisplayName.Equals(input.BlizzardDisplayName))
                 ) &&
                 (
                     SteamDisplayName == input.SteamDisplayName ||
                     (SteamDisplayName != null && SteamDisplayName.Equals(input.SteamDisplayName))
                 ) &&
                 (
                     StadiaDisplayName == input.StadiaDisplayName ||
                     (StadiaDisplayName != null && StadiaDisplayName.Equals(input.StadiaDisplayName))
                 ) &&
                 (
                     TwitchDisplayName == input.TwitchDisplayName ||
                     (TwitchDisplayName != null && TwitchDisplayName.Equals(input.TwitchDisplayName))
                 ) &&
                 (
                     CachedBungieGlobalDisplayName == input.CachedBungieGlobalDisplayName ||
                     (CachedBungieGlobalDisplayName != null && CachedBungieGlobalDisplayName.Equals(input.CachedBungieGlobalDisplayName))
                 ) &&
                 (
                     CachedBungieGlobalDisplayNameCode == input.CachedBungieGlobalDisplayNameCode ||
                     (CachedBungieGlobalDisplayNameCode.Equals(input.CachedBungieGlobalDisplayNameCode))
                 ));
        }
 public FindMenuSpecification(IsDeleted isDeleted, Status status)
 {
     Query.Where(m => m.IsDeleted == isDeleted && m.Status == status);
 }
 public FindMenuSpecification(IEnumerable <Guid> ids, IsDeleted isDeleted, Status status)
 {
     Query.Where(m => ids.Contains(m.Guid) && m.IsDeleted == isDeleted && m.Status == status);
 }
Esempio n. 28
0
        public override int GetHashCode()
        {
            int hashCode = -1814270990;

            if (Type != null)
            {
                hashCode += Type.GetHashCode();
            }

            if (Id != null)
            {
                hashCode += Id.GetHashCode();
            }

            if (UpdatedAt != null)
            {
                hashCode += UpdatedAt.GetHashCode();
            }

            if (Version != null)
            {
                hashCode += Version.GetHashCode();
            }

            if (IsDeleted != null)
            {
                hashCode += IsDeleted.GetHashCode();
            }

            if (CustomAttributeValues != null)
            {
                hashCode += CustomAttributeValues.GetHashCode();
            }

            if (CatalogV1Ids != null)
            {
                hashCode += CatalogV1Ids.GetHashCode();
            }

            if (PresentAtAllLocations != null)
            {
                hashCode += PresentAtAllLocations.GetHashCode();
            }

            if (PresentAtLocationIds != null)
            {
                hashCode += PresentAtLocationIds.GetHashCode();
            }

            if (AbsentAtLocationIds != null)
            {
                hashCode += AbsentAtLocationIds.GetHashCode();
            }

            if (ImageId != null)
            {
                hashCode += ImageId.GetHashCode();
            }

            if (ItemData != null)
            {
                hashCode += ItemData.GetHashCode();
            }

            if (CategoryData != null)
            {
                hashCode += CategoryData.GetHashCode();
            }

            if (ItemVariationData != null)
            {
                hashCode += ItemVariationData.GetHashCode();
            }

            if (TaxData != null)
            {
                hashCode += TaxData.GetHashCode();
            }

            if (DiscountData != null)
            {
                hashCode += DiscountData.GetHashCode();
            }

            if (ModifierListData != null)
            {
                hashCode += ModifierListData.GetHashCode();
            }

            if (ModifierData != null)
            {
                hashCode += ModifierData.GetHashCode();
            }

            if (TimePeriodData != null)
            {
                hashCode += TimePeriodData.GetHashCode();
            }

            if (ProductSetData != null)
            {
                hashCode += ProductSetData.GetHashCode();
            }

            if (PricingRuleData != null)
            {
                hashCode += PricingRuleData.GetHashCode();
            }

            if (ImageData != null)
            {
                hashCode += ImageData.GetHashCode();
            }

            if (MeasurementUnitData != null)
            {
                hashCode += MeasurementUnitData.GetHashCode();
            }

            if (SubscriptionPlanData != null)
            {
                hashCode += SubscriptionPlanData.GetHashCode();
            }

            if (ItemOptionData != null)
            {
                hashCode += ItemOptionData.GetHashCode();
            }

            if (ItemOptionValueData != null)
            {
                hashCode += ItemOptionValueData.GetHashCode();
            }

            if (CustomAttributeDefinitionData != null)
            {
                hashCode += CustomAttributeDefinitionData.GetHashCode();
            }

            if (QuickAmountsSettingsData != null)
            {
                hashCode += QuickAmountsSettingsData.GetHashCode();
            }

            return(hashCode);
        }
Esempio n. 29
0
 public override string ToString()
 {
     return(string.Format("Entity ID:{0}, Modified:{1} Deleted:{2} ({3})",
                          ID.Format(), IsModified.Format(), IsDeleted.Format(), Data));
 }
Esempio n. 30
0
 public void SetIsDeleted(IsDeleted isDeleted)
 {
     this.IsDeleted = (int)isDeleted;
 }