Esempio n. 1
0
        public ApiResponse <TitleTemplateViewModels> GetAllTitleTemplate()
        {
            var apiResponse = new ApiResponse <TitleTemplateViewModels>();

            try
            {
                var listAll = new List <TitleTemplateViewModels>();
                var getAll  = FlightAttendantUtils.GetTitleTemplate(_clientContext);
                getAll?.ForEach(x =>
                {
                    var viewModels = new TitleTemplateViewModels
                    {
                        Id    = x.Id,
                        Title = x.Title,
                        Code  = x.Code
                    };
                    listAll.Add(viewModels);
                });
                apiResponse.Content = listAll;
                return(apiResponse);
            }
            catch (Exception e)
            {
                apiResponse.ErrorType    = 400;
                apiResponse.ErrorMessage = new[] { e.Message };
                return(apiResponse);
            }
        }
Esempio n. 2
0
        public ApiResponse <FlightAttendantTitleViewModels> GetAllFlightAttendantTitle()
        {
            var apiResponse = new ApiResponse <FlightAttendantTitleViewModels>();

            try
            {
                var listAll = new List <FlightAttendantTitleViewModels>();
                var getAll  = FlightAttendantUtils.GetFlightAttendantTitle(_clientContext);
                getAll?.ForEach(x =>
                {
                    var viewModels = new FlightAttendantTitleViewModels
                    {
                        Id            = x.Id,
                        Title         = x.Title,
                        EmployeeCode  = x.EmployeeCode,
                        EmployeeName  = x.EmployeeName,
                        PositionCode  = x.PositionCode,
                        PositionName  = x.PositionName,
                        EffectiveDate = x.EffectiveDate
                    };

                    listAll.Add(viewModels);
                });
                apiResponse.Content = listAll;
                return(apiResponse);
            }
            catch (Exception e)
            {
                apiResponse.ErrorType    = 400;
                apiResponse.ErrorMessage = new[] { e.Message };
                return(apiResponse);
            }
        }
Esempio n. 3
0
        public ApiResponse <ResultFlightViewModels> GetAllResultFlight()
        {
            var apiResponse = new ApiResponse <ResultFlightViewModels>();

            try
            {
                var listAll = new List <ResultFlightViewModels>();
                var getAll  = FlightAttendantUtils.GetResultFlight(_clientContext);
                getAll?.ForEach(x =>
                {
                    var viewModels = new ResultFlightViewModels
                    {
                        Id           = x.Id,
                        IdentifyName = x.IdentifyName,
                        FullName     = x.FullName,
                        PositonName  = x.PositonName,
                        Result       = x.Result,
                        Avarage      = x.Avarage,
                        Note         = x.Note,
                    };
                    if (x.StaffId != null)
                    {
                        viewModels.StaffId = new LookupModels
                        {
                            LookupId    = x.StaffId.LookupId,
                            LookupValue = x.StaffId.LookupValue
                        }
                    }
                    ;
                    if (x.Creator != null)
                    {
                        viewModels.Creator = new LookupModels
                        {
                            LookupId    = x.Creator.LookupId,
                            LookupValue = x.Creator.LookupValue
                        }
                    }
                    ;
                    listAll.Add(viewModels);
                });
                apiResponse.Content = listAll;
                return(apiResponse);
            }
            catch (Exception e)
            {
                apiResponse.ErrorType    = 400;
                apiResponse.ErrorMessage = new[] { e.Message };
                return(apiResponse);
            }
        }
Esempio n. 4
0
        public ApiResponse <ResultDetailFlightAttendantViewModels> GetAllResultDetailFlightAttendant()
        {
            var apiResponse = new ApiResponse <ResultDetailFlightAttendantViewModels>();

            try
            {
                var listAll = new List <ResultDetailFlightAttendantViewModels>();
                var getAll  = FlightAttendantUtils.GetResultDetailFlightAttendant(_clientContext);
                getAll?.ForEach(x =>
                {
                    var viewModels = new ResultDetailFlightAttendantViewModels
                    {
                        Id       = x.Id,
                        Result   = x.Result,
                        Avarage  = x.Avarage,
                        Note     = x.Note,
                        Deadline = x.Deadline,
                    };
                    if (x.EmployeeCode != null)
                    {
                        viewModels.EmployeeCode = new LookupModels
                        {
                            LookupId    = x.EmployeeCode.LookupId,
                            LookupValue = x.EmployeeCode.LookupValue
                        }
                    }
                    ;
                    if (x.Assessor != null)
                    {
                        viewModels.Assessor = new LookupModels
                        {
                            LookupId    = x.Assessor.LookupId,
                            LookupValue = x.Assessor.LookupValue
                        }
                    }
                    ;
                    listAll.Add(viewModels);
                });
                apiResponse.Content = listAll;
                return(apiResponse);
            }
            catch (Exception e)
            {
                apiResponse.ErrorType    = 400;
                apiResponse.ErrorMessage = new[] { e.Message };
                return(apiResponse);
            }
        }
Esempio n. 5
0
        public ApiResponse <FlightAttendantProfileViewModels> GetAllProfile()
        {
            var apiResponse = new ApiResponse <FlightAttendantProfileViewModels>();

            try
            {
                var listAll = new List <FlightAttendantProfileViewModels>();
                var getAll  = FlightAttendantUtils.GetFlightAttendantProfile(_clientContext);
                getAll?.ForEach(x =>
                {
                    var viewModels = new FlightAttendantProfileViewModels
                    {
                        Id    = x.Id,
                        Title = x.Title,
                        FlightAttendantCode = x.FlightAttendantCode.LookupValue,
                        WorkingDate         = x.WorkingDate,
                        FlightCode          = x.FlightCode,
                        FlightDate          = x.FlightDate,
                        FlightTimeUTC       = x.FlightTimeUTC,
                        FlightTimeLocal     = x.FlightTimeLocal,
                        Departure           = x.Departure,
                        Destination         = x.Destination,
                        DutyCode            = x.DutyCode,
                        CrewId          = x.CrewId,
                        EmployeeMission = x.EmployeeMission
                    };

                    listAll.Add(viewModels);
                });
                apiResponse.Content = listAll;
                return(apiResponse);
            }
            catch (Exception e)
            {
                apiResponse.ErrorType    = 400;
                apiResponse.ErrorMessage = new[] { e.Message };
                return(apiResponse);
            }
        }
Esempio n. 6
0
        public ApiResponse <ReviewCategoryViewModels> GetAllReviewCategory()
        {
            var apiResponse = new ApiResponse <ReviewCategoryViewModels>();

            try
            {
                var listAll = new List <ReviewCategoryViewModels>();
                var getAll  = FlightAttendantUtils.GetReviewCategory(_clientContext);
                getAll?.ForEach(x =>
                {
                    var viewModels = new ReviewCategoryViewModels
                    {
                        Id    = x.Id,
                        Phase = x.Phase,
                        EvaluationCriteria = x.EvaluationCriteria,
                        Satisfy            = x.Satisfy,
                        NotSatisfy         = x.NotSatisfy,
                        NeedImprove        = x.NeedImprove,
                        Detail             = x.Detail,
                        EffectiveDate      = x.EffectiveDate,
                        EffectiveToDate    = x.EffectiveToDate
                    };
                    if (x.ReviewCategoryId != null)
                    {
                        viewModels.ReviewCategoryId = new LookupModels
                        {
                            LookupId    = x.ReviewCategoryId.LookupId,
                            LookupValue = x.ReviewCategoryId.LookupValue
                        }
                    }
                    ;
                    if (x.CreatedUser != null)
                    {
                        viewModels.CreatedUser = new LookupModels
                        {
                            LookupValue = x.CreatedUser.LookupValue,
                            LookupId    = x.CreatedUser.LookupId
                        }
                    }
                    ;
                    if (x.BeReviewedUser != null)
                    {
                        viewModels.BeReviewedUser = new LookupModels
                        {
                            LookupId    = x.BeReviewedUser.LookupId,
                            LookupValue = x.BeReviewedUser.LookupValue
                        }
                    }
                    ;
                    listAll.Add(viewModels);
                });
                apiResponse.Content = listAll;
                return(apiResponse);
            }
            catch (Exception e)
            {
                apiResponse.ErrorType    = 400;
                apiResponse.ErrorMessage = new[] { e.Message };
                return(apiResponse);
            }
        }