Example #1
0
        private List <Summary> GetSummaryList(string groupName)
        {
            SummaryList = new List <Summary>();
            var spannerQuery = _flightSpannersData.GetSpannersByGroupName(groupName);

            foreach (var spanner in spannerQuery)
            {
                SummaryList.Add(new Summary {
                    SpannerCode         = spanner.SpannerCode,
                    SpannerName         = spanner.SpannerFName + " " + spanner.SpannerM1Name,
                    DeservedFlights     = _flightSpannersData.GetSpannerDeservedFlights(spanner.SpannerCode),
                    AllFlights          = _flightSpannersData.GetFlightsAll(spanner.SpannerCode),
                    SpannerLicenseNo    = spanner.SpannerLicenseNo,
                    ShortFlights        = _flightSpannersData.GetFlightsShort(spanner.SpannerCode),
                    LongFlights         = _flightSpannersData.GetFlightsLong(spanner.SpannerCode),
                    ExtraFlights        = _flightSpannersData.GetFlightsExtra(spanner.SpannerCode),
                    MultipleFlights     = _flightSpannersData.GetFlightsMultiple(spanner.SpannerCode),
                    ApologyFlights      = _flightSpannersData.GetFlightsApology(spanner.SpannerCode),
                    BonusFlights        = _flightSpannersData.GetFlightsBonus(spanner.SpannerCode),
                    HolidayFlights      = _flightSpannersData.GetFlightsHoliday(spanner.SpannerCode),
                    CurrentMonthFlights = _flightSpannersData.GetFlightsCurrentMonth(spanner.SpannerCode),
                    IsCurrentlyInActive = _flightSpannersData.IsCurrentlyInActive(spanner.SpannerCode),
                    Balance             = _flightSpannersData.GetSpannerBalance(spanner.SpannerCode)
                });
            }
            return(SummaryList);
        }
        private List <ApprovalsData> GetApprovalsDataList(string groupName)
        {
            ApprovalsDataList = new List <ApprovalsData>();

            var spannerQuery = _flightSpannersData.GetSpannersByGroupName(groupName);

            //Approval approval;
            AircraftType   aircraftType;
            ApprovalDetail approvalDetail;

            foreach (var spanner in spannerQuery)
            {
                var approvalsDataQuery = _flightSpannersData.GetApprovalBySpannerCode(spanner.SpannerCode);

                foreach (var approval in approvalsDataQuery)
                {
                    aircraftType   = _flightSpannersData.GetAircraftTypeByAircraftTypeId(approval.AircraftTypeId);
                    approvalDetail = _flightSpannersData.GetApprovalDetailByApprovalDetailId(approval.ApprovalDetailId);

                    ApprovalsDataList.Add(new ApprovalsData {
                        ApprovalId       = approval.ApprovalId,
                        SpannerCode      = spanner.SpannerCode,
                        SpannerName      = spanner.SpannerFName + " " + spanner.SpannerM1Name,
                        SpannerLicenseNo = spanner.SpannerLicenseNo,
                        AircraftModel    = aircraftType.AircraftModel,
                        EngineModel      = aircraftType.EngineModel,
                        ApprovalRating   = approvalDetail.ApprovalRating,
                        ApprovalCategory = approvalDetail.ApprovalCategory
                    });
                }
            }
            return(ApprovalsDataList);
        }
Example #3
0
        private List <SpannerData> GetSpannersDataList(string groupName)
        {
            SpannersDataList = new List <SpannerData>();
            var spannerQuery = _flightSpannersData.GetSpannersByGroupName(groupName);

            foreach (var spanner in spannerQuery)
            {
                SpannersDataList.Add(new SpannerData {
                    SpannerCode      = spanner.SpannerCode,
                    SpannerName      = spanner.SpannerFName + " " + spanner.SpannerM1Name,
                    SpannerLicenseNo = spanner.SpannerLicenseNo,
                    DepartmentName   = spanner.DepartmentName
                });
            }
            return(SpannersDataList);
        }