예제 #1
0
        public int GetStatisticValue(CourtCaseRepertory courtCaseRepertory)
        {
            switch (statisitcType)
            {
            case StatisticType.Input:
                return(ThisYearCases(courtCaseRepertory).Count());

            case StatisticType.Closed:
                return(ClosedCases(courtCaseRepertory).Count());

            case StatisticType.Open:
                return(OpenCasesBeforeDate(courtCaseRepertory).Count());

            case StatisticType.OpenFromPreviousYears:
                return(OpenCasesFromPreviousYears(courtCaseRepertory).Count());

            case StatisticType.ClosedThisYear:
                return(ClosedThisYear(courtCaseRepertory).Count());

            case StatisticType.ClosedThisYearFromPreviousYears:
                return(ClosedThisYearFromPreviousYears(courtCaseRepertory).Count());

            default:
                return(-1);
            }
        }
예제 #2
0
 private IEnumerable <CourtCase> OpenCasesFromPreviousYears(CourtCaseRepertory courtCaseRepertory)
 {
     return(OpenCases(courtCaseRepertory).Where(c => c.OriginalInputDate.Year < statisticDate.Year));
 }
예제 #3
0
 private IEnumerable <CourtCase> OpenCasesBeforeDate(CourtCaseRepertory courtCaseRepertory)
 {
     return(OpenCases(courtCaseRepertory).Where(c => c.InputDate <= statisticDate));
 }
예제 #4
0
 private IEnumerable <CourtCase> OpenCases(CourtCaseRepertory courtCaseRepertory)
 {
     return(courtCaseRepertory.Cases.Where(c => c.CloseDate == null));
 }
예제 #5
0
 private IEnumerable <CourtCase> ClosedThisYearFromPreviousYears(CourtCaseRepertory courtCaseRepertory)
 {
     return(ClosedThisYear(courtCaseRepertory).Where(c => c.InputDate.Year < statisticDate.Year));
 }
예제 #6
0
 private IEnumerable <CourtCase> ClosedThisYear(CourtCaseRepertory courtCaseRepertory)
 {
     return(ClosedCases(courtCaseRepertory).Where(c => c.CloseDate.Value.Year == statisticDate.Year));
 }
예제 #7
0
 private IEnumerable <CourtCase> ClosedCases(CourtCaseRepertory courtCaseRepertory)
 {
     return(courtCaseRepertory.Cases.Where(c => c.CloseDate.HasValue && c.CloseDate.Value <= statisticDate));
 }
예제 #8
0
 private IEnumerable <CourtCase> ThisYearCases(CourtCaseRepertory courtCaseRepertory)
 {
     return(courtCaseRepertory.Cases.Where(c => c.InputDate.Year == statisticDate.Year));
 }