/// <summary> /// Gets the date. /// </summary> /// <param name="res">The res.</param> /// <returns></returns> private static DateTime GetDate(DateTime res) { using (DateSelectWindow f = new DateSelectWindow()) { if (res == DateTime.MinValue || res == DateTime.MaxValue) { f.SelectedDate = DateTime.Today; } else { f.SelectedDate = res; } DialogResult dr = f.ShowDialog(); return(dr == DialogResult.Cancel ? res : f.SelectedDate); } }
private bool GetDate(ref DateTime res) { using (DateSelectWindow f = new DateSelectWindow()) { if (res == DateTime.MinValue || res == DateTime.MaxValue) { f.SelectedDate = DateTime.Today; } else { f.SelectedDate = res; } DialogResult dr = f.ShowDialog(); if (dr == DialogResult.Cancel) { return(false); } res = f.SelectedDate; return(true); } }
private bool GetDate(ref DateTime res) { using (DateSelectWindow f = new DateSelectWindow()) { if (res == DateTime.MinValue || res == DateTime.MaxValue) { f.SelectedDate = DateTime.Today; } else { f.SelectedDate = res; } DialogResult dr = f.ShowDialog(); if (dr == DialogResult.Cancel) return false; res = f.SelectedDate; return true; } }
/// <summary> /// Gets the date. /// </summary> /// <param name="res">The res.</param> /// <returns></returns> private static DateTime GetDate(DateTime res) { using (DateSelectWindow f = new DateSelectWindow()) { if (res == DateTime.MinValue || res == DateTime.MaxValue) f.SelectedDate = DateTime.Today; else f.SelectedDate = res; DialogResult dr = f.ShowDialog(); return dr == DialogResult.Cancel ? res : f.SelectedDate; } }