示例#1
0
        /// <summary>
        /// 差旅非预订员客户获取乘客信息
        /// </summary>
        /// <param name="customerBll"></param>
        /// <returns></returns>
        public List <PassengerInfoModel> GetPassenger(TripNotBookingCustomerBll customerBll)
        {
            IQueryable <ContactInfoEntity> contactInfoEntitieses =
                _contactDal.Query <ContactInfoEntity>(n => n.PCid == customerBll.Customer.Cid && n.IsPassenger == "T");

            contactInfoEntitieses = SearchContact(contactInfoEntitieses);
            List <ContactInfoEntity> contactList = contactInfoEntitieses.ToList();

            return(ConvertContactToPassenger(contactList, new List <CustomerInfoEntity>()
            {
                customerBll.Customer
            }));
        }
示例#2
0
        public List <PassengerInfoModel> GetPassenger(int cid, bool isTemporary, string searchArgs = "", int isOnline = 0)
        {
            CustomerInfoEntity customer    = _customerDal.Find <CustomerInfoEntity>(cid);
            BaseCustomerBll    customerBll = null;

            if (!string.IsNullOrEmpty(customer.CorpID))
            {
                CorporationEntity corporationEntity = _corporationDal.Find <CorporationEntity>(customer.CorpID);
                if (corporationEntity.IsAmplitudeCorp == "T" && !isTemporary) //是差旅公司,并且不是查询临客
                {
                    if (customer.IsMaster == "T")                             //预订员
                    {
                        CustomerUnionInfoEntity customerUnionInfoEntity =
                            _customerUnionDal.Query <CustomerUnionInfoEntity>(n => n.Cid == cid, true).FirstOrDefault();
                        string corpDepartIdList = customerUnionInfoEntity?.CorpDepartIDList;
                        if (!customer.CorpDepartID.HasValue)
                        {
                            throw new Exception("当前预定员部门信息异常");
                        }

                        if (string.IsNullOrEmpty(corpDepartIdList))
                        {
                            corpDepartIdList = customer.CorpDepartID.Value.ToString();
                        }

                        customerBll = new TripDepartBookingCustomerBll(customer, corporationEntity.CorpId,
                                                                       corpDepartIdList);
                    }
                    else
                    {
                        customerBll = new TripNotBookingCustomerBll(customer); //非预订员,普通差旅客户
                    }
                }
                else
                {
                    customerBll = new CommonCustomerBll(customer); //临客
                }
            }
            else
            {
                customerBll = new CommonCustomerBll(customer); //临客
            }

            ICustomerVisitor customerVisitor = new CustomerVisitor(_contactDal, _contactIdentificationDal, _customerDal,
                                                                   _corpDepartmentDal, searchArgs, base.Context, isOnline);
            List <PassengerInfoModel> passengerInfoModels = customerBll.GetPassenger(customerVisitor);

            return(passengerInfoModels);
        }