static void Main(string[] args) { Article art_1 = new Article(1111, "Apple", 100500, ArticleType.Desktop); Article art_2 = new Article(1112, "Sony VAIO", 2000, ArticleType.Notebook); Client.FullName fn = new Client.FullName("Nikita", "Vadimovich", "Vasilyev"); Client clnt = new Client(9, fn, "Belarus", "111-11-11", 5, 5000, ClientType.Ordinary); RequestItem rq_1 = new RequestItem(art_1, 5); RequestItem rq_2 = new RequestItem(art_2, 3); Request rq = new Request(1000, clnt, DateTime.Parse("2000.1.1"), PayType.CreditCard); rq.requestRequestItems.Add(rq_1); rq.requestRequestItems.Add(rq_2); Console.WriteLine(rq); clnt.ChangeRequestsStatictics(rq); Console.WriteLine(clnt); }
public void ChangeRequestsStatictics(Request rq) { if (rq.requestTotalSum > 0 && rq.requestClient.Equals(this)) { ++clientNumberOfRequests; clientTotalSum += rq.requestTotalSum; } }