Beispiel #1
0
        public GetContactInfoModel GetCorpContactByCid(int cid)
        {
            ContactInfoModel contactInfoModel = _getContactBll.GetCorpContactByCid(cid);

            if (contactInfoModel == null)
            {
                return(null);
            }
            GetContactInfoModel getContactInfoModel = new GetContactInfoModel().ConvertEntity(contactInfoModel);

            List <ContactIdentificationInfoEntity> contactIdentificationInfoEntities = _contactIdentificationDal.Query <ContactIdentificationInfoEntity>(
                n => n.Contactid == getContactInfoModel.ContactId, true).ToList();

            getContactInfoModel.IdentificationList = Mapper
                                                     .Map <List <ContactIdentificationInfoEntity>, List <IdentificationModel> >(contactIdentificationInfoEntities);

            return(getContactInfoModel);
        }
Beispiel #2
0
        public TravelResponseViewModel GetTravel(TravelRequestViewModel request)
        {
            ContactInfoModel contactInfoModel = _getContactBll.GetCorpContactByCid(request.Cid);

            if (contactInfoModel == null)
            {
                throw new Exception("无法查询到对应的联系人信息");
            }
            //1.查询机场信息
            SearchCityAportModel aportModel = _getCityForFlightServiceBll.SearchAirport(new List <string>()
            {
                "N"
            });
            TravelQueryModel query = Mapper.Map <TravelRequestViewModel, TravelQueryModel>(request);

            query.AportInfo = aportModel;
            query.ContactId = contactInfoModel.ContactId;

            TravelModel travelModel = _getTravelServiceBll.GetTravelList(query);

            TravelResponseViewModel viewModel = Mapper.Map <TravelModel, TravelResponseViewModel>(travelModel);

            return(viewModel);
        }