private void btnPrikaz_Click(object sender, EventArgs e) { if (cbZemlje.SelectedItem == null) { MessageBox.Show("Choose country first!"); return; } String zemlja = cbZemlje.SelectedItem.ToString(); DateTime dtOd = dtpDatumOd.Value; DateTime dtDo = dtpDatumDo.Value; if (dtOd < new DateTime(2020, 01, 21) || dtOd > new DateTime(2020, 07, 27)) { MessageBox.Show("Date from must be in range 21/01/2020 to 27/07/2020!"); return; } if (dtDo < new DateTime(2020, 01, 21) || dtDo > new DateTime(2020, 07, 27)) { MessageBox.Show("Date to must be in range 21/01/2020 to 27/07/2020!"); return; } StatisticsChild sc = new StatisticsChild(dtOd, dtDo, zemlja); sc.Show(); }
private void btnPrikaz_Click(object sender, EventArgs e) { DateTime dtOd = dtpDatumOd.Value; DateTime dtDo = dtpDatumDo.Value; if (dtOd < new DateTime(2020, 01, 21) || dtOd > new DateTime(2020, 07, 27)) { MessageBox.Show("Date from must be in range 21/01/2020 to 27/07/2020!"); return; } if (dtDo < new DateTime(2020, 01, 21) || dtDo > new DateTime(2020, 07, 27)) { MessageBox.Show("Date to must be in range 21/01/2020 to 27/07/2020!"); return; } StatisticsChild sc = new StatisticsChild(dtOd, dtDo, zemlja.Country); sc.Show(); }