Exemplo n.º 1
0
        public string PrintOut()
        {
            StringBuilder str = new StringBuilder();

            // str.AppendLine(new string('-', 35));

            foreach (var p in productList)
            {
                string row = string.Format("{0} {1} {2}"
                                           , p.Quantity
                                           , ((p.IsImported) ? "Imported " : string.Empty)
                                           + p.Name,
                                           Formater.Decimal2Digit(p.GetPriceWithTax())
                                           );

                str.AppendLine(row);
            }

            str.AppendLine(new string('-', 5));
            str.AppendFormat("Sales Tax: {0}\n", totalTax);
            str.AppendFormat("Total: {0}\n", totalAmount);
            str.AppendLine(new string('=', 35));

            return(str.ToString());
        }
Exemplo n.º 2
0
        public string PrintOut()
        {
            StringBuilder str = new StringBuilder();

            foreach (var p in productList)
            {
                string row = string.Format("{0} {1} {2}"
                                           , p.Quantity
                                           , ((p.IsImported) ? "Imported " : string.Empty)
                                           + p.Name,
                                           Formater.Decimal2Digit(p.Price)
                                           );

                str.AppendLine(row);
            }

            str.AppendLine(new string('*', 35));
            return(str.ToString());
        }
Exemplo n.º 3
0
        private double CalcImportDutyTax(double pPrice)
        {
            double tax = pPrice * Taxes.ImportDutyTax;

            return(Formater.Round005(tax));
        }
Exemplo n.º 4
0
        private double CalcBaseTax(double pPrice, double pTax)
        {
            double tax = pPrice * pTax;

            return(Formater.Round005(tax));
        }