Black Box
BBTaskerAdvSetting.cs
1 using System;
2 using System.Windows.Forms;
3 
4 namespace BBTasker
5 {
6  public partial class BBTaskerAdvSetting : Form
7  {
8  public static string StartDate = "";
9  public static string StopDate = "";
10 
11  public BBTaskerAdvSetting()
12  {
13  InitializeComponent();
14  }
15 
16  private void cancelBtn_Click(object sender, EventArgs e)
17  {
18  this.Close();
19  }
20 
24  private void SetDate()
25  {
26  StartDate = StartDateObj.Value.ToString(" MM/dd/yyyy");
27  StopDate = StopDateObj.Value.ToString("MM/dd/yyyy");
28  }
29 
33  private void CheckDate()
34  {
35  DateTime startdate = Convert.ToDateTime(StartDate);
36  DateTime enddate = Convert.ToDateTime(StopDate);
37  DateTime today = DateTime.Today;
38  if ((startdate <= today) && (today <= enddate))
39  {
40 
41  }
42  else
43  {
44  StopDate = "";
45  StartDate = "";
46  MessageBox.Show("Schedule date invalid");
47  }
48  }
49 
54  private void submitBtn_Click(object sender, EventArgs e)
55  {
56  SetDate();
57 
58  CheckDate();
59  }
60  }
61 }