示例#1
0
        private async void InitAircrew(List <RecuperationMemberEntity> recuperationMemberList = null)
        {
            var response = await aircrewFacade.GetAircrewList(string.Empty, DateTime.MinValue, DateTime.MaxValue, 0, 2000);

            if (recuperationMemberList != null)
            {
                this.AircrewMemberModel.SelectedAircrewEntityList = new ObservableCollection <AircrewEntity>(recuperationMemberList.Select(r =>
                {
                    var aircrew = response.AircrewList.FirstOrDefault(a => a.TransactionNumber == r.AircrewID);
                    return(new AircrewEntity
                    {
                        TransactionNumber = r.AircrewID.GetValueOrDefault(0),
                        Name = aircrew != null ? aircrew.Name : string.Empty,
                        JobTitle = aircrew != null ? aircrew.JobTitle : string.Empty,
                        TroopsType = aircrew != null ? aircrew.TroopsType : string.Empty
                    });
                }).ToList());

                this.AircrewMemberModel.AircrewEntityList = new ObservableCollection <AircrewEntity>(response.AircrewList.Except(AircrewMemberModel.SelectedAircrewEntityList, new CollectionEqualityCompare()).ToList());
            }
            else
            {
                this.AircrewMemberModel.AircrewEntityList = new ObservableCollection <AircrewEntity>(response.AircrewList);
            }
        }
        private async Task InitAircrew()
        {
            var response = await aircrewFacade.GetAircrewList(string.Empty, DateTime.MinValue, DateTime.MaxValue, 0, 2000);

            response.AircrewList.Insert(0, new AircrewEntity
            {
                TransactionNumber = 0,
                Name = CommonResource.Default_Select
            });
            this.RecuperationInformationModel.AircrewEntityList = response.AircrewList;
            this.RecuperationInformationModel.AircrewEntity     = RecuperationInformationModel.AircrewEntityList.FirstOrDefault();
        }