예제 #1
0
        public override int GetHashCode()
        {
            var sum =
                PageNumber.GetHashCode() +
                PageSize.GetHashCode();

            if (Tag != null)
            {
                sum += Tag.GetHashCode();
            }

            if (Category != null)
            {
                sum += Category.GetHashCode();
            }

            if (MinimumDate != null)
            {
                sum += MinimumDate.GetHashCode();
            }

            if (MaximumDate != null)
            {
                sum += MaximumDate.GetHashCode();
            }

            return(sum);
        }
예제 #2
0
 private bool SelectLastYear_CanExecute(object obj)
 {
     if (MaximumDate.AddYears(-1) >= MinimumDate)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
예제 #3
0
 private bool SelectLastSixMonths_CanExecute(object obj)
 {
     if (MaximumDate.AddMonths(-6) >= MinimumDate)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
        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);
        }
예제 #5
0
        public override bool Equals(object obj)
        {
            if (obj is EntryCriteria)
            {
                var other = obj as EntryCriteria;

                if (!PageNumber.Equals(other.PageNumber))
                {
                    return(false);
                }

                if (!PageSize.Equals(other.PageSize))
                {
                    return(false);
                }

                if (Tag == null && other.Tag != null)
                {
                    return(false);
                }

                if (Tag != null)
                {
                    if (other.Tag == null || !Tag.Equals(other.Tag))
                    {
                        return(false);
                    }
                }

                if (Category == null && other.Category != null)
                {
                    return(false);
                }

                if (Category != null)
                {
                    if (other.Category == null || !Category.Equals(other.Category))
                    {
                        return(false);
                    }
                }

                if (MinimumDate == null && other.MinimumDate != null)
                {
                    return(false);
                }

                if (MinimumDate != null)
                {
                    if (other.MinimumDate == null || !MinimumDate.Equals(other.MinimumDate))
                    {
                        return(false);
                    }
                }

                if (MaximumDate == null && other.MaximumDate != null)
                {
                    return(false);
                }

                if (MaximumDate != null)
                {
                    if (other.MaximumDate == null || !MaximumDate.Equals(other.MaximumDate))
                    {
                        return(false);
                    }
                }

                return(true);
            }

            return(false);
        }
예제 #6
0
 private void SelectLastYearCommand(object obj)
 {
     FromDate = MaximumDate.AddYears(-1);
     ToDate   = MaximumDate;
 }
예제 #7
0
 private void SelectLastMonthCommand(object obj)
 {
     FromDate = MaximumDate.AddMonths(-1);
     ToDate   = MaximumDate;
 }
예제 #8
0
 private void SelectLastThreeMonthsCommand(object obj)
 {
     FromDate = MaximumDate.AddMonths(-3);
     ToDate   = MaximumDate;
 }
예제 #9
0
        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);
        }