public void AddMedicine() { Console.WriteLine("Podaj nazwę leku: "); string name = Console.ReadLine(); Console.WriteLine("Podaj producenta leku:"); string manufacturer = Console.ReadLine(); Console.WriteLine("Podaj cenę leku:"); decimal price = Decimal.Parse(Console.ReadLine()); Console.WriteLine("Podaj ilość leku:"); int amount = Int32.Parse(Console.ReadLine()); // todo: catch Console.WriteLine("Podaj czy lek jest na receptę. Wciśnij klawisz: [t]-tak [n]-nie:"); // todo: catch bool withPrescription = false; char key = char.Parse(Console.ReadLine()); if (key == 't') { withPrescription = true; } Medicine newMedicine = new Medicine(name, manufacturer, price, withPrescription); var medicineRepository = new MedicineRepository(); medicineRepository.AddToDB(newMedicine); }