void Button1Click(object sender, EventArgs e) { if (textBox1.Text != "" && textBox2.Text != "" && textBox3.Text != "" && textBox4.Text != "") { if (checkBox2.Checked == true) { Firma_Druga Nowa = new Firma_Druga { Kod = textBox1.Text, Nazwa = textBox2.Text, Stawka = Convert.ToDouble(textBox3.Text), Zysk = Convert.ToDouble(textBox4.Text), Kara = checkBox1.Checked }; F._Faktura(Nowa); label1.Text = F.Dokument; } else { Firma_Pierwsza Nowa = new Firma_Pierwsza { Kod = textBox1.Text, Nazwa = textBox2.Text, Stawka = Convert.ToDouble(textBox3.Text), Zysk = Convert.ToDouble(textBox4.Text), Kara = checkBox1.Checked }; F._Faktura(Nowa); label1.Text = F.Dokument; } } }
public MainForm() { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); Firma_Druga Jean = new Firma_Druga { Kod = "921-21", Nazwa = "Jean inc.", Stawka = 0.25, Zysk = 20000, Kara = false }; F._Faktura(Jean); label1.Text = F.Dokument; }