-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSiparis.cs
46 lines (38 loc) · 1.12 KB
/
Siparis.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OnlineAlisverisSistemi
{
public class Siparis
{
public int SiparisNo { get; set; }
public List<Urun> Urunler { get; set; } = new List<Urun>();
public double ToplamFiyat
{
get
{
double toplam = 0;
foreach (var urun in Urunler)
{
toplam += urun.Fiyat;
}
return toplam;
}
}
public string TeslimatAdresi { get; set; }
public void SiparisDetayiGoster()
{
Console.WriteLine("\n--- Online Sipariş Detayları ---");
Console.WriteLine($"Sipariş No: {SiparisNo}");
Console.WriteLine("Ürünler:");
foreach (var urun in Urunler)
{
urun.BilgiGoster();
}
Console.WriteLine($"Toplam Fiyat: {ToplamFiyat} TL");
Console.WriteLine($"Teslimat Adresi: {TeslimatAdresi}");
}
}
}