private void добавитьЗаписьToolStripMenuItem_Click(object sender, EventArgs e) { var temp = new recordForm(); temp.ShowDialog(this); record Record = (temp.getRecord()); if (Record != null && Record.Car != null && Record.Car.Owner != null) { dataBase.addRecordToDB(Record); } temp.Close(); fillDA(); var form = new certificateForm(Record); form.ShowDialog(this); }
public record getRecord() { double _insurancePrice; record Record = null; double.TryParse(insurancePrice.Text, out _insurancePrice); if (_insurancePrice > 0) { return(new record(getCar(), _insurancePrice, dateTimePicker.Value)); } else { label12.BackColor = Color.Red; timer1.Start(); return(Record); } return(null); }