Пример #1
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Бригада №2");
            Console.WriteLine("Project theme: Платформа онлайн оголошень");
            Console.WriteLine("Учасники: \n" +
                              "1)Євгенiй Букур.\n" +
                              "2)Назар Ярощенко.\n" +
                              "3)Денис Восколуп.\n" +
                              "4)Вiталiй Жуковець.\n");
            OrderSystem   system        = new OrderSystem();
            UserService   userService   = new UserService(system);
            OrderService  orderService  = new OrderService(system);
            Administrator administrator = userService.GetAvailableAdministrator();
            Order         order         = system.Orders[0];
            User          user          = system.Users[0];

            userService.SendOrderToValidation(order);
            administrator.AcceptOrder(order);

            userService.PrintOrders(userService.GetUserOrders(user, ord => !ord.Watched));

            orderService.AddOrder(new Order());

            try
            {
                PremiumOrder a = (PremiumOrder) new Order();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

            Console.ReadKey();
        }
        private void InitOrders()
        {
            Order order1 = new Order(0, 0, 0, 0, DateTime.Now, 2)
            {
                OrderInfo = new OrderInfo(0, 100, "first order", "desc", "url")
            };
            PremiumOrder prmOrder = new PremiumOrder(1, 0, 0, 0, DateTime.Today, 5)
            {
                OrderInfo = new OrderInfo(1, 200, "second order", "", "url")
            };

            Orders.Add(order1);

            Orders.Add(new Order
            {
                Id             = 1,
                CategoryId     = 1,
                DateOfCreation = DateTime.Now - new TimeSpan(0, 1, 3, 0),
                OrderInfo      = new OrderInfo(1, 2, "3", "dsds", "url"),
                SellerId       = 0,
                WatchCount     = 0
            });
        }