private bool CanHandle(ItemEvent arg)
        {
            if (BeforeAction != arg.BeforeAction)
            {
                return(false);
            }

            if (EventType != arg.EventType)
            {
                return(false);
            }

            if (!ItemId.Equals(arg.ItemUID))
            {
                return(false);
            }

            if (Modes.Count > 0 && !Modes.Contains((BoFormMode)arg.FormMode))
            {
                return(false);
            }

            if (ColumnIds.Count > 0 && !ColumnIds.Contains(arg.ColUID))
            {
                return(false);
            }

            return(true);
        }
Exemple #2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

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

            return(obj is CatalogItemVariation other &&
                   ((ItemId == null && other.ItemId == null) || (ItemId?.Equals(other.ItemId) == true)) &&
                   ((Name == null && other.Name == null) || (Name?.Equals(other.Name) == true)) &&
                   ((Sku == null && other.Sku == null) || (Sku?.Equals(other.Sku) == true)) &&
                   ((Upc == null && other.Upc == null) || (Upc?.Equals(other.Upc) == true)) &&
                   ((Ordinal == null && other.Ordinal == null) || (Ordinal?.Equals(other.Ordinal) == true)) &&
                   ((PricingType == null && other.PricingType == null) || (PricingType?.Equals(other.PricingType) == true)) &&
                   ((PriceMoney == null && other.PriceMoney == null) || (PriceMoney?.Equals(other.PriceMoney) == true)) &&
                   ((LocationOverrides == null && other.LocationOverrides == null) || (LocationOverrides?.Equals(other.LocationOverrides) == true)) &&
                   ((TrackInventory == null && other.TrackInventory == null) || (TrackInventory?.Equals(other.TrackInventory) == true)) &&
                   ((InventoryAlertType == null && other.InventoryAlertType == null) || (InventoryAlertType?.Equals(other.InventoryAlertType) == true)) &&
                   ((InventoryAlertThreshold == null && other.InventoryAlertThreshold == null) || (InventoryAlertThreshold?.Equals(other.InventoryAlertThreshold) == true)) &&
                   ((UserData == null && other.UserData == null) || (UserData?.Equals(other.UserData) == true)) &&
                   ((ServiceDuration == null && other.ServiceDuration == null) || (ServiceDuration?.Equals(other.ServiceDuration) == true)) &&
                   ((AvailableForBooking == null && other.AvailableForBooking == null) || (AvailableForBooking?.Equals(other.AvailableForBooking) == true)) &&
                   ((ItemOptionValues == null && other.ItemOptionValues == null) || (ItemOptionValues?.Equals(other.ItemOptionValues) == true)) &&
                   ((MeasurementUnitId == null && other.MeasurementUnitId == null) || (MeasurementUnitId?.Equals(other.MeasurementUnitId) == true)) &&
                   ((TeamMemberIds == null && other.TeamMemberIds == null) || (TeamMemberIds?.Equals(other.TeamMemberIds) == true)));
        }
        public bool Equals(DestinyItemTransferRequest input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     ItemReferenceHash == input.ItemReferenceHash ||
                     (ItemReferenceHash.Equals(input.ItemReferenceHash))
                     ) &&
                 (
                     StackSize == input.StackSize ||
                     (StackSize.Equals(input.StackSize))
                 ) &&
                 (
                     TransferToVault == input.TransferToVault ||
                     (TransferToVault != null && TransferToVault.Equals(input.TransferToVault))
                 ) &&
                 (
                     ItemId == input.ItemId ||
                     (ItemId.Equals(input.ItemId))
                 ) &&
                 (
                     CharacterId == input.CharacterId ||
                     (CharacterId.Equals(input.CharacterId))
                 ) &&
                 (
                     MembershipType == input.MembershipType ||
                     (MembershipType != null && MembershipType.Equals(input.MembershipType))
                 ));
        }
Exemple #4
0
        public override void Execute(Player player)
        {
            var gameSession = World.StorageManager.GameSessions[player.Id];

            foreach (var item in player.Settings.Slotbar._items)
            {
                var value = item.Value;

                if (value is LaserItem)
                {
                    value.Selected = false;
                    if (gameSession.Player.UsingNewClient)
                    {
                        gameSession.Client.Send(value.ChangeStatus()); //TODO fix this
                    }
                }
            }

            player.Settings.CurrentAmmo = player.Information.Ammunitions[ItemId];
            Selected = true;

            if (player.Controller.Attack.Attacking && ItemId.Equals("ammunition_laser_rsb-75"))
            {
                player.Controller.Attack.LaserAttack();
            }

            if (gameSession.Player.UsingNewClient)
            {
                gameSession.Client.Send(ChangeStatus()); //TODO Same as above
            }
        }
Exemple #5
0
        /// <summary>
        /// Returns true if Item instances are equal
        /// </summary>
        /// <param name="other">Instance of Item to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Item other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     ItemId == other.ItemId ||
                     ItemId != null &&
                     ItemId.Equals(other.ItemId)
                     ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     Price == other.Price ||
                     Price != null &&
                     Price.Equals(other.Price)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ));
        }
Exemple #6
0
        public bool Equals(DestinyItemStateRequest input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     State == input.State ||
                     (State != null && State.Equals(input.State))
                     ) &&
                 (
                     ItemId == input.ItemId ||
                     (ItemId.Equals(input.ItemId))
                 ) &&
                 (
                     CharacterId == input.CharacterId ||
                     (CharacterId.Equals(input.CharacterId))
                 ) &&
                 (
                     MembershipType == input.MembershipType ||
                     (MembershipType != null && MembershipType.Equals(input.MembershipType))
                 ));
        }
        private bool IsSame(ItemEventSignature other)
        {
            if (BeforeAction != other.BeforeAction)
            {
                return(false);
            }

            if (EventType != other.EventType)
            {
                return(false);
            }

            if (!ItemId.Equals(other.ItemId))
            {
                return(false);
            }

            if (Modes.Count > 0 && !Modes.Intersect(other.Modes).Any())
            {
                return(false);
            }

            if (ColumnIds.Count > 0 && !ColumnIds.Intersect(other.ColumnIds).Any())
            {
                return(false);
            }

            return(true);
        }
Exemple #8
0
        public void ItemIdEquality()
        {
            Guid id0 = Guid.NewGuid();
            var  ii0 = new ItemId(typeof(HeaderContent), id0);
            var  ii1 = new ItemId(typeof(HeaderContent), new Guid(id0.ToString()));
            var  ii2 = new ItemId(typeof(RestaurantContent), id0);
            var  ii3 = new ItemId(typeof(HeaderContent), Guid.NewGuid());

            Assert.IsTrue(ii0.Equals(ii1), ".Equals true");
            Assert.IsTrue(ii0 == ii1, "== true");
            Assert.IsFalse(ii0.Equals(ii2), ".Equals false by type");
            Assert.IsFalse(ii0 == ii2, "== false by type");
            Assert.IsFalse(ii1.Equals(ii3), ".Equals false by id");
            Assert.IsFalse(ii1 == ii3, "== false by id");

            Assert.IsFalse(ii0.GetHashCode() == ii2.GetHashCode(), "hash code by type");
            Assert.IsFalse(ii1.GetHashCode() == ii3.GetHashCode(), "hash code by id");
        }
Exemple #9
0
        public void ItemIdEquality()
        {
            Guid id0 = Guid.NewGuid();
            var ii0 = new ItemId(typeof(HeaderContent), id0);
            var ii1 = new ItemId(typeof(HeaderContent), new Guid(id0.ToString()));
            var ii2 = new ItemId(typeof(RestaurantContent), id0);
            var ii3 = new ItemId(typeof(HeaderContent), Guid.NewGuid());

            Assert.IsTrue(ii0.Equals(ii1), ".Equals true");
            Assert.IsTrue(ii0 == ii1, "== true");
            Assert.IsFalse(ii0.Equals(ii2), ".Equals false by type");
            Assert.IsFalse(ii0 == ii2, "== false by type");
            Assert.IsFalse(ii1.Equals(ii3), ".Equals false by id");
            Assert.IsFalse(ii1 == ii3, "== false by id");

            Assert.IsFalse(ii0.GetHashCode() == ii2.GetHashCode(), "hash code by type");
            Assert.IsFalse(ii1.GetHashCode() == ii3.GetHashCode(), "hash code by id");
        }
Exemple #10
0
        public override bool Equals(object obj)
        {
            if (obj is Item item)
            {
                return(ItemId.Equals(item.ItemId));
            }

            return(false);
        }
Exemple #11
0
 public IItemSaleRule GetForItem(ItemId itemId)
 {
     if (itemId.Equals(new ItemId(Guid.Parse("2f823b5c-f93e-431e-a64c-a59f407d236f"))))
     {
         return(new MaximumQuantityPerSaleRule(2));
     }
     else
     {
         return(new NoopItemSaleRule());
     }
 }
Exemple #12
0
        public bool Equals(IMediaItem op)
        {
            // If parameter is null return false:
            if ((object)op == null)
            {
                return(false);
            }

            // Return true if they match
            return(ItemId.Equals(op.ItemId));
        }
Exemple #13
0
        public override bool Equals(Object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }

            Item itemB = (Item)obj;

            // Use Equals to compare instance variables.
            return(ItemId.Equals(itemB.ItemId));
        }
        //public ICollection<Categorization> Categorizations { get; set; }


        public override bool Equals(System.Object otherItem)
        {
            if (!(otherItem is Item))
            {
                return(false);
            }
            else
            {
                Item newItem = (Item)otherItem;
                return(ItemId.Equals(newItem.ItemId));
            }
        }
Exemple #15
0
        public override bool Equals(object obj)
        {
            var item = obj as CatalogItem;

            if (item == null)
            {
                return(false);
            }

            // in a relational logic, item id should be enough
            return(ItemId.Equals(item.ItemId) && Price.Equals(item.Price) && Name.Equals(item.Name));
        }
Exemple #16
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

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

            return(obj is V1PaymentItemDetail other &&
                   ((CategoryName == null && other.CategoryName == null) || (CategoryName?.Equals(other.CategoryName) == true)) &&
                   ((Sku == null && other.Sku == null) || (Sku?.Equals(other.Sku) == true)) &&
                   ((ItemId == null && other.ItemId == null) || (ItemId?.Equals(other.ItemId) == true)) &&
                   ((ItemVariationId == null && other.ItemVariationId == null) || (ItemVariationId?.Equals(other.ItemVariationId) == true)));
        }
Exemple #17
0
        /// <summary>
        /// Returns true if Item instances are equal
        /// </summary>
        /// <param name="other">Instance of Item to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Item other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     ItemId == other.ItemId ||
                     ItemId != null &&
                     ItemId.Equals(other.ItemId)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     Price == other.Price ||
                     Price != null &&
                     Price.Equals(other.Price)
                 ) &&
                 (
                     Buy == other.Buy ||
                     Buy != null &&
                     Buy.Equals(other.Buy)
                 ) &&
                 (
                     Sell == other.Sell ||
                     Sell != null &&
                     Sell.Equals(other.Sell)
                 ));
        }
Exemple #18
0
        public bool validateDupplicateCode(out string msg)
        {
            msg = "";
            if (ItemId.Equals(Guid.Empty))
            {
                return(true);
            }
            currentItem = session.GetObjectByKey <Item>(ItemId);

            if (currentItem == null)
            {
                throw new Exception(String.Format("Not existing data with ItemId {0}", ItemId));
            }
            string inputCode = txtProductCode.Text.Trim();
            bool   rs        = itemBO.checkIsDupplicateCode(session, inputCode);

            switch (MODE)
            {
            case "Edit":
                if (!currentItem.Code.Equals(inputCode))
                {
                    if (!rs)
                    {
                        msg = String.Format("Mã hàng hóa '{0}' đã tồn tại", txtProductCode.Text.Trim());
                        return(false);
                    }
                }
                break;

            case "Add":
                if (!rs)
                {
                    msg = String.Format("Mã hàng hóa '{0}' đã tồn tại", txtProductCode.Text.Trim());
                    return(false);
                }
                break;

            default:
                break;
            }
            return(true);
        }
Exemple #19
0
        /// <summary>
        /// Returns true if InventoryItem instances are equal
        /// </summary>
        /// <param name="other">Instance of InventoryItem to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(InventoryItem other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     ItemId == other.ItemId ||
                     ItemId != null &&
                     ItemId.Equals(other.ItemId)
                     ) &&
                 (
                     Quantity == other.Quantity ||
                     Quantity != null &&
                     Quantity.Equals(other.Quantity)
                 ));
        }
Exemple #20
0
        /// <summary>
        /// Returns true if DashboardWidgetOptionsBean instances are equal
        /// </summary>
        /// <param name="input">Instance of DashboardWidgetOptionsBean to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(DashboardWidgetOptionsBean input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Uri == input.Uri ||
                     (Uri != null &&
                      Uri.Equals(input.Uri))
                     ) &&
                 (
                     ChartId == input.ChartId ||
                     (ChartId != null &&
                      ChartId.Equals(input.ChartId))
                 ) &&
                 (
                     ServiceId == input.ServiceId ||
                     (ServiceId != null &&
                      ServiceId.Equals(input.ServiceId))
                 ) &&
                 (
                     ItemId == input.ItemId ||
                     (ItemId != null &&
                      ItemId.Equals(input.ItemId))
                 ) &&
                 (
                     BarWidth == input.BarWidth ||
                     (BarWidth != null &&
                      BarWidth.Equals(input.BarWidth))
                 ) &&
                 (
                     BorderWidth == input.BorderWidth ||
                     (BorderWidth != null &&
                      BorderWidth.Equals(input.BorderWidth))
                 ) &&
                 (
                     Angle == input.Angle ||
                     (Angle != null &&
                      Angle.Equals(input.Angle))
                 ) &&
                 (
                     Rotate == input.Rotate ||
                     (Rotate != null &&
                      Rotate.Equals(input.Rotate))
                 ) &&
                 (
                     BarAngle == input.BarAngle ||
                     (BarAngle != null &&
                      BarAngle.Equals(input.BarAngle))
                 ) &&
                 (
                     LineCap == input.LineCap ||
                     (LineCap != null &&
                      LineCap.Equals(input.LineCap))
                 ) &&
                 (
                     ScaleMin == input.ScaleMin ||
                     (ScaleMin != null &&
                      ScaleMin.Equals(input.ScaleMin))
                 ) &&
                 (
                     ScaleMax == input.ScaleMax ||
                     (ScaleMax != null &&
                      ScaleMax.Equals(input.ScaleMax))
                 ) &&
                 (
                     Title == input.Title ||
                     (Title != null &&
                      Title.Equals(input.Title))
                 ) &&
                 (
                     Units == input.Units ||
                     (Units != null &&
                      Units.Equals(input.Units))
                 ) &&
                 (
                     Group == input.Group ||
                     (Group != null &&
                      Group.Equals(input.Group))
                 ) &&
                 (
                     FloorplanId == input.FloorplanId ||
                     (FloorplanId != null &&
                      FloorplanId.Equals(input.FloorplanId))
                 ));
        }