private bool CheckDate() { if (dtoStartDate.DateTimeOffset > dtoEndDate.DateTimeOffset) { Utility.Mbox("알림", "날짜 입력이 잘못되었습니다. 종료 날짜는 시작 날짜보다 빠를 수 없습니다."); dtoStartDate.DateTimeOffset = SelectedStartDate; dtoEndDate.DateTimeOffset = SelectedEndDate; return(false); } if (dtoStartDate.DateTimeOffset.DateTime < MinimumDate) { Utility.Mbox("알림", $"입력 가능한 최소 날짜는 {MinimumDate.ToShortDateString()}입니다"); dtoStartDate.DateTimeOffset = SelectedStartDate; return(false); } if (dtoEndDate.DateTimeOffset.DateTime > MaximumDate) { Utility.Mbox("알림", $"입력 가능한 최대 날짜는 {MaximumDate.ToShortDateString()}입니다"); dtoEndDate.DateTimeOffset = SelectedEndDate; return(false); } return(true); }
void Period_ValueChanged(object sender, EventArgs e) { if (dateStart.Value > dateEnd.Value) { box.BackgroundColor = Xwt.Drawing.Colors.Red; box.TooltipText = string.Format(Application.TranslationCatalog.GetString("Invalid period, the start date must be less than or equal to the final, and the period must be between {0} and {1}"), MinimumDate.ToShortDateString(), MaximumDate.ToShortDateString()); } else { box.BackgroundColor = Xwt.Drawing.Colors.Transparent; box.TooltipText = string.Format(Application.TranslationCatalog.GetString("The period must be between {0} and {1}"), MinimumDate.ToShortDateString(), MaximumDate.ToShortDateString()); } OnValueChanged(e); }