예제 #1
0
        /// <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);
            }
        }
예제 #2
0
 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;
            }
        }
예제 #4
0
        /// <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;
            }
        }