static void UdTov(ref Dictionary <pokupatel, List <tovar> > journal) { Spisok(journal); int x = Convert.ToInt32(Console.ReadLine()); pokupatel z = new pokupatel(); int y = 1; foreach (var pokupatel in journal.Keys) { if (y == x) { z = pokupatel; break; } y++; } int n = Convert.ToInt32(Console.ReadLine()); int v = 1; foreach (var tovar in tov) { if (v == n) { journal[z].Remove(tovar); } v++; } }
static Dictionary <pokupatel, List <tovar> > Initial() { tovar gv = new tovar("Гвозди", 100); tovar ds = new tovar("Доски", 50); tovar kp = new tovar("Кирпичи", 500); tov = new List <tovar>(); tov.Add(gv); tov.Add(ds); tov.Add(kp); pokupatel a = new pokupatel("Иванов", "8 800 555 35 35"); pokupatel b = new pokupatel("Петров", "8 956 848 76 75"); pokupatel c = new pokupatel("Сидоровов", "9 850 685 55 99"); Dictionary <pokupatel, List <tovar> > pok = new Dictionary <pokupatel, List <tovar> >(); pok.Add(a, new List <tovar>()); pok.Add(b, new List <tovar>() { gv, ds }); pok.Add(c, new List <tovar>() { kp }); return(pok); }
static void UdalPok(ref Dictionary <pokupatel, List <tovar> > journal) { SpisokPokup(journal); int x = Convert.ToInt32(Console.ReadLine()); pokupatel udal = new pokupatel(); int y = 1; foreach (var pokupatel in journal.Keys) { if (y == x) { udal = pokupatel; break; } y++; } journal.Remove(udal); }
static void Main(string[] args) { pokupatel clas = new pokupatel(); Console.Write("Введите фамилию: "); clas.FAMILIA = Convert.ToString(Console.ReadLine()); Console.Write("Введите имя: "); clas.IM9 = Convert.ToString(Console.ReadLine()); Console.Write("Введите отчество: "); clas.OT4ESTVO = Convert.ToString(Console.ReadLine()); Console.Write("Введите номер кредитной карты: "); clas.NOMERkrcart = Convert.ToString(Console.ReadLine()); Console.Write("Введите номер банковского счета: "); clas.NOMERbankc4et = Convert.ToString(Console.ReadLine()); Console.WriteLine("_____________________________"); Console.WriteLine(clas.FAMILIA + " " + clas.IM9 + " " + clas.OT4ESTVO + " " + clas.NOMERkrcart + " " + clas.NOMERbankc4et); Console.ReadLine(); }