Beispiel #1
0
        public override string ToString()
        {
            string a = String.Format("Cena netto :{0}{3}Cena brutto :{1}{3}Vat: {2}%",
                                     NetPrice.ToString(), this.GetGross().ToString(), VAT, Environment.NewLine);

            return(a);
        }
        public override int GetHashCode()
        {
            var hashCode = 677800335;

            hashCode = hashCode * -1521134295 + EqualityComparer <Book> .Default.GetHashCode(Book);

            hashCode = hashCode * -1521134295 + Quantity.GetHashCode();
            hashCode = hashCode * -1521134295 + NetPrice.GetHashCode();
            hashCode = hashCode * -1521134295 + Tax.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Id);

            return(hashCode);
        }
Beispiel #3
0
        /// <summary>
        /// Overide the ToString() method;
        /// To generate the details(Receipt) of this order;
        /// </summary>
        /// <returns>A string description for this order</returns>
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            // Order Number
            sb.AppendLine("订单编号: " + OrderNumber);
            sb.AppendLine();

            // Order items
            foreach (OrderItem item in CartItemList)
            {
                sb.AppendLine(item.ToString());
            }
            sb.AppendLine();

            // Price, tax and discount for the order
            sb.AppendLine("价格: " + NetPrice.ToString("C2", CultureInfo.CreateSpecificCulture("en-NZ")));
            sb.AppendLine("邮费: " + TaxPrice.ToString("C2", CultureInfo.CreateSpecificCulture("en-NZ")));
            sb.AppendLine("折扣: -" + DiscountedTotalPrice.ToString("C2", CultureInfo.CreateSpecificCulture("en-NZ")));
            sb.AppendLine("总计价格: " + TotalPrice.ToString("C2", CultureInfo.CreateSpecificCulture("en-NZ")));

            return(sb.ToString());
        }
Beispiel #4
0
        public void ChangeCurrency(Waluta nowa)
        {
            Money a = new Money(NetPrice.GetValueIn(nowa), nowa);

            NetPrice = a;
        }