コード例 #1
0
ファイル: Helper.cs プロジェクト: arunsampathkalyan/Projects
 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
ファイル: PeriodCategoryForm.cs プロジェクト: anoozz/nbooks
        public PeriodCategoryForm(PeriodCategory category)
        {
            InitializeComponent();
            this.Category = category;
//			Categories = Core.Models.Category.FindActive(); // TODO:
        }
コード例 #4
0
 public Task <PeriodCategoryParams> CreatePeriodWithFinanceParams(PeriodCategory periodCategory,
                                                                  FinancePeriodParams financePeriodParams)
 {
     return(_companyEngine.CreatePeriodWithFinanceParamsAsync(periodCategory, financePeriodParams));
 }
コード例 #5
0
 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);
        }