Пример #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;
            }
        }