public async Task <SetMaterialisationRes> SetMaterialisation(SetMaterialisationReq setMaterialisationReq, string ticket)
        {
            SetMaterialisationRes objSetMaterialisationRes = new SetMaterialisationRes();

            objSetMaterialisationRes = await serviceProxy.PostData(_configuration.GetValue <string>("Handover:SetMaterialisation"), setMaterialisationReq, typeof(SetMaterialisationRes), ticket);

            return(objSetMaterialisationRes);
        }
Exemple #2
0
        public SetMaterialisationRes SetMaterialisation(Materialisation model, string token)
        {
            SetMaterialisationRes objSetMaterialisationRes = new SetMaterialisationRes();
            SetMaterialisationReq objSetMaterialisationReq = new SetMaterialisationReq();

            try
            {
                objSetMaterialisationReq.mGoAhead           = new mGoAhead();
                objSetMaterialisationReq.mGoAhead.Depatures = new List <Depatures>();
                List <VGER_WAPI_CLASSES.ChildInfo>         ChildInfo         = new List <VGER_WAPI_CLASSES.ChildInfo>();
                List <VGER_WAPI_CLASSES.PassengerRoomInfo> PassengerRoomInfo = new List <VGER_WAPI_CLASSES.PassengerRoomInfo>();
                if (model.ChildInfo != null && model.ChildInfo.Count > 0)
                {
                    ChildInfo = model.ChildInfo.Select(a => new VGER_WAPI_CLASSES.ChildInfo
                    {
                        Age         = a.Age,
                        ChildInfoId = a.ChildInfoId,
                        IsDeleted   = a.IsDeleted,
                        Number      = a.Number,
                        Type        = a.Type
                    }).ToList();
                }
                if (model.RoomInfo != null && model.RoomInfo.Count > 0)
                {
                    PassengerRoomInfo = model.RoomInfo.Select(a => new VGER_WAPI_CLASSES.PassengerRoomInfo
                    {
                        RoomCount    = a.RoomCount,
                        RoomTypeID   = a.RoomTypeID,
                        RoomTypeName = a.RoomTypeName,
                        PaxCount     = a.PaxCount
                    }).ToList();
                }
                objSetMaterialisationReq.mGoAhead.Depatures.Add(new Depatures {
                    DepatureId = model.DepartureId, PassengerRoomInfo = PassengerRoomInfo, ChildInfo = ChildInfo
                });
                objSetMaterialisationReq.mGoAhead.QRFID     = model.QRFID;
                objSetMaterialisationReq.mGoAhead.GoAheadId = model.GoAheadId;

                objSetMaterialisationRes = handoverProviders.SetMaterialisation(objSetMaterialisationReq, token).Result;
                objSetMaterialisationRes = objSetMaterialisationRes != null ? objSetMaterialisationRes : new SetMaterialisationRes();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            return(objSetMaterialisationRes);
        }
Exemple #3
0
        public async Task <SetMaterialisationRes> SetMaterialisation([FromBody] SetMaterialisationReq request)
        {
            var response = new SetMaterialisationRes();

            try
            {
                if (request != null)
                {
                    response = await _handoverRepository.SetMaterialisation(request);
                }
                else
                {
                    response.ResponseStatus.Status       = "Failure";
                    response.ResponseStatus.ErrorMessage = "Details can not be blank.";
                }
            }
            catch (Exception ex)
            {
                response.ResponseStatus.Status       = "Failure";
                response.ResponseStatus.ErrorMessage = "An Error Occurs :- " + ex.Message;
            }
            return(response);
        }