예제 #1
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine("Order moment: " + Moment.ToLocalTime().ToString());
            sb.AppendLine("Order status: " + Status.ToString());
            sb.AppendLine("Client: " + Client.Name + " (" + Client.BirthDate.ToString() + ") - " + Client.Email);
            sb.AppendLine("Order items:");

            foreach (OrderItem oi in OrderItems)
            {
                sb.AppendLine(oi.ToString());
            }
            sb.AppendLine($"Total price: ${this.OrderTotalPrice()}");

            return(sb.ToString());
        }
예제 #2
0
        public override string ToString()
        {
            StringBuilder s = new StringBuilder($"Order Moment: {Moment.ToLocalTime():dd/MM/yyyy HH:mm:ss} [Moment ISO8601: Local => {Moment.ToLocalTime():o} | UTC => {Moment.ToUniversalTime():o} ]\n"); // o = yyyy-MM-ddTHH:mm:ss.fffffffK = yyyy-MM-ddTHH:mm:ss.fffffffzzz

            s.AppendLine($"Order Status: {Status}\nClient: {Client}\nOrder Items:");
            foreach (OrderItem o in Itens)
            {
                s.AppendLine(o.ToString());
            }
            s.AppendLine($"Total Price: R$ {TotalValue.ToString("F2", CultureInfo.InvariantCulture)}");
            return(s.ToString());
        }