Example #1
0
 private bool CanAdd()
 {
     return(!string.IsNullOrWhiteSpace(User) &&
            !string.IsNullOrWhiteSpace(Email) &&
            !string.IsNullOrWhiteSpace(Event) &&
            !string.IsNullOrWhiteSpace(PurchaseDate.ToString()) &&
            !string.IsNullOrWhiteSpace(Amount.ToString()));
 }
Example #2
0
        public string GeneratePlanNumber()
        {
            var sb = new StringBuilder();

            sb.Append(string.Format("P{0}-", FormText(new InvestmentPlatformPlan(PlanId).Id, 4)));
            sb.Append(string.Format("{0}-{1}-{2}-", FormText(PurchaseDate.AddYears(-2000).Year, 2), FormText(PurchaseDate.Month, 2), FormText(PurchaseDate.Day, 2)));
            sb.Append(string.Format("{0}", FormText(Id, 4)));

            return(sb.ToString());
        }
Example #3
0
        public void TestAgeInYears()
        {
            var date1 = new PurchaseDate("Summer 2019");
            var age1  = date1.AgeInYears;

            var date2 = new PurchaseDate("Spring 2019");
            var age2  = date2.AgeInYears;

            var date3 = new PurchaseDate("Winter 2019");
            var age3  = date3.AgeInYears;

            var date4 = new PurchaseDate("Autumn 2018");
            var age4  = date4.AgeInYears;
        }
        public override bool Equals(object o)
        {
            var obj = o as ProfitAnalysis;

            if (obj == null)
            {
                return(base.Equals(o));
            }

            return
                (PurchaseDate.Equals(obj.PurchaseDate) &&
                 SaleDate.Equals(obj.SaleDate) &&
                 Profit.Equals(obj.Profit));
        }
Example #5
0
        public async Task Valid_Id_Returns_PurchaseTransaction()
        {
            var          id                  = Guid.NewGuid();
            var          store               = Store.Create(new StoreId(SequentialGuid.NewSequentialGuid()), "Kwik-E-Mart");
            var          lineItem            = new List <LineItemStripped>();
            PurchaseDate transactionDate     = new PurchaseDate(DateTime.Now);
            var          purchaseTransaction = PurchaseTransaction.CreateFull(id, store, lineItem, transactionDate);

            var mockPurchaseTransactionService = new Mock <IPurchaseTransactionService>();

            mockPurchaseTransactionService.Setup(s => s.GetDetailedPurchaseTransaction(id))
            .Returns(() => Task.FromResult(purchaseTransaction));

            var purchaseTransactionController = new PurchaseTransactionController(mockPurchaseTransactionService.Object);
            var result = await purchaseTransactionController.GetPurchaseTransaction(id);

            mockPurchaseTransactionService.Verify(mock => mock.GetDetailedPurchaseTransaction(id), Times.Once());
            Assert.NotNull(result);
        }
Example #6
0
 public override string Log() => $"{AssetId.ToString().PadRight(15)}{Category.PadRight(17)}{Office.Name.PadRight(15)}{ProdName.PadRight(15)}{ModelName.PadRight(15)}{PurchaseDate.ToShortDateString().PadRight(15)}{Price.ToString().PadRight(15)}{Currency.PadRight(15)} {ExchangeRate.ToString().PadRight(10)}USD";
Example #7
0
        public override string ToString()
        {
            StringBuilder result = new StringBuilder();

            if (IsSetAmazonOrderId())
            {
                result.Append("Order ID: ");
                result.AppendLine(AmazonOrderId);
            }
            if (IsSetFulfillmentChannel())
            {
                result.Append("FulfillmentChannel:");
                result.AppendLine(FulfillmentChannel.ToString());
            }
            if (IsSetNumberOfItemsShipped())
            {
                result.Append("Number of Items Shipped: ");
                result.AppendLine(NumberOfItemsShipped.ToString());
            }
            if (IsSetNumberOfItemsUnshipped())
            {
                result.Append("Number of Items Not Shipped: ");
                result.AppendLine(NumberOfItemsShipped.ToString());
            }
            if (IsSetLastUpdateDate())
            {
                result.Append("Last Update Date: ");
                result.AppendLine(LastUpdateDate.ToString());
            }
            if (IsSetOrderChannel())
            {
                result.Append("Order Channel: ");
                result.AppendLine(OrderChannel);
            }
            if (IsSetOrderStatus())
            {
                result.Append("Order Status: ");
                result.AppendLine(OrderStatus.ToString());
            }
            if (IsSetOrderTotal())
            {
                result.Append("Order Total: ");
                result.AppendLine(OrderTotal.ToString());
            }
            if (IsSetPurchaseDate())
            {
                result.Append("Purchase Date: ");
                result.AppendLine(PurchaseDate.ToString());
            }
            if (IsSetSalesChannel())
            {
                result.Append("Sales Channel: ");
                result.AppendLine(SalesChannel);
            }
            if (IsSetSellerOrderId())
            {
                result.Append("Seller Order Id: ");
                result.AppendLine(SellerOrderId);
            }
            if (IsSetShipServiceLevel())
            {
                result.Append("Ship Service Level: ");
                result.AppendLine(ShipServiceLevel);
            }
            if (IsSetPaymentExecutionDetail())
            {
                result.Append("Payment Execution Detail: ");
                result.Append(PaymentExecutionDetail);
            }
            if (IsSetPaymentMethod())
            {
                result.Append("Payment Method: ");
                result.Append(PaymentMethod);
            }
            if (IsSetMarketplaceId())
            {
                result.Append("Marketplace Id: ");
                result.AppendLine(MarketplaceId);
            }
            if (IsSetBuyerEmail())
            {
                result.Append("Buyer Email: ");
                result.AppendLine(BuyerEmail);
            }
            if (IsSetShipServiceLevel())
            {
                result.Append("Buyer Name: ");
                result.AppendLine(BuyerName);
            }
            if (IsSetShipmentServiceLevelCategory())
            {
                result.Append("Shipment Service Level Category: ");
                result.AppendLine(ShipmentServiceLevelCategory);
            }
            if (IsSetCbaDisplayableShippingLabel())
            {
                result.Append("CbaDisplayableShippingLabel: ");
                result.AppendLine(this.CbaDisplayableShippingLabel);
            }
            if (IsSetOrderType())
            {
                result.Append("OrderType: ");
                result.AppendLine(this.OrderType);
            }
            if (IsSetEarliestShipDate())
            {
                result.Append("EarliestShipDate: ");
                result.AppendLine(this.EarliestShipDate.ToString());
            }
            if (IsSetLatestShipDate())
            {
                result.Append("LatestShipDate: ");
                result.AppendLine(this.LatestShipDate.ToString());
            }
            return(result.ToString());
        }
Example #8
0
 public override string ToString()
 {
     return($"{Brand,-10} {SN,-10} {PurchaseDate.ToShortDateString(),-15} {State,-3}");
 }
Example #9
0
 public int CompareTo(ShareInfo other)
 {
     return(PurchaseDate.CompareTo(other.PurchaseDate));
 }
Example #10
0
 public override string ToString() => $"{PurchaseDate.ToShortDateString()} ({Quantity} x {Price.ToCurrency(2)})";
Example #11
0
 public override string ToString()
 {
     return($"{Title} {Price:C} {PurchaseDate.ToShortDateString()} [{Genre.ToUpper()}]");
 }
        //METHOD USED TO GET INFORMATION ABOUT OBJECT
        public override string ToString()
        {
            string result = "ID: " + Index.ToString() + ". Data zakupu: " + PurchaseDate.ToString() + ". Koszt: " + PurchasePrice + ".";

            return(result);
        }
Example #13
0
 public override string Log() => $"{Category.PadRight(15)}{ProdName.PadRight(8)}{ModelName.PadRight(8)}{PurchaseDate.ToShortDateString().PadRight(8)}\t{Price}";
Example #14
0
 public Computer()
 {
     PurchaseDate     = DateTime.Now;
     DecommissionDate = PurchaseDate.AddYears(2);
 }
Example #15
0
 public override string Log() => $"{Location.PadRight(20)}{Category.PadRight(15)}{ProdName.PadRight(15)}{ModelName.PadRight(8)}{PurchaseDate.ToShortDateString().PadRight(8)}\t{Price.ToString().PadRight(10)}{CurrencyFormat.PadLeft(10)}";