Пример #1
0
        public RequestItem DeepCopy(RequestItem current)
        {
            RequestItem copied = new RequestItem();

            copied.RequestArticle = current.RequestArticle.DeepCopy(current.RequestArticle);
            copied.Quantity       = current.Quantity;

            return(copied);
        }
Пример #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("\n\n\nARTICLE");
            Article commodity1 = new Article("ak1598", "Red Apples", 4.20F, Article.ArticleType.Foods);
            Article commodity2 = new Article("lu385", "Marine Hat", 14.62F, Article.ArticleType.Clothes);
            Article commodity3 = new Article("g654", "Tea Table", 330F, Article.ArticleType.Furniture);

            Console.WriteLine(commodity1);
            Console.WriteLine(commodity2);
            Console.WriteLine(commodity3);


            Console.WriteLine("\n\n\nCLIENT");
            Client client1 = new Client("214", "Vasya Pupkin", "Forbes ave.,37,7,Sacramento,CA", "(661) 664-2011", 10, 1340);

            Console.WriteLine(client1);


            Console.WriteLine("\n\n\nREQUEST ITEM");
            RequestItem item1 = new RequestItem(commodity1, 3);

            Console.WriteLine(item1);



            Console.WriteLine("\n\n\nREQUEST-------------------------------------");

            List <RequestItem> ItemList1 = new List <RequestItem>();

            ItemList1.Add(item1);
            ItemList1.Add(new RequestItem()
            {
                RequestArticle = commodity2, Quantity = 1
            });
            ItemList1.Add(new RequestItem()
            {
                RequestArticle = commodity3, Quantity = 2
            });

            Request request1 = new Request("6534", client1, Request.PayType.Credit, ItemList1);

            request1.PrintRequest();

            Console.ReadKey();
        }