public IssueAssociatedWithNewBacklogItem(TenantId tenantId, ProductId productId, IssueId issueId)
 {
     TenantId = tenantId;
     ProductId = productId;
     IssueId = issueId;
     OccurredOn = DateTime.Now;
 }
Пример #2
0
 void MustBeActive(TenantId tenant = null, ProductId product = null, IssueId ticket = null,IssueAssignerId assigner=null)
 {
     if (tenant != null) Guard.That(Queries.IsActive(tenant), "This is an inactive tenant");
     if (product != null) Guard.That(Queries.IsActive(tenant,product), "This is an inactive product");
     if (ticket != null) Guard.That(Queries.IsActive(tenant, product, ticket), "This is an inactive ticket");
     if (assigner != null) Guard.That(Queries.IsActive(tenant, assigner), "This is an inactive assigner");
 }
Пример #3
0
        public Product(
                TenantId tenantId,
                ProductId productId,
                ProductOwnerId productOwnerId,
                string name,
                string description,
                DiscussionAvailability discussionAvailability)
        {
            this.TenantId = tenantId; // must precede productOwnerId for compare
            this.Description = description;
            this.Discussion = ProductDiscussion.FromAvailability(discussionAvailability);
            this.DiscussionInitiationId = null;
            this.Name = name;
            this.ProductId = productId;
            this.ProductOwnerId = productOwnerId; // TODO: validation currently missing

            DomainEventPublisher
                .Instance
                .Publish(new ProductCreated(
                        this.TenantId,
                        this.ProductId,
                        this.ProductOwnerId,
                        this.Name,
                        this.Description,
                        this.Discussion.Availability));
        }
 public ProductDiscussionInitiated(TenantId tenantId, ProductId productId, ProductDiscussion productDiscussion)
 {
     this.EventVersion = 1;
     this.OccurredOn = DateTime.Now;
     this.ProductDiscussion = productDiscussion;
     this.ProductId = productId;
     this.TenantId = tenantId;
 }
 public BacklogItemDiscussionRequested(Tenants.TenantId tenantId, ProductId productId, BacklogItemId backlogItemId, bool isRequested)
 {
     this.TenantId = tenantId;
     this.EventVersion = 1;
     this.OccurredOn = DateTime.UtcNow;
     this.ProductId = productId;
     this.BacklogItemId = backlogItemId;
     this.IsRequested = isRequested;
 }
 public ProductBacklogItem(
     TenantId tenantId,
     ProductId productId,
     BacklogItemId backlogItem,
     int ordering)
 {
     this.BacklogItemId = backlogItem;
     this.Ordering = ordering;
     this.ProductId = productId;
     this.TenantId = tenantId;
 }
 public ProductDiscussionRequested(
     TenantId tenantId,
     ProductId productId,
     ProductOwnerId productOwnerId,
     string name,
     string description,
     bool requestingDiscussion)
 {
     this.Description = description;
     this.EventVersion = 1;
     this.Name = name;
     this.OccurredOn = DateTime.Now;
     this.ProductId = productId;
     this.ProductOwnerId = productOwnerId;
     this.RequestingDiscussion = requestingDiscussion;
     this.TenantId = tenantId;
 }
Пример #8
0
 public ProductCreated(
     TenantId tenantId,
     ProductId productId,
     ProductOwnerId productOwnerId,
     string name,
     string description,
     DiscussionAvailability availability)
 {
     this.Availability = availability;
     this.Description = description;
     this.EventVersion = 1;
     this.Name = name;
     this.OccurredOn = DateTime.Now;
     this.ProductId = productId;
     this.ProductOwnerId = productOwnerId;
     this.TenantId = tenantId;
 }
 public ProductSprintScheduled(
     TenantId tenantId,
     ProductId productId,
     SprintId sprintId,
     string name,
     string goals,
     DateTime starts,
     DateTime ends)
 {
     this.Ends = ends;
     this.EventVersion = 1;
     this.Goals = goals;
     this.Name = name;
     this.OccurredOn = DateTime.Now;
     this.ProductId = productId;
     this.SprintId = sprintId;
     this.Starts = starts;
     this.TenantId = tenantId;
 }
 public ProductBacklogItemPlanned(
     TenantId tenantId,
     ProductId productId,
     BacklogItemId backlogItemId,
     string summary,
     string category,
     BacklogItems.BacklogItemType backlogItemType,
     BacklogItems.StoryPoints storyPoints)
 {
     this.BacklogItemId = backlogItemId;
     this.Category = category;
     this.EventVersion = 1;
     this.OccurredOn = DateTime.Now;
     this.ProductId = productId;
     this.StoryPoints = storyPoints;
     this.Summary = summary;
     this.TenantId = tenantId;
     this.Type = backlogItemType;
 }
 public ProductReleaseScheduled(
     TenantId tenantId,
     ProductId productId,
     ReleaseId releaseId,
     string name,
     string description,
     DateTime starts,
     DateTime ends)
 {
     this.Description = description;
     this.Ends = ends;
     this.EventVersion = 1;
     this.Name = name;
     this.OccurredOn = DateTime.Now;
     this.ProductId = productId;
     this.ReleaseId = releaseId;
     this.Starts = starts;
     this.TenantId = tenantId;
 }
Пример #12
0
 public void RequestFeature(TenantId Tenant, ProductId Product, IssueId Id, string Name, string Description,IssueAssignerId Assigner)
 {
     MustBeActive(Tenant,Product);
     MustBeActive(Tenant,assigner:Assigner);
     Changes.IssueRegistered(Tenant,Product,Id, Name, Description,IssueType.Feature,Assigner);
 }
Пример #13
0
 public void CloseIssue(TenantId Tenant, ProductId Product, IssueId Id)
 {
     MustBeActive(Tenant, Product, Id);
     Changes.IssueClosed(Tenant, Product, Id);
 }
Пример #14
0
 public Product ProductById(ProductId id)
 {
     return(_products.First(p => p.Id == id));
 }
Пример #15
0
 public static ProductAmount ToDomainModel(this CartItemDto cartItemDto) => ProductAmount.Of(
     ProductId.From(cartItemDto.ProductId),
     cartItemDto.Amount,
     AmountUnit.Unit);
Пример #16
0
 public Product(string name)
 {
     Name = name;
     Id   = ProductId.NewId();
 }
        public int CompareTo(SummeryOfProductInContextOfWorkGuildAndOfDischarge other)
        {
            var ordinalIgnoreCase = StringComparison.OrdinalIgnoreCase;

            if (ReferenceEquals(this, other))
            {
                return(0);
            }

            if (ReferenceEquals(null, other))
            {
                return(1);
            }
            var productIdComparison = ProductId.CompareTo(other.ProductId);

            if (productIdComparison != 0)
            {
                return(productIdComparison);
            }
            var productNameComparison = string.Compare(ProductName, other.ProductName, ordinalIgnoreCase);

            if (productNameComparison != 0)
            {
                return(productNameComparison);
            }
            var productMarkComparison = string.Compare(ProductMark, other.ProductMark, ordinalIgnoreCase);

            if (productMarkComparison != 0)
            {
                return(productMarkComparison);
            }
            var kcComparison = Kc.CompareTo(other.Kc);

            if (kcComparison != 0)
            {
                return(kcComparison);
            }
            var vstk1Comparison = Vstk1.CompareTo(other.Vstk1);

            if (vstk1Comparison != 0)
            {
                return(vstk1Comparison);
            }
            var vstk2Comparison = Vstk2.CompareTo(other.Vstk2);

            if (vstk2Comparison != 0)
            {
                return(vstk2Comparison);
            }
            var vstk3Comparison = Vstk3.CompareTo(other.Vstk3);

            if (vstk3Comparison != 0)
            {
                return(vstk3Comparison);
            }
            var vstk4Comparison = Vstk4.CompareTo(other.Vstk4);

            if (vstk4Comparison != 0)
            {
                return(vstk4Comparison);
            }
            var vstk5Comparison = Vstk5.CompareTo(other.Vstk5);

            if (vstk5Comparison != 0)
            {
                return(vstk5Comparison);
            }
            var vstk6Comparison = Vstk6.CompareTo(other.Vstk6);

            if (vstk6Comparison != 0)
            {
                return(vstk6Comparison);
            }
            var rstk1Comparison = Rstk1.CompareTo(other.Rstk1);

            if (rstk1Comparison != 0)
            {
                return(rstk1Comparison);
            }
            var rstk2Comparison = Rstk2.CompareTo(other.Rstk2);

            if (rstk2Comparison != 0)
            {
                return(rstk2Comparison);
            }
            var rstk3Comparison = Rstk3.CompareTo(other.Rstk3);

            if (rstk3Comparison != 0)
            {
                return(rstk3Comparison);
            }
            var rstk4Comparison = Rstk4.CompareTo(other.Rstk4);

            if (rstk4Comparison != 0)
            {
                return(rstk4Comparison);
            }
            var rstk5Comparison = Rstk5.CompareTo(other.Rstk5);

            if (rstk5Comparison != 0)
            {
                return(rstk5Comparison);
            }
            var rstk6Comparison = Rstk6.CompareTo(other.Rstk6);

            if (rstk6Comparison != 0)
            {
                return(rstk6Comparison);
            }
            var prtnorm1Comparison = Prtnorm1.CompareTo(other.Prtnorm1);

            if (prtnorm1Comparison != 0)
            {
                return(prtnorm1Comparison);
            }
            var prtnorm2Comparison = Prtnorm2.CompareTo(other.Prtnorm2);

            if (prtnorm2Comparison != 0)
            {
                return(prtnorm2Comparison);
            }
            var prtnorm3Comparison = Prtnorm3.CompareTo(other.Prtnorm3);

            if (prtnorm3Comparison != 0)
            {
                return(prtnorm3Comparison);
            }
            var prtnorm4Comparison = Prtnorm4.CompareTo(other.Prtnorm4);

            if (prtnorm4Comparison != 0)
            {
                return(prtnorm4Comparison);
            }
            var prtnorm5Comparison = Prtnorm5.CompareTo(other.Prtnorm5);

            if (prtnorm5Comparison != 0)
            {
                return(prtnorm5Comparison);
            }
            var prtnorm6Comparison = Prtnorm6.CompareTo(other.Prtnorm6);

            if (prtnorm6Comparison != 0)
            {
                return(prtnorm6Comparison);
            }
            var nadb1Comparison = Nadb1.CompareTo(other.Nadb1);

            if (nadb1Comparison != 0)
            {
                return(nadb1Comparison);
            }
            var nadb2Comparison = Nadb2.CompareTo(other.Nadb2);

            if (nadb2Comparison != 0)
            {
                return(nadb2Comparison);
            }
            var nadb3Comparison = Nadb3.CompareTo(other.Nadb3);

            if (nadb3Comparison != 0)
            {
                return(nadb3Comparison);
            }
            var nadb4Comparison = Nadb4.CompareTo(other.Nadb4);

            if (nadb4Comparison != 0)
            {
                return(nadb4Comparison);
            }
            var nadb5Comparison = Nadb5.CompareTo(other.Nadb5);

            if (nadb5Comparison != 0)
            {
                return(nadb5Comparison);
            }
            return(Nadb6.CompareTo(other.Nadb6));
        }
Пример #18
0
 public Item(ProductId productId)
 {
     ProductId = productId;
 }
 public async Task Dispatch(RenameProductCommand command, CancellationToken cancellationToken)
 {
     var id   = new ProductId(command.Id);
     var name = new ProductName(command.Name);
     await productRenamer.Execute(id, name).ConfigureAwait(false);
 }
Пример #20
0
 /// <summary>
 /// NOTE: ReSharper disable NonReadonlyMemberInGetHashCode
 /// </summary>
 public override int GetHashCode()
 => PersonId.GetHashCode() + ProductId.GetHashCode() + Role.GetHashCode();
Пример #21
0
 public OrderLine(int quantity, ProductId productId)
 {
     Quantity  = quantity;
     ProductId = productId;
 }
Пример #22
0
        public async Task DeleteAsync(ProductId id)
        {
            var product = await SafeGetProductAsync(id);

            await _deleteProduct.DeleteAsync(product);
        }
Пример #23
0
        public GarmentDeliveryReturnItem(Guid identity, Guid drId, int unitDOItemId, int uenItemId, string preparingItemId, ProductId productId, string productCode, string productName, string designColor, string roNo, double quantity, UomId uomId, string uomUnit) : base(identity)
        {
            this.MarkTransient();

            Identity        = identity;
            DRId            = drId;
            UnitDOItemId    = unitDOItemId;
            UENItemId       = uenItemId;
            PreparingItemId = preparingItemId;
            ProductId       = productId;
            ProductCode     = productCode;
            ProductName     = productName;
            DesignColor     = designColor;
            RONo            = roNo;
            Quantity        = quantity;
            UomId           = uomId;
            UomUnit         = uomUnit;

            ReadModel = new GarmentDeliveryReturnItemReadModel(identity)
            {
                DRId            = DRId,
                UnitDOItemId    = UnitDOItemId,
                UENItemId       = UENItemId,
                PreparingItemId = PreparingItemId,
                ProductId       = ProductId.Value,
                ProductCode     = ProductCode,
                ProductName     = ProductName,
                DesignColor     = DesignColor,
                RONo            = RONo,
                Quantity        = Quantity,
                UomId           = UomId.Value,
                UomUnit         = UomUnit,
            };
            ReadModel.AddDomainEvent(new OnGarmentDeliveryReturnPlaced(this.Identity));
        }
        public ProductPresenter(OrderProduct product)
        {
            ProductName  = product.ProductName;
            ProductImg   = product.ProductImage;
            ProductId    = product.OrderProductId;
            ProductPrice = product.Price;
            Quantity     = product.Quantity;

            //ProductDescription = product.ProductDescription;


            RemoveFromCartCommand = new Command(async() =>
            {
                TokenExpManger tokenExpManger = new TokenExpManger(App.TokenDto.Exp);

                if (tokenExpManger.IsExpired())
                {
                    await tokenExpManger.CloseSession();
                }
                else
                {
                    var orderProductRemovedResult = await orderProductDataStore.DeleteItemAsync(ProductId.ToString());

                    if (orderProductRemovedResult)
                    {
                        await Shell.Current.DisplayAlert("Notification", "Product Removed succefully.", "OK");

                        MessagingCenter.Send <ProductPresenter>(this, "RemoveOrderProduct");
                    }
                }
            });
        }
Пример #25
0
 internal ProductAdded(OrderId aggregateId, long aggregateVersion, ProductId productId, int quantity) : base(aggregateId, aggregateVersion)
 {
     ProductId = productId;
     Quantity  = quantity;
 }
 internal OrderItemState(OrderItemId id, ProductId productId, decimal unitPrice, decimal discount) : this() =>
 private void EnsureValidState(OrderItemId id, ProductId productId, decimal unitPrice, decimal discount) =>
 this.ThrowsIf(_ => string.IsNullOrEmpty(id), new ArgumentNullException(id))
 .ThrowsIf(_ => string.IsNullOrEmpty(productId), new ArgumentNullException(productId))
 .ThrowsIf(_ => unitPrice < 0, new InvalidValueException(unitPrice.ToString()))
 .ThrowsIf(_ => discount < 0, new InvalidValueException(discount.ToString()));
        public ProductPresenter(Product product)
        {
            ProductName        = product.ProductName;
            ProductImg         = product.ProductImage;
            ProductId          = product.ProductId;
            ProductPrice       = product.Price;
            ItemLeft           = product.InventoryQuantity;
            ProductType        = product.Type.ToString();
            ProductDescription = product.ProductDescription;

            Quantity = 0;

            AddToCartCommand = new Command(async() =>
            {
                TokenExpManger tokenExpManger = new TokenExpManger(App.TokenDto.Exp);

                if (tokenExpManger.IsExpired())
                {
                    await tokenExpManger.CloseSession();
                }
                else
                {
                    if (ItemLeft > 0)
                    {
                        if (Quantity > 0)
                        {
                            int left = ItemLeft - (int)Quantity;

                            if (Quantity <= ItemLeft)
                            {
                                await Cart.OrderManger(this);
                            }
                            else
                            {
                                await Shell.Current.DisplayAlert("Notification", "Item dont have to many in stock selecte a less quantity.", "OK");
                            }



                            #region OrderManger
                            //               var userhaveorder =  orderDataStore.HaveOrder(App.LogUser.UserId, App.CurrentStore.StoreId);

                            //if (userhaveorder == null)
                            //{
                            //	Order order = new Order()
                            //	{
                            //		OrderId = Guid.NewGuid(),
                            //		BuyerId = App.LogUser.UserId,
                            //		StoreId = App.CurrentStore.StoreId,
                            //		OrderType = Library.Models.Type.None,
                            //		OrderDate = DateTime.Today,
                            //		OrderStatus = Status.NotSubmited,


                            //	};

                            //	var orderadded = await orderDataStore.AddItemAsync(order);

                            //	OrderProduct orderProduct = new OrderProduct()
                            //	{
                            //		OrderProductId = Guid.NewGuid(),
                            //		Price = ProductPrice,
                            //		ProductName = ProductName,
                            //		Quantity = (int)Quantity,
                            //		BuyerId = App.LogUser.UserId,
                            //		StoreId = App.CurrentStore.StoreId,
                            //		OrderId = order.OrderId,
                            //		ProductImage = ProductImg
                            //	};

                            //	var result = orderProductDataStore.OrderProductOfUserExist(App.LogUser.UserId, orderProduct.ProductName);
                            //	if (result == false)
                            //	{

                            //		var orderProductAdded = await orderProductDataStore.AddItemAsync(orderProduct);

                            //		if (orderProductAdded)
                            //		{
                            //			Cart.OrderProducts.Add(orderProduct);
                            //		}
                            //	}
                            //	else
                            //	{

                            //		var toupdate = orderProductDataStore.OrderProductOfUserExistWith(ProductName);

                            //		if (toupdate.Quantity != orderProduct.Quantity)
                            //		{

                            //			toupdate.Quantity = orderProduct.Quantity;
                            //			var uptedResult = await orderProductDataStore.UpdateItemAsync(toupdate);
                            //		}
                            //	}

                            //}
                            //else
                            //{

                            //	OrderProduct orderProduct = new OrderProduct()
                            //	{
                            //		OrderProductId = Guid.NewGuid(),
                            //		Price = ProductPrice,
                            //		ProductName = ProductName,
                            //		Quantity = (int)Quantity,
                            //		BuyerId = App.LogUser.UserId,
                            //		StoreId = App.CurrentStore.StoreId,
                            //		 OrderId = userhaveorder.OrderId,
                            //		ProductImage = ProductImg
                            //	};

                            //	var result = orderProductDataStore.OrderProductOfUserExist(App.LogUser.UserId, orderProduct.ProductName);
                            //	if (result == false)
                            //	{

                            //		var orderProductAdded = await orderProductDataStore.AddItemAsync(orderProduct);

                            //		if (orderProductAdded)
                            //		{
                            //			Cart.OrderProducts.Add(orderProduct);
                            //			Cart.Total += Cart.OrderProducts.Sum(o => o.Price * o.Quantity);
                            //		}
                            //	}
                            //	else
                            //	{

                            //		var toupdate = orderProductDataStore.OrderProductOfUserExistWith(ProductName);

                            //		if (toupdate.Quantity != orderProduct.Quantity)
                            //		{

                            //			toupdate.Quantity = orderProduct.Quantity;
                            //			var uptedResult = await orderProductDataStore.UpdateItemAsync(toupdate);
                            //		}
                            //	}
                            //}
                            #endregion
                        }
                        else
                        {
                            await Shell.Current.DisplayAlert("Notification", "Quantiy selected is 0.", "OK");
                        }
                    }
                    else
                    {
                        await Shell.Current.DisplayAlert("Notification", "There are no products.", "OK");
                    }
                }
            });



            DeleteCommand = new Command(async() =>
            {
                TokenExpManger tokenExpManger = new TokenExpManger(App.TokenDto.Exp);

                if (tokenExpManger.IsExpired())
                {
                    await tokenExpManger.CloseSession();
                }
                else
                {
                    var answer = await Shell.Current.DisplayAlert("Notification", "Are you sure that you want to delete this item?", "Yes", "No");

                    if (answer)
                    {
                        var result = await productDataStore.DeleteItemAsync(this.ProductId.ToString());

                        if (result)
                        {
                            MessagingCenter.Send <ProductPresenter>(this, "DeleteProductInventory");
                        }
                    }
                }
            });

            EditCommand = new Command(async() =>
            {
                TokenExpManger tokenExpManger = new TokenExpManger(App.TokenDto.Exp);

                if (tokenExpManger.IsExpired())
                {
                    await tokenExpManger.CloseSession();
                }
                else
                {
                    await Shell.Current.GoToAsync($"{EditProductPage.Route}?pId={ProductId.ToString()}", animate: true);
                }
            });
        }
Пример #29
0
    public override string ToString()
    {
        var  sb      = new StringBuilder("ProductSimple(");
        bool __first = true;

        if (ProductId != null && __isset.productId)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("ProductId: ");
            ProductId.ToString(sb);
        }
        if (__isset.packageId)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("PackageId: ");
            PackageId.ToString(sb);
        }
        if (__isset.version)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Version: ");
            Version.ToString(sb);
        }
        if (__isset.onSale)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("OnSale: ");
            OnSale.ToString(sb);
        }
        if (__isset.validUntil)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("ValidUntil: ");
            ValidUntil.ToString(sb);
        }
        if (StickerIdRanges != null && __isset.stickerIdRanges)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("StickerIdRanges: ");
            StickerIdRanges.ToString(sb);
        }
        if (__isset.grantedByDefault)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("GrantedByDefault: ");
            GrantedByDefault.ToString(sb);
        }
        if (__isset.displayOrder)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("DisplayOrder: ");
            DisplayOrder.ToString(sb);
        }
        sb.Append(")");
        return(sb.ToString());
    }
Пример #30
0
 public Task <ProductPrice?> GetByIdAsync(ProductId id)
 {
     throw new System.NotImplementedException();
 }
Пример #31
0
        /// <summary>
        /// Returns true if Product instances are equal
        /// </summary>
        /// <param name="other">Instance of Product to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Product other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     ProductId == other.ProductId ||
                     ProductId != null &&
                     ProductId.Equals(other.ProductId)
                     ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     ProductNumber == other.ProductNumber ||
                     ProductNumber != null &&
                     ProductNumber.Equals(other.ProductNumber)
                 ) &&
                 (
                     Color == other.Color ||
                     Color != null &&
                     Color.Equals(other.Color)
                 ) &&
                 (
                     StandardCost == other.StandardCost ||
                     StandardCost != null &&
                     StandardCost.Equals(other.StandardCost)
                 ) &&
                 (
                     ListPrice == other.ListPrice ||
                     ListPrice != null &&
                     ListPrice.Equals(other.ListPrice)
                 ) &&
                 (
                     Size == other.Size ||
                     Size != null &&
                     Size.Equals(other.Size)
                 ) &&
                 (
                     Weight == other.Weight ||
                     Weight != null &&
                     Weight.Equals(other.Weight)
                 ) &&
                 (
                     ProductLine == other.ProductLine ||
                     ProductLine != null &&
                     ProductLine.Equals(other.ProductLine)
                 ) &&
                 (
                     Class == other.Class ||
                     Class != null &&
                     Class.Equals(other.Class)
                 ) &&
                 (
                     Style == other.Style ||
                     Style != null &&
                     Style.Equals(other.Style)
                 ) &&
                 (
                     SubCategory == other.SubCategory ||
                     SubCategory != null &&
                     SubCategory.Equals(other.SubCategory)
                 ) &&
                 (
                     Model == other.Model ||
                     Model != null &&
                     Model.Equals(other.Model)
                 ) &&
                 (
                     Photo == other.Photo ||
                     Photo != null &&
                     Photo.Equals(other.Photo)
                 ) &&
                 (
                     Review == other.Review ||
                     Review != null &&
                     Review.SequenceEqual(other.Review)
                 ));
        }
Пример #32
0
        public int CompareTo(PrintingOfProsuctInContextOfDetalOperations other)
        {
            const StringComparison ordinalIgnoreCase = StringComparison.OrdinalIgnoreCase;

            if (ReferenceEquals(this, other))
            {
                return(0);
            }

            if (ReferenceEquals(null, other))
            {
                return(1);
            }
            var productIdComparison = ProductId.CompareTo(other.ProductId);

            if (productIdComparison != 0)
            {
                return(productIdComparison);
            }
            var productNameComparison = string.Compare(ProductName, other.ProductName, ordinalIgnoreCase);

            if (productNameComparison != 0)
            {
                return(productNameComparison);
            }
            var productMarkComparison = string.Compare(ProductMark, other.ProductMark, ordinalIgnoreCase);

            if (productMarkComparison != 0)
            {
                return(productMarkComparison);
            }
            var detalIdComparison = DetalId.CompareTo(other.DetalId);

            if (detalIdComparison != 0)
            {
                return(detalIdComparison);
            }
            var detalNameComparison = string.Compare(DetalName, other.DetalName, ordinalIgnoreCase);

            if (detalNameComparison != 0)
            {
                return(detalNameComparison);
            }
            var detalMarkComparison = string.Compare(DetalMark, other.DetalMark, ordinalIgnoreCase);

            if (detalMarkComparison != 0)
            {
                return(detalMarkComparison);
            }
            var kcComparison = Kc.CompareTo(other.Kc);

            if (kcComparison != 0)
            {
                return(kcComparison);
            }
            var kolComparison = Kol.CompareTo(other.Kol);

            if (kolComparison != 0)
            {
                return(kolComparison);
            }
            var operacComparison = Operac.CompareTo(other.Operac);

            if (operacComparison != 0)
            {
                return(operacComparison);
            }
            var tehoperComparison = Tehoper.CompareTo(other.Tehoper);

            if (tehoperComparison != 0)
            {
                return(tehoperComparison);
            }
            var operationNameComparison = string.Compare(OperationName, other.OperationName, ordinalIgnoreCase);

            if (operationNameComparison != 0)
            {
                return(operationNameComparison);
            }
            var vstkComparison = Vstk.CompareTo(other.Vstk);

            if (vstkComparison != 0)
            {
                return(vstkComparison);
            }
            var rstkComparison = Rstk.CompareTo(other.Rstk);

            if (rstkComparison != 0)
            {
                return(rstkComparison);
            }
            return(Vypusk.CompareTo(other.Vypusk));
        }
Пример #33
0
 /// <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 (ProductId != null)
         {
             hashCode = hashCode * 59 + ProductId.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (ProductNumber != null)
         {
             hashCode = hashCode * 59 + ProductNumber.GetHashCode();
         }
         if (Color != null)
         {
             hashCode = hashCode * 59 + Color.GetHashCode();
         }
         if (StandardCost != null)
         {
             hashCode = hashCode * 59 + StandardCost.GetHashCode();
         }
         if (ListPrice != null)
         {
             hashCode = hashCode * 59 + ListPrice.GetHashCode();
         }
         if (Size != null)
         {
             hashCode = hashCode * 59 + Size.GetHashCode();
         }
         if (Weight != null)
         {
             hashCode = hashCode * 59 + Weight.GetHashCode();
         }
         if (ProductLine != null)
         {
             hashCode = hashCode * 59 + ProductLine.GetHashCode();
         }
         if (Class != null)
         {
             hashCode = hashCode * 59 + Class.GetHashCode();
         }
         if (Style != null)
         {
             hashCode = hashCode * 59 + Style.GetHashCode();
         }
         if (SubCategory != null)
         {
             hashCode = hashCode * 59 + SubCategory.GetHashCode();
         }
         if (Model != null)
         {
             hashCode = hashCode * 59 + Model.GetHashCode();
         }
         if (Photo != null)
         {
             hashCode = hashCode * 59 + Photo.GetHashCode();
         }
         if (Review != null)
         {
             hashCode = hashCode * 59 + Review.GetHashCode();
         }
         return(hashCode);
     }
 }
        public GarmentSewingInItem(Guid identity, Guid sewingInId, Guid sewingOutItemId, Guid sewingOutDetailId, Guid loadingItemId, Guid finishingOutItemId, Guid finishingOutDetailId, ProductId productId, string productCode, string productName, string designColor, SizeId sizeId, string sizeName, double quantity, UomId uomId, string uomUnit, string color, double remainingQuantity, double basicPrice, double price) : base(identity)
        {
            Identity             = identity;
            SewingInId           = sewingInId;
            SewingOutItemId      = sewingOutItemId;
            SewingOutDetailId    = sewingOutDetailId;
            LoadingItemId        = loadingItemId;
            FinishingOutItemId   = finishingOutItemId;
            FinishingOutDetailId = finishingOutDetailId;
            ProductId            = productId;
            ProductCode          = productCode;
            ProductName          = productName;
            DesignColor          = designColor;
            SizeId            = sizeId;
            SizeName          = sizeName;
            Quantity          = quantity;
            UomId             = uomId;
            UomUnit           = uomUnit;
            Color             = color;
            RemainingQuantity = remainingQuantity;
            BasicPrice        = basicPrice;
            Price             = price;

            ReadModel = new GarmentSewingInItemReadModel(identity)
            {
                SewingInId           = SewingInId,
                SewingOutItemId      = SewingOutItemId,
                SewingOutDetailId    = SewingOutDetailId,
                LoadingItemId        = LoadingItemId,
                FinishingOutItemId   = FinishingOutItemId,
                FinishingOutDetailId = FinishingOutDetailId,
                ProductId            = ProductId.Value,
                ProductCode          = ProductCode,
                ProductName          = ProductName,
                DesignColor          = DesignColor,
                SizeId            = SizeId.Value,
                SizeName          = SizeName,
                Quantity          = Quantity,
                UomId             = UomId.Value,
                UomUnit           = UomUnit,
                Color             = Color,
                RemainingQuantity = RemainingQuantity,
                BasicPrice        = BasicPrice,
                Price             = Price
            };

            ReadModel.AddDomainEvent(new OnGarmentSewingInPlaced(Identity));
        }
Пример #35
0
 protected bool Equals(ProductOption other)
 {
     return(Id.Equals(other.Id) && ProductId.Equals(other.ProductId) && string.Equals(Name, other.Name) &&
            string.Equals(Description, other.Description));
 }
Пример #36
0
 public void ActivateProduct(TenantId Tenant, ProductId Id, string Name, string Description)
 {
     MustBeActive(Tenant);
     Guard.Against(Queries.IsActive(Tenant,Id),"This product is already active.");
     Changes.ProductActivated(Tenant, Id, Name, Description);
 }
 public override int GetHashCode()
 {
     return(ProductId.GetHashCode() ^
            ProductType.GetHashCode());
 }
Пример #38
0
 public void ReportDefect(TenantId Tenant, ProductId Product, IssueId Id, string Name, string Description,IssueAssignerId Assigner)
 {
     MustBeActive(Tenant, Product);
     Changes.IssueRegistered(Tenant, Product, Id, Name, Description,IssueType.Defect,Assigner);
 }
        public bool RemoveProductFromShop(ShopId shopId, ProductId productId)
        {
            string result = marketProductsService.RemoveProductAsync(productId, shopId, Username).Result;

            return(result == "Product removed");
        }
 public async Task Dispatch(DeleteProductCommand command, CancellationToken cancellationToken)
 {
     var id = new ProductId(command.Id);
     await productDeleter.Execute(id).ConfigureAwait(false);
 }
Пример #41
0
 public Product(ProductId id, string name, decimal price)
 {
     this.Price = price;
     this.Name  = name;
     this.Id    = id;
 }
Пример #42
0
 public bool Equals(ProductId other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return other.Value == Value;
 }
Пример #43
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (InstrumentId.Length != 0)
            {
                hash ^= InstrumentId.GetHashCode();
            }
            if (ExchangeId.Length != 0)
            {
                hash ^= ExchangeId.GetHashCode();
            }
            if (InstrumentName.Length != 0)
            {
                hash ^= InstrumentName.GetHashCode();
            }
            if (ProductId.Length != 0)
            {
                hash ^= ProductId.GetHashCode();
            }
            if (ProductClass != 0)
            {
                hash ^= ProductClass.GetHashCode();
            }
            if (DeliveryYear != 0)
            {
                hash ^= DeliveryYear.GetHashCode();
            }
            if (DeliveryMonth != 0)
            {
                hash ^= DeliveryMonth.GetHashCode();
            }
            if (MaxMarketOrderVolume != 0)
            {
                hash ^= MaxMarketOrderVolume.GetHashCode();
            }
            if (MinMarketOrderVolume != 0)
            {
                hash ^= MinMarketOrderVolume.GetHashCode();
            }
            if (MaxLimitOrderVolume != 0)
            {
                hash ^= MaxLimitOrderVolume.GetHashCode();
            }
            if (MinLimitOrderVolume != 0)
            {
                hash ^= MinLimitOrderVolume.GetHashCode();
            }
            if (VolumeMultiple != 0)
            {
                hash ^= VolumeMultiple.GetHashCode();
            }
            if (PriceTick != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(PriceTick);
            }
            if (CreateDate.Length != 0)
            {
                hash ^= CreateDate.GetHashCode();
            }
            if (OpenDate.Length != 0)
            {
                hash ^= OpenDate.GetHashCode();
            }
            if (ExpireDate.Length != 0)
            {
                hash ^= ExpireDate.GetHashCode();
            }
            if (StartDelivDate.Length != 0)
            {
                hash ^= StartDelivDate.GetHashCode();
            }
            if (EndDelivDate.Length != 0)
            {
                hash ^= EndDelivDate.GetHashCode();
            }
            if (IsTrading != false)
            {
                hash ^= IsTrading.GetHashCode();
            }
            if (UnderlyingMultiple != 0)
            {
                hash ^= UnderlyingMultiple.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Пример #44
0
 internal ProductAdded(ProductId productId, int quantity) : base()
 {
     ProductId = productId;
     Quantity  = quantity;
 }
Пример #45
0
 // Get the DVD concerned, using an index, by product Id
 public DVD this[ProductId index]
 {
Пример #46
0
 public SalesOrderLine(uint quantity, ProductId productId, decimal itemValue)
 {
     Quantity = quantity;
     ProductId = productId;
     ItemValue = itemValue;
 }
Пример #47
0
 public override string ToString()
 {
     return("Product Id: " + ProductId.ToString() + ",   " + "Product Name: " + ProdName);
 }