private static void ChooseDate(Entry txtDate)
 {
     using (ChooseDate chooseDate = new ChooseDate()) {
         if (chooseDate.Run() != ResponseType.Ok)
         {
             txtDate.GrabFocus();
             return;
         }
         txtDate.Text = BusinessDomain.GetFormattedDate(chooseDate.Selection);
     }
 }
示例#2
0
        private void ChooseDate()
        {
            DateTime selectedDate = BusinessDomain.GetDateValue(txtDueDate.Text.Trim());

            if (selectedDate == DateTime.MinValue)
            {
                selectedDate = BusinessDomain.Today;
            }

            using (ChooseDate chooseDate = new ChooseDate(selectedDate))
                if (chooseDate.Run() == ResponseType.Ok)
                {
                    if (chooseDate.Selection.Date >= operation.Date)
                    {
                        txtDueDate.Text = BusinessDomain.GetFormattedDate(chooseDate.Selection);
                    }
                    else
                    {
                        ShowMessageTooEarlyDate();
                    }
                }
        }