Example #1
0
 private DateTime PromptForNewBusinessDay(DateTime oldBusinessDayId)
 {
     using (var picker = new BusinessDayPickerForm(BusinessDayRepository))
     {
         var result = picker.ShowDialog(this);
         if (result == DialogResult.OK)
             return picker.ChosenBusinessDay;
         else
             return oldBusinessDayId;
     }
 }
 private void loadBusinessDayToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     DateTime chosenDay;
     using (var selector = new BusinessDayPickerForm(businessDayRepository))
     {
         var result = selector.ShowDialog(this);
         if (result != DialogResult.OK)
         {
             MessageBox.Show(this, "No Business Day was chosen.", "No day chosen", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         else
         {
             chosenDay = selector.ChosenBusinessDay;
             LoadBusinessDay(chosenDay);
         }
     }
 }
Example #3
0
        private void ButtonPickEnd_Click(object sender, EventArgs e)
        {
            using (var picker = new BusinessDayPickerForm(BusinessDayRepository))
            {
                var result = picker.ShowDialog(this);
                if (result != DialogResult.OK)
                    return;

                EndDate = picker.ChosenBusinessDay;
            }
        }