public void AddMedicine() { string medicineName = ConsoleGUI.PromptRender("Nazwa leku: "); string medicineProducer = ConsoleGUI.PromptRender("Producent: "); int medicineQuantity = ConsoleGUI.PromptRenderInt("Ilość: "); string quantityType = ConsoleGUI.PromptRender("Określenie jednostki: "); decimal price = ConsoleGUI.PromptRenderDecimal("Cena: "); bool refundPossible = ConsoleGUI.PromptRender("Czy jest dostępna refundacja? (t/n)").Trim().ToLower().First() == 't'; Medicine medicine; if (refundPossible) { int refundPercentage = ConsoleGUI.PromptRenderInt("% refundacji: "); medicine = new Medicine(GetNextId(), medicineName, medicineQuantity, quantityType, medicineProducer, price, refundPossible, refundPercentage); } else { medicine = new Medicine(GetNextId(), medicineName, medicineQuantity, quantityType, medicineProducer, price); } medicineDb.Add(medicine); Flush(); }