private void BtnNewClick(object sender, EventArgs e) { short year; byte month; if (NewPeriodForm.Execute(this, out year, out month)) { FillPeriods(year, month); } }
public static bool Execute(IWin32Window owner, out short year, out byte month) { using (var form = new NewPeriodForm()) { form.Initialize(); if (form.ShowDialog(owner) == DialogResult.OK) { year = form.Year; month = form.Month; return(true); } } year = 0; month = 0; return(false); }