public async Task <ResponseBaseViewModel <MatchCorpPolicyAndAduitResponseViewModel> > GetCorpPolicyAndAduitRule(
            [FromBody] MatchCorpPolicyAndAduitRequestViewModel request)
        {
            if (request == null)
            {
                request = new MatchCorpPolicyAndAduitRequestViewModel();
            }
            request.Cid = this.GetCid();
            MatchCorpPolicyAndAduitResponseViewModel viewModel = new MatchCorpPolicyAndAduitResponseViewModel();

            await new TaskFactory().StartNew(() =>
            {
                viewModel = _matchCorpPolicyAndAduitApplication.Match(request);
            });

            ResponseBaseViewModel <MatchCorpPolicyAndAduitResponseViewModel> v = new ResponseBaseViewModel
                                                                                 <MatchCorpPolicyAndAduitResponseViewModel>
            {
                Flag = new ResponseCodeViewModel()
                {
                    Code = 0, MojoryToken = this.GetToken()
                },
                Data = viewModel
            };

            return(v);
        }
Beispiel #2
0
        public async Task <ResponseBaseViewModel <GetAduitOrderResponseViewModel> > GetAuditOrderById(
            [FromBody] GetAduitOrderRequestViewModel request)
        {
            request.Cid = this.GetCid();
            if (string.IsNullOrEmpty(request.OrderSource))
            {
                request.OrderSource = this.GetOrderSource();
            }
            GetAduitOrderResponseViewModel viewModel = new GetAduitOrderResponseViewModel();

            await new TaskFactory().StartNew(() =>
            {
                viewModel = _getAduitOrderApplication.GetAuditOrder(request);
            });

            ResponseBaseViewModel <GetAduitOrderResponseViewModel> v = new ResponseBaseViewModel
                                                                       <GetAduitOrderResponseViewModel>
            {
                Flag = new ResponseCodeViewModel()
                {
                    Code = 0, MojoryToken = this.GetToken()
                },
                Data = viewModel
            };

            return(v);
        }
Beispiel #3
0
        public ResponseBaseViewModel <TraOrderCancelResponseViewModel> GetOrderCancel([FromBody] TraOrderCancelViewModel request)
        {
            factory = new OrderCancelFactory();
            domain  = factory.CreateDomainObj();
            TraOrderCancelModel orderCancelModel = new TraOrderCancelModel()
            {
                transactionid = request.TransactionID,
                orderid       = request.OrderID,
            };



            var obj     = domain.DoOrderCancel(orderCancelModel);
            var UIModel = new ResponseBaseViewModel <TraOrderCancelResponseViewModel>();
            var Flag    = new ResponseCodeViewModel();

            UIModel.Flag = Flag;
            TraOrderCancelResponseViewModel model = new TraOrderCancelResponseViewModel()
            {
                OrderID = obj.orderid
            };


            UIModel.Data = model;
            if (obj.code == 100)
            {
                UIModel.Flag.Code = 0;
            }
            else
            {
                UIModel.Flag.Code = Convert.ToInt32(obj.code);
            }
            UIModel.Flag.Message = obj.msg;
            return(UIModel);
        }
Beispiel #4
0
        public async Task <ResponseBaseViewModel <UpdateCustomerPwdResponseViewModel> > UpdateMojoryCustomerPwd(
            [FromBody] UpdateCustomerPwdRequestViewModel request)
        {
            request.Cid = this.GetCid();
            bool flag = false;

            await new TaskFactory().StartNew(() =>
            {
                flag = _updateCustomerPwdApplication.UpdateMojoryCustomerPwd(request);
            });

            ResponseBaseViewModel <UpdateCustomerPwdResponseViewModel> v = new ResponseBaseViewModel
                                                                           <UpdateCustomerPwdResponseViewModel>
            {
                Flag = new ResponseCodeViewModel()
                {
                    Code = 0, MojoryToken = this.GetToken()
                },
                Data = new UpdateCustomerPwdResponseViewModel()
                {
                    IsSuccessed = flag
                }
            };

            return(v);
        }
        public async Task <ResponseBaseViewModel <SetReadMessageResponseViewModel> > SetReadMessage(
            [FromBody] SetReadMessageRequestViewModel request)
        {
            if (request == null)
            {
                request = new SetReadMessageRequestViewModel();
            }

            request.Cid = this.GetCid();

            SetReadMessageResponseViewModel viewModel = new SetReadMessageResponseViewModel();

            await new TaskFactory().StartNew(() =>
            {
                bool flag = _getAppMessageApplication.SetRead(request.SendId);
                viewModel = new SetReadMessageResponseViewModel()
                {
                    IsSuccessed = flag
                };
            });

            ResponseBaseViewModel <SetReadMessageResponseViewModel> v = new ResponseBaseViewModel
                                                                        <SetReadMessageResponseViewModel>
            {
                Flag = new ResponseCodeViewModel()
                {
                    Code = 0, MojoryToken = this.GetToken()
                },
                Data = viewModel
            };

            return(v);
        }
        public async Task <ResponseBaseViewModel <AppOpinionResponseViewModel> > AddMojoryAppOpinion(
            [FromBody] AppOpinionRequestViewModel request)
        {
            request.Cid = this.GetCid();
            bool flag = false;

            await new TaskFactory().StartNew(() =>
            {
                flag = _addAppOpinionApplication.AddMojoryOpinion(request);
            });
            ResponseBaseViewModel <AppOpinionResponseViewModel> v = new ResponseBaseViewModel
                                                                    <AppOpinionResponseViewModel>
            {
                Flag = new ResponseCodeViewModel()
                {
                    Code = 0, MojoryToken = this.GetToken()
                },
                Data = new AppOpinionResponseViewModel()
                {
                    IsSuccessed = flag
                }
            };

            return(v);
        }
Beispiel #7
0
        public async Task <ResponseBaseViewModel <GetCorpAduitCustomerResponseViewModel> > GetCorpAduitCustomers(
            [FromBody] GetCorpAduitCustomerRequestViewModel request)
        {
            request.Cid = this.GetCid();
            if (request.AduitId == 0)
            {
                throw new Exception("审批规则Id不能为0");
            }
            GetCorpAduitCustomerResponseViewModel viewModel = new GetCorpAduitCustomerResponseViewModel();

            await new TaskFactory().StartNew(() =>
            {
                viewModel = _getCorpAduitCustomerApplication.GetCorpAduitCustomer(request);
            });

            ResponseBaseViewModel <GetCorpAduitCustomerResponseViewModel> v = new ResponseBaseViewModel
                                                                              <GetCorpAduitCustomerResponseViewModel>
            {
                Flag = new ResponseCodeViewModel()
                {
                    Code = 0, MojoryToken = this.GetToken()
                },
                Data = viewModel
            };

            return(v);
        }
Beispiel #8
0
        public ResponseBaseViewModel <List <PassengerViewModel> > SearchContactInfo([FromBody] TraOrderRequestViewModel request)
        {
            int cid = this.GetCid();
            ICustomerDomainFactory factory = new CustomerDomainFactory();
            var domain = factory.CreatePassengerInfoDomainObj();
            List <PassengerViewModel> passengerViewModels = new List <PassengerViewModel>();
            List <PassengerInfoModel> passengerList       = domain.GetPassengerInfoList(cid, request.DepartId,
                                                                                        request.SearchArgs);

            foreach (var p in passengerList)
            {
                PassengerViewModel passengerViewModel = new PassengerViewModel();
                passengerViewModel.ContactId          = p.ContactId;
                passengerViewModel.PassengerName      = p.PassengerName;
                passengerViewModel.Mobile             = p.Mobile;
                passengerViewModel.Phone              = p.Phone;
                passengerViewModel.Email              = p.Email;
                passengerViewModel.Fax                = p.Fax;
                passengerViewModel.IdentificationList = (List <IdentificationViewModel>)
                                                        AutoMapperHelper.DoMapList <IdentificationModel, IdentificationViewModel>(p.IdentificationList);
                passengerViewModels.Add(passengerViewModel);
            }

            ResponseBaseViewModel <List <PassengerViewModel> > v = new ResponseBaseViewModel <List <PassengerViewModel> >()
            {
                Flag = new ResponseCodeViewModel()
                {
                    Code = 0, MojoryToken = this.GetToken()
                },
                Data = passengerViewModels
            };

            return(v);
        }
Beispiel #9
0
        public async Task <ResponseBaseViewModel <GetCustomerInfoResponseViewModel> > GetCustomerInfo(
            [FromBody] GetCustomerInfoRequestViewModel request)
        {
            if (request == null)
            {
                request = new GetCustomerInfoRequestViewModel();
            }
            request.Cid = this.GetCid();
            GetCustomerInfoResponseViewModel viewModel = new GetCustomerInfoResponseViewModel();

            await new TaskFactory().StartNew(() =>
            {
                viewModel = _getCustomerInfoApplication.GetCustomerInfoByCid(request);
            });

            ResponseBaseViewModel <GetCustomerInfoResponseViewModel> v = new ResponseBaseViewModel
                                                                         <GetCustomerInfoResponseViewModel>
            {
                Flag = new ResponseCodeViewModel()
                {
                    Code = 0, MojoryToken = this.GetToken()
                },
                Data = viewModel
            };

            return(v);
        }
Beispiel #10
0
        /// <summary>
        /// 重写拦截层
        /// </summary>
        /// <param name="actionContext"></param>
        public override void OnAuthorization(HttpActionContext actionContext)
        {
            IUnityContainer           unityContainer           = new IocHelper("AuthorizationApi").GetUnityContainer();
            IAuthorizationApplication authorizationApplication = unityContainer.Resolve <IAuthorizationApplication>();

            bool flag        = authorizationApplication.DoAuthorization(actionContext);
            var  resultModel = authorizationApplication.TokenResult;

            if (flag)
            {
                IsAuthorized(actionContext);
                return;
            }
            ResponseBaseViewModel <string> responseView = new ResponseBaseViewModel <string>();

            responseView.Flag = new ResponseCodeViewModel()
            {
                Code        = (int)resultModel.Code,
                Message     = "",
                MojoryToken = resultModel.Token
            };

            actionContext.Response = new HttpResponseMessage
            {
                Content = new StringContent(Json.Encode(responseView), Encoding.UTF8, "application/json")
            };
        }
Beispiel #11
0
        public async Task <ResponseBaseViewModel <CopyTraOrderResponseViewModel> > CopyTraOrder(
            [FromBody] CopyTraOrderRequestViewModel request)
        {
            request.Cid         = this.GetCid();
            request.OrderSource = this.GetOrderSource();
            request.CreateOid   = this.GetOid();
            CopyTraOrderResponseViewModel viewModel = new CopyTraOrderResponseViewModel();

            await new TaskFactory().StartNew(() =>
            {
                viewModel = _copyTraOrderApplication.CopyTraOrder(request);
            });

            ResponseBaseViewModel <CopyTraOrderResponseViewModel> v = new ResponseBaseViewModel
                                                                      <CopyTraOrderResponseViewModel>
            {
                Flag = new ResponseCodeViewModel()
                {
                    Code = 0, MojoryToken = this.GetToken()
                },
                Data = viewModel
            };

            return(v);
        }
Beispiel #12
0
        public ResponseBaseViewModel <TraRequestChangeResponseViewModel> GetRequestChange([FromBody] TraRequestChangeViewModel request)
        {
            factory = new RequestChangeFactory();
            domain  = factory.CreateDomainObj();
            TraRequestChangeModel rModel = new TraRequestChangeModel()
            {
                change_checi      = request.ChangeCheci,
                change_datetime   = request.ChangeDatetime,
                change_zwcode     = request.ChangeZwcode,
                from_station_code = request.FromStationCode,
                from_station_name = request.FromStationName,
                isasync           = request.IsAsync,
                isTs              = request.IsTs,
                LoginUserName     = request.LoginUserName,
                LoginUserPassword = request.LoginUserPassword,
                old_zwcode        = request.OldZwcode,
                orderid           = request.OrderId,
                ordernumber       = request.OrderNumber,
                reqtoken          = request.ReqToken,
                ticketinfo        = new List <TraRequestChangeTicketInfoModel>(),
                to_station_code   = request.ToStationCode,
                to_station_name   = request.ToStationName,
                transactionid     = request.TransactionId
            };

            foreach (var item in request.TicketInfo)
            {
                TraRequestChangeTicketInfoModel infoModel = new TraRequestChangeTicketInfoModel()
                {
                    old_ticket_no    = item.OldTicketNo,
                    passengersename  = item.PassengerseName,
                    passportseno     = item.PassportseNo,
                    passporttypeseid = item.PassportTypeseId,
                    piaotype         = item.PiaoType
                };
                rModel.ticketinfo.Add(infoModel);
            }

            var obj = domain.DoRequestChange(rModel);

            var uiModel = new ResponseBaseViewModel <TraRequestChangeResponseViewModel>();
            var flag    = new ResponseCodeViewModel();

            uiModel.Flag = flag;
            TraRequestChangeResponseViewModel tmodel = new TraRequestChangeResponseViewModel()
            {
                HelpInfo      = obj.help_info,
                OrderId       = obj.orderid,
                ReqToken      = obj.reqtoken,
                TransactionId = obj.transactionid
            };

            uiModel.Data = tmodel;
            if (obj.code == 100)
            {
                uiModel.Flag.Code = 0;
            }

            return(uiModel);
        }
        public async Task <ResponseBaseViewModel <AddOrderResponseViewModel> > AddFltDomesticOrder(
            [FromBody] AddOrderRequestViewModel request)
        {
            request.Cid         = this.GetCid();
            request.OrderSource = this.GetOrderSource();
            request.CreateOid   = this.GetOid();
            AddOrderResponseViewModel viewModel = new AddOrderResponseViewModel();

            await new TaskFactory().StartNew(() =>
            {
                viewModel = _addOrderApplication.AddDomesticOrderApplicationService(request);
            });

            ResponseBaseViewModel <AddOrderResponseViewModel> v = new ResponseBaseViewModel
                                                                  <AddOrderResponseViewModel>
            {
                Flag = new ResponseCodeViewModel()
                {
                    Code = 0, MojoryToken = this.GetToken()
                },
                Data = viewModel
            };

            return(v);
        }
Beispiel #14
0
        public ResponseBaseViewModel <List <TraTrainInfoResponseDateDetailViewModel> > GetTrainInfo(
            [FromBody] TraTrainInfoViewModel request)
        {
            factory = new TrainInfoFactory();
            domain  = factory.CreateDomainObj();

            TraTrainInfoModel trainInfoModel = new TraTrainInfoModel()
            {
                from_station = request.FromStation,
                to_station   = request.ToStation,
                train_code   = request.TrainCode,
                train_date   = request.TrainDate,
                train_no     = request.TrainNo
            };


            var obj     = domain.DoTrainInfo(trainInfoModel);
            var uiModel = new ResponseBaseViewModel <List <TraTrainInfoResponseDateDetailViewModel> >();

            if (obj == null)
            {
                throw new Exception("无经停信息");
            }
            var flag = new ResponseCodeViewModel();

            uiModel.Flag = flag;
            List <TraTrainInfoResponseDateDetailViewModel> listModel =
                new List <TraTrainInfoResponseDateDetailViewModel>();

            foreach (var item in obj)
            {
                TraTrainInfoResponseDateDetailViewModel model = new TraTrainInfoResponseDateDetailViewModel()
                {
                    ArriveDays   = item.arrive_days,
                    ArriveTime   = item.arrive_time,
                    StartTime    = item.start_time,
                    StationName  = item.station_name,
                    StationNo    = item.station_no,
                    StopOverTime = item.stopover_time
                };
                listModel.Add(model);
            }



            uiModel.Data = listModel;

            if (obj.Count == 1)
            {
                uiModel.Flag.Code = 0;
            }



            return(uiModel);
        }
Beispiel #15
0
        public ResponseBaseViewModel <TraRequestConfirmResponseViewModel> GetRequestConfirm([FromBody] TraRequestConfirmViewModel request)
        {
            #region 生产环境,测试帐号不许出票,直接返回
            string testCid = AppSettingsHelper.GetAppSettings(AppSettingsEnum.TestCid);//生产环境,测试帐号不许出票
            if (testCid == this.GetCid().ToString())
            {
                return(new ResponseBaseViewModel <TraRequestConfirmResponseViewModel>()
                {
                    Flag = new ResponseCodeViewModel()
                    {
                        Code = 0
                    },
                    Data = new TraRequestConfirmResponseViewModel()
                    {
                        OrderId = request.OrderId,
                        TransactionId = request.TransactionId
                    }
                });
            }
            #endregion
            factory = new RequestConfirmFactory();
            domain  = factory.CreateDomainObj();
            TraRequestConfirmModel rcModel = new TraRequestConfirmModel()
            {
                transactionid = request.TransactionId,
                orderid       = request.OrderId,
                reqtoken      = DateTime.Now.ToString("yyyyMMddHHmmss"),
                isasync       = (string.IsNullOrEmpty(request.IsAsync) ? "Y" : request.IsAsync),
            };
            IOrderDomainFactory orderDomainFactory = new OrderDomainFactory();
            IOrderDomain        traOrderDomain     = orderDomainFactory.CreateAddModOrderDomainObj();

            domain.ModComfireEvent += traOrderDomain.DoModComfireEvent;
            var obj = domain.DoRequestConfirm(rcModel);
            domain.ModComfireEvent -= traOrderDomain.DoModComfireEvent;

            var uiModel = new ResponseBaseViewModel <TraRequestConfirmResponseViewModel>();
            var flag    = new ResponseCodeViewModel();
            uiModel.Flag = flag;
            TraRequestConfirmResponseViewModel tmodel = new TraRequestConfirmResponseViewModel()
            {
                OrderId  = obj.orderid,
                ReqToken = obj.reqtoken,

                TransactionId = obj.transactionid
            };

            uiModel.Data = tmodel;
            if (obj.code == 100)
            {
                uiModel.Flag.Code = 0;
            }

            return(uiModel);
        }
Beispiel #16
0
        public ResponseBaseViewModel <CountryViewModel> GetCityInfo()
        {
            var v = new ResponseBaseViewModel <CountryViewModel>();

            v.Data = _queryCityCNApplication.Query();
            v.Flag = new ResponseCodeViewModel()
            {
                Code = 0, Message = "success", MojoryToken = this.GetToken()
            };
            return(v);
        }
Beispiel #17
0
        public ResponseBaseViewModel <TraOrderConfirmResponseViewModel> GetOrderConfirm([FromBody] TraOrderConfirmViewModel request)
        {
            #region 生产环境,测试帐号不许出票,直接返回
            string testCid = AppSettingsHelper.GetAppSettings(AppSettingsEnum.TestCid);//生产环境,测试帐号不许出票
            if (testCid == this.GetCid().ToString())
            {
                return(new ResponseBaseViewModel <TraOrderConfirmResponseViewModel>()
                {
                    Flag = new ResponseCodeViewModel()
                    {
                        Code = 0
                    },
                    Data = new TraOrderConfirmResponseViewModel()
                    {
                        OrderID = request.OrderID,
                        OrderNumber = request.TransactionID
                    }
                });
            }
            #endregion

            factory = new OrderConfirmFactory();
            domain  = factory.CreateDomainObj();
            TraOrderConfirmModel orderConfirmModel = new TraOrderConfirmModel()
            {
                orderid       = request.OrderID,
                transactionid = request.TransactionID
            };

            IOrderDomainFactory orderDomainFactory = new OrderDomainFactory();
            IOrderDomain        orderDomain        = orderDomainFactory.CreateUpdateOrderDomainObj();

            domain.OrderConfirmEvent += orderDomain.DoOrderConfirmEvent;
            var obj = domain.DoOrderConfirm(orderConfirmModel);
            domain.OrderConfirmEvent -= orderDomain.DoOrderConfirmEvent;

            var uiModel = new ResponseBaseViewModel <TraOrderConfirmResponseViewModel>();
            var flag    = new ResponseCodeViewModel();
            uiModel.Flag = flag;
            TraOrderConfirmResponseViewModel model = new TraOrderConfirmResponseViewModel()
            {
                OrderID     = obj.orderid,
                OrderNumber = obj.ordernumber
            };
            uiModel.Flag.Message = obj.msg;
            uiModel.Data         = model;
            if (obj.code == 100)
            {
                uiModel.Flag.Code = 0;
            }

            return(uiModel);
        }
Beispiel #18
0
        public ResponseBaseViewModel <TraSearchOrderInfoResponseViewModel> GetOrderInfo([FromBody] TraSearchOrderInfoViewModel request)
        {
            factory = new OrderInfoFactory();
            domain  = factory.CreateDomainObj();
            TraSearchOrderInfoModel rcModel = new TraSearchOrderInfoModel()
            {
                transactionid = request.TransactionId,
                orderid       = request.OrderId
            };

            var obj     = domain.DoSearchOrderInfo(rcModel);
            var uiModel = new ResponseBaseViewModel <TraSearchOrderInfoResponseViewModel>();
            var flag    = new ResponseCodeViewModel();

            uiModel.Flag = flag;
            TraSearchOrderInfoResponseViewModel tmodel = new TraSearchOrderInfoResponseViewModel()
            {
                CashChange      = obj.cashchange,
                CheCi           = obj.checi, OrderId = obj.orderid,
                TransactionId   = obj.transactionid,
                FromStation     = obj.fromstation,
                OrderNumber     = obj.ordernumber,
                OrderStatusName = obj.orderstatusname,
                ToStation       = obj.tostation,
                TrainTime       = obj.traintime,
                TicketStatus    = new List <TicketStatusViewModel>()
            };

            foreach (var item in obj.ticketstatus)
            {
                TicketStatusViewModel mo = new TicketStatusViewModel();
                mo.Cxin            = item.cxin;
                mo.PassengerseName = item.passengersename;
                mo.PiaoTypeName    = item.piaotypename;
                mo.Price           = item.price;
                mo.Status          = item.status;
                mo.StatusId        = item.statusid;
                mo.TicketNo        = item.ticket_no;

                tmodel.TicketStatus.Add(mo);
            }



            uiModel.Data = tmodel;
            if (obj.code == 100)
            {
                uiModel.Flag.Code = 0;
            }

            return(uiModel);
        }
Beispiel #19
0
        public ResponseBaseViewModel <string> GetToken()
        {
            string token = this.Request.Headers.GetValues("MojoryToken").First();
            ResponseBaseViewModel <string> responseView = new ResponseBaseViewModel <string>();

            responseView.Flag = new ResponseCodeViewModel()
            {
                Code        = 0,
                Message     = "",
                MojoryToken = token
            };
            return(responseView);
        }
Beispiel #20
0
        public ResponseBaseViewModel <TraOrderSubmitResponseViewModel> GetOrderSubmit([FromBody] TraOrderSubmitViewModel request)
        {
            factory = new OrderSubmitFactory();
            domain  = factory.CreateDomainObj();

            TraOrderSubmitModel orderSubmitModel = new TraOrderSubmitModel()
            {
                train_date         = request.TrainDate,
                to_station_name    = request.ToStationName,
                checi              = request.CheCi,
                choose_seats       = request.ChooseSeats,
                from_station_code  = request.FromStationCode,
                from_station_name  = request.FromStationName,
                is_accept_standing = request.IsAcceptStanding,
                is_choose_seats    = request.IsChooseSeats,
                LoginUserName      = request.LoginUserName,
                LoginUserPassword  = request.LoginUserPassword,
                passengers         =
                    (List <TraOrderSubmitPassengerModel>)
                    AutoMapperHelper.DoMapList <TraOrderSubmitPassengerViewModel, TraOrderSubmitPassengerModel>(
                        request.Passengers),
                to_station_code = request.ToStationCode,
                orderid         = request.Orderid
            };



            var obj     = domain.DoOrderSubmit(orderSubmitModel);
            var UIModel = new ResponseBaseViewModel <TraOrderSubmitResponseViewModel>();
            var Flag    = new ResponseCodeViewModel();

            UIModel.Flag = Flag;

            TraOrderSubmitResponseViewModel viewModel = new TraOrderSubmitResponseViewModel()
            {
                OrderID = obj.orderid
            };


            UIModel.Data = viewModel;
            if (obj.code == 100)
            {
                UIModel.Flag.Code = 0;
            }
            else
            {
                UIModel.Flag.Code = Convert.ToInt32(obj.code);
            }
            UIModel.Flag.Message = obj.msg;
            return(UIModel);
        }
Beispiel #21
0
        public ResponseBaseViewModel <CustomerInfoViewModel> GetCustomerInfo()
        {
            int cid = this.GetCid();
            ICustomerDomainFactory customerFactory = new CustomerDomainFactory();
            var customerDomain = customerFactory.CreateDomainObj();
            CustomerInfoModel customerInfoModel = customerDomain.GetCustomerInfo(cid);

            if (customerInfoModel.IsLock == "T")
            {
                throw new Exception("当前客户已经被冻结");
            }
            if (customerInfoModel.IsDel == "T")
            {
                throw new Exception("当前客户已经被删除");
            }

            CustomerInfoViewModel viewModel =
                Mapper.Map <CustomerInfoModel, CustomerInfoViewModel>(customerInfoModel);

            if (!string.IsNullOrEmpty(customerInfoModel.CorpId))
            {
                ICorporationDomainFactory corporationDomainFactory = new CorporationDomainFactory();
                var corpDomain = corporationDomainFactory.CreateDomainObj();
                CorporationModel corporationModel = corpDomain.GetCorporationByCorId(customerInfoModel.CorpId);
                if (corporationModel.IsAmplitudeCorp == "T")
                {
                    viewModel.IsCorpSystemCustomer = "T";
                }
                else
                {
                    viewModel.IsCorpSystemCustomer = "F";
                }
                viewModel.CorpName = corporationModel.CorpName;
            }
            else
            {
                viewModel.IsCorpSystemCustomer = "F";
            }

            ResponseBaseViewModel <CustomerInfoViewModel> v = new ResponseBaseViewModel <CustomerInfoViewModel>()
            {
                Flag = new ResponseCodeViewModel()
                {
                    Code = 0, MojoryToken = this.GetToken()
                },
                Data = viewModel
            };

            return(v);
        }
        public ResponseBaseViewModel <GetRetApplyResponseViewModel> GetRetApply([FromBody] GetRetApplyRequestViewModel request)
        {
            request.Cid = this.GetCid();
            GetRetApplyResponseViewModel responseViewModel         = _getFltDomesticRetApplyViewApplication.GetRetApplyView(request);
            ResponseBaseViewModel <GetRetApplyResponseViewModel> v = new ResponseBaseViewModel <GetRetApplyResponseViewModel>
            {
                Flag = new ResponseCodeViewModel()
                {
                    Code = 0, MojoryToken = this.GetToken()
                },
                Data = responseViewModel
            };

            return(v);
        }
        public ResponseBaseViewModel PostIdentification([FromBody] IdentificationViewModel model)
        {
            var  result = new ResponseBaseViewModel();
            bool flag   = _postIdentificationApplication.PostIdentification(model, this.GetCid());

            if (flag)
            {
                result.Flag      = new ResponseCodeViewModel();
                result.Flag.Code = 0;
            }
            else
            {
                result.Flag.Code = 1;
            }
            return(result);
        }
Beispiel #24
0
        /// <summary>
        /// 查询机场信息
        /// </summary>
        /// <returns></returns>
        public ResponseBaseViewModel <SearchCityAirportResponseViewModel> SearchAirport(SearchCityAirportRequestViewModel request)
        {
            request.Cid = this.GetCid();
            SearchCityAirportResponseViewModel responseViewModel         = _searchAirportApplication.SearchAirport(request);
            ResponseBaseViewModel <SearchCityAirportResponseViewModel> v =
                new ResponseBaseViewModel <SearchCityAirportResponseViewModel>
            {
                Flag = new ResponseCodeViewModel()
                {
                    Code = 0, MojoryToken = this.GetToken()
                },
                Data = responseViewModel
            };

            return(v);
        }
        public ResponseBaseViewModel <QueryFlightModApplyResponseViewModel> QueryModApply(QueryFltRetModApplyRequestViewModel request)
        {
            request.Cid = this.GetCid();
            QueryFlightModApplyResponseViewModel responseViewModel         = _queryFlightModApplyApplication.QueryFlightModApply(request);
            ResponseBaseViewModel <QueryFlightModApplyResponseViewModel> v =
                new ResponseBaseViewModel <QueryFlightModApplyResponseViewModel>
            {
                Flag = new ResponseCodeViewModel()
                {
                    Code = 0, MojoryToken = this.GetToken()
                },
                Data = responseViewModel
            };

            return(v);
        }
Beispiel #26
0
        public ResponseBaseViewModel <CancelTraGrabTicketResponseViewModel> CancelGrabTicket([FromBody] CancelTraGrabTicketRequestViewModel request)
        {
            request.Oid = this.GetOid();
            CancelTraGrabTicketResponseViewModel responseViewModel         = _cancelGrabTicketApplication.CancelGrabTicket(request);
            ResponseBaseViewModel <CancelTraGrabTicketResponseViewModel> v = new ResponseBaseViewModel
                                                                             <CancelTraGrabTicketResponseViewModel>
            {
                Flag = new ResponseCodeViewModel()
                {
                    Code = 0, MojoryToken = this.GetToken()
                },
                Data = responseViewModel
            };

            return(v);
        }
Beispiel #27
0
        public ResponseBaseViewModel <string> MojoryLoginOut()
        {
            string          token          = this.GetToken();
            IUnityContainer unityContainer = new IocHelper("MojoryLoginOutApi").GetUnityContainer();
            ICustomerLoginOutApplication customerLoginOutApplication = unityContainer.Resolve <ICustomerLoginOutApplication>();

            customerLoginOutApplication.MojoryLoginOut(token);
            ResponseBaseViewModel <string> v = new ResponseBaseViewModel <string>
            {
                Flag = new ResponseCodeViewModel()
                {
                    Code = 0, Message = "success", MojoryToken = ""
                }
            };

            return(v);
        }
        public ResponseBaseViewModel <SearchModFlightResponseViewModel> SearchFlight([FromBody] SearchModFlightRequestViewModel request)
        {
            request.Cid = this.GetCid();
            SearchModFlightResponseViewModel responseViewModel = _searchFlightApplication.Search(request);

            ResponseBaseViewModel <SearchModFlightResponseViewModel> v =
                new ResponseBaseViewModel <SearchModFlightResponseViewModel>
            {
                Flag = new ResponseCodeViewModel()
                {
                    Code = 0, MojoryToken = this.GetToken()
                },
                Data = responseViewModel
            };

            return(v);
        }
Beispiel #29
0
        public ResponseBaseViewModel <AddModApplyResponseViewModel> AddModApply([FromBody] AddModApplyRequestViewModel request)
        {
            request.Cid         = this.GetCid();
            request.OrderSource = this.GetOrderSource();
            AddModApplyResponseViewModel responseViewModel = _addFltDomesticModApplyViewApplication.AddModApply(request);

            ResponseBaseViewModel <AddModApplyResponseViewModel> v = new ResponseBaseViewModel <AddModApplyResponseViewModel>
            {
                Flag = new ResponseCodeViewModel()
                {
                    Code = 0, MojoryToken = this.GetToken()
                },
                Data = responseViewModel
            };

            return(v);
        }
Beispiel #30
0
        public ResponseBaseViewModel <TraGrabTicketListResponseViewModel> GetTraGrabTicketList(
            [FromBody] TraGrabTicketListRequestViewModel request)
        {
            TraGrabTicketListResponseViewModel responseViewModel =
                _getTraGrabTicketListApplication.GetTraGrabTicketList(request);
            ResponseBaseViewModel <TraGrabTicketListResponseViewModel> v = new ResponseBaseViewModel
                                                                           <TraGrabTicketListResponseViewModel>
            {
                Flag = new ResponseCodeViewModel()
                {
                    Code = 0, MojoryToken = this.GetToken()
                },
                Data = responseViewModel
            };

            return(v);
        }