コード例 #1
0
        public Sto generate()
        {
            Sto sto = new Sto();

            AddServices(sto.GetServiceList());
            AddOrders(sto, sto.GetServiceList());
            return(sto);
        }
コード例 #2
0
        private void AddOrders(Sto sto, ServiceList sl)
        {
            Customer c1 = new Customer("Vanya", "dom 3", "333-33-33", 1);
            Customer c2 = new Customer("Petya", "dom 5", "333-33-34", 2);

            Account acc1 = new Account(c1, 1);
            Account acc2 = new Account(c2, 2);

            acc1.AddOrder(sl.GetService("замена лобового стекла"), sto.GetOrdersCount());
            foreach (Order order in acc1.orders)
            {
                sto.AddOrder(order);
            }

            acc2.AddOrder(sl.GetService("замена тормозов"), sto.GetOrdersCount());
            acc2.AddServiceToOrder(sl.GetService("замена переднего бампера"));
            foreach (Order order in acc2.orders)
            {
                sto.AddOrder(order);
            }

            sto.AddAccount(acc1);
            sto.AddAccount(acc2);
        }
コード例 #3
0
ファイル: Report.cs プロジェクト: PoulHack/STO
 public Report(TextWriter output, Sto sto)
 {
     this.output = output;
     this.sto    = sto;
 }