Пример #1
0
 public static int GetSegmentId(DateTime startDate, DateTime date, PeriodCategory schedule)
 {
     if (schedule == PeriodCategory.Daily)
     {
         return((date - startDate).Duration().Days + 1);
     }
     else if (schedule == PeriodCategory.Weekly)
     {
         return(((date - startDate).Duration().Days + 1) / 7 + 1);
     }
     else if (schedule == PeriodCategory.Monthly)
     {
         return(((date - startDate).Duration().Days + 1) / 30 + 1);
     }
     else if (schedule == PeriodCategory.Monthly)
     {
         return(((date - startDate).Duration().Days + 1) / 365 + 1);
     }
     return(1);
 }
Пример #2
0
 public SummaryRequestType(RequestTypeCategory requestCategory, string id, int queryTypeId, string name, string description, string shortDescription,
                           bool showCategory, bool showSetting, bool showCoverage, bool showAge, bool showSex, bool showMetricType, bool showOutputCriteria,
                           PeriodCategory showPeriods, Lists Lists = Lists.ICD9Diagnosis, bool isMetadataRequest = false)
 {
     RequestCategory = requestCategory;
     ID                 = new Guid(id);
     StringId           = id;
     QueryTypeId        = queryTypeId;
     Name               = name;
     Description        = description;
     ShortDescription   = shortDescription;
     LookupList         = Lists;
     ShowCategory       = showCategory;
     ShowSetting        = showSetting;
     ShowCoverage       = showCoverage;
     ShowAge            = showAge;
     ShowSex            = showSex;
     ShowMetricType     = showMetricType;
     ShowOutputCriteria = showOutputCriteria;
     ShowPeriods        = showPeriods;
     IsMetadataRequest  = isMetadataRequest;
 }
Пример #3
0
        public PeriodCategoryForm(PeriodCategory category)
        {
            InitializeComponent();
            this.Category = category;
//			Categories = Core.Models.Category.FindActive(); // TODO:
        }
 public Task <PeriodCategoryParams> CreatePeriodWithFinanceParams(PeriodCategory periodCategory,
                                                                  FinancePeriodParams financePeriodParams)
 {
     return(_companyEngine.CreatePeriodWithFinanceParamsAsync(periodCategory, financePeriodParams));
 }
 public Task <PeriodCategoryParams> CreatePeriod(PeriodCategory request)
 {
     return(_companyEngine.CreatePeriodAsync(request));
 }
Пример #6
0
        public List <ViolationsHistoricalDTO> GetViolationHistoricalViewByDate(DateTime StartDateTime, DateTime?EndDateTime, PeriodCategory ScheduleType)
        {
            var res = new List <ViolationsHistoricalDTO>();

            var allViolations = GetViolationsHistoryListByDate(StartDateTime, EndDateTime, "");

            if (allViolations != null)
            {
                foreach (var item in allViolations)
                {
                    var segId = DTO.Helper.GetSegmentId(StartDateTime, item.DateTaken, ScheduleType);
                    var seg   = res.FirstOrDefault(x => x.Id == segId);
                    if (seg == null)
                    {
                        seg = new ViolationsHistoricalDTO
                        {
                            Id           = segId,
                            Name         = ScheduleType.ToString() + segId,
                            ScheduleType = ScheduleType,
                        };
                        seg.ViolationsByLocations.Add(new ViolationsGroupedByLocationsDTO()
                        {
                            Latitude = item.Latitude.Value, LocationCode = item.LocationCode, Longitude = item.Longitude.Value, ViolationsCount = 1
                        });
                        res.Add(seg);
                    }
                    else
                    {
                        var violationByLoc = seg.ViolationsByLocations.FirstOrDefault(x => x.LocationCode == item.LocationCode);
                        if (violationByLoc != null)
                        {
                            violationByLoc.ViolationsCount++;
                        }
                        else
                        {
                            seg.ViolationsByLocations.Add(new ViolationsGroupedByLocationsDTO()
                            {
                                Latitude = item.Latitude.Value, LocationCode = item.LocationCode, Longitude = item.Longitude.Value, ViolationsCount = 1
                            });
                        }
                    }
                }
            }
            return(res);
        }