Ejemplo n.º 1
0
        private void monthCalendar1_DateChanged(object sender, DayClickEventArgs e)
        {
            DateTime date = Globals.DateFromString(e.Date);

            this.monthCalendar1.SelectDate(date);
            Settings settings = LoadDate(date);

            UpdateSettings(settings, date);
        }
Ejemplo n.º 2
0
 private void monthCalendar1_DayClick(object sender, DayClickEventArgs e)
 {
     if (e.Button == System.Windows.Forms.MouseButtons.Right)
     {
         monthCalendar1.SelectDate(DateTime.Parse(e.Date));
     }
     else if (e.Button == System.Windows.Forms.MouseButtons.Left && SelectedTrainingDay != null)
     {
         DoDragDrop(SelectedTrainingDay, DragDropEffects.Copy | DragDropEffects.Move);
     }
 }
Ejemplo n.º 3
0
 private void mcLichCongViec_DayDoubleClick(object sender, DayClickEventArgs e)
 {
     if (intTestNumber == 0)
     {
         dtpNgayBatDau.Text = e.Date.ToString();
         intTestNumber      = 1;
     }
     else
     {
         dtpNgayXongCV.Text = e.Date.ToString();
         intTestNumber      = 0;
     }
 }
Ejemplo n.º 4
0
        private void monthCalendar1_DayDoubleClick(object sender, DayClickEventArgs e)
        {
            Form1 form = (Form1)ParentForm;

            DateTime selectedDate = Convert.ToDateTime(e.Date, CultureInfo.CurrentCulture);

            if (selectedDate.Month == monthCalendar1.ActiveMonth.Month)
            {
                WindowManager.ShowDatetimeSelectWindow(form, selectedDate);
            }

            monthCalendar1.SelectDate(selectedDate);
        }
Ejemplo n.º 5
0
 private void OnCloneCalendarDayClick(object sender, DayClickEventArgs e)
 {
     if ((ModifierKeys & Keys.Shift) == Keys.Shift || (ModifierKeys & Keys.Control) == Keys.Control)
     {
         if (DateTime.TryParse(e.Date, out var temp))
         {
             if (temp >= _flightDateStart && temp <= _flightDateEnd)
             {
                 if (!(temp >= _sourceNote.StartDay && temp <= _sourceNote.FinishDay))
                 {
                     if (_selectedDate.HasValue)
                     {
                         if (!_selectedRanges.Any(x => x.StartDate <= temp && x.FinishDate >= temp))
                         {
                             var startDate  = _selectedDate.Value < temp ? _selectedDate.Value : temp;
                             var finishDate = _selectedDate.Value > temp ? _selectedDate.Value : temp;
                             if (startDate < _sourceNote.StartDay && finishDate > _sourceNote.FinishDay)
                             {
                                 startDate = _sourceNote.FinishDay.AddDays(1);
                             }
                             var rangesToDelete = new List <DateRange>();
                             rangesToDelete.AddRange(_selectedRanges.Where(x => x.StartDate >= startDate && x.FinishDate <= finishDate));
                             foreach (DateRange rande in rangesToDelete)
                             {
                                 _selectedRanges.Remove(rande);
                             }
                             _selectedRanges.AddRange(_sourceNote.Parent.Parent.CalculateDateRange(new[] { startDate, finishDate }));
                             UpdateSelectedDates();
                             _selectedDate = null;
                         }
                     }
                     else
                     {
                         _selectedDate = temp;
                     }
                 }
             }
             else
             {
                 PopupMessageHelper.Instance.ShowWarning("Pick a date that is in your Schedule Window…");
             }
         }
     }
     else
     {
         _selectedDate = null;
     }
 }
        private void OnCloneCalendarDayClick(object sender, DayClickEventArgs e)
        {
            DateTime temp;

            if (DateTime.TryParse(e.Date, out temp))
            {
                if (temp >= _flightDateStart && temp <= _flightDateEnd)
                {
                    AddSelectedDate(temp);
                }
                else if (temp < _flightDateStart || temp > _flightDateEnd)
                {
                    PopupMessageHelper.Instance.ShowWarning("Pick a date that is in your Schedule Window…");
                }
            }
        }
Ejemplo n.º 7
0
        private void monthCalendarClone_DayClick(object sender, DayClickEventArgs e)
        {
            DateTime temp;

            if (DateTime.TryParse(e.Date, out temp))
            {
                if ((temp >= _originalInsert.Parent.Parent.FlightDateStart && temp <= _originalInsert.Parent.Parent.FlightDateEnd) && _originalInsert.Parent.AvailableDays.Contains(temp))
                {
                    AddSelectedDate(temp);
                }
                else if (temp < _originalInsert.Parent.Parent.FlightDateStart || temp > _originalInsert.Parent.Parent.FlightDateEnd)
                {
                    Utilities.Instance.ShowWarning("Pick a date that is in your Schedule Window…");
                }
                else if (!_originalInsert.Parent.AvailableDays.Contains(temp))
                {
                    Utilities.Instance.ShowWarning("This day is unavailable. Try another day...");
                }
            }
        }
Ejemplo n.º 8
0
 //所點選的日期改變
 private void monthCalendar_DayClick(object sender, DayClickEventArgs e)
 {
     selectedDate = Tool.StringToDate(e.Date);
     ShowSelectedDateActivities(selectedDate);
 }