コード例 #1
0
        public async Task <AcceptSendToClientSetRes> AcceptSendToClient([FromBody] SendToClientGetReq request)
        {
            var response = new AcceptSendToClientSetRes();

            try
            {
                if (!string.IsNullOrEmpty(request.QRFID) && request.QRFID != "0" && !string.IsNullOrEmpty(request.QRFPriceID))
                {
                    response = await _agentApprovalRepository.AcceptSendToClient(request);
                }
                else
                {
                    response.ResponseStatus.Status       = "Failure";
                    response.ResponseStatus.ErrorMessage = "Request details can not be blank.";
                }

                if (string.IsNullOrEmpty(request.VoyagerUserId) && response.ResponseStatus != null && !string.IsNullOrEmpty(response.ResponseStatus.Status) && response.ResponseStatus.Status == "Success" && !string.IsNullOrEmpty(request.QRFID))
                {
                    var quoteInfo = _quoteRepository.getQuoteInfo(request.QRFID).Result;
                    request.VoyagerUserId = quoteInfo.SalesPerson;
                }

                if (response.ResponseStatus != null && !string.IsNullOrEmpty(response.ResponseStatus.Status) && response.ResponseStatus.Status == "Success" && !string.IsNullOrEmpty(request.QRFID) && !string.IsNullOrEmpty(request.VoyagerUserId))
                {
                    Task.Run(() => _mSDynamicsRepository.CreateUpdateQuotation(request.QRFID, request.VoyagerUserId).Result);
                }
            }
            catch (Exception ex)
            {
                response.ResponseStatus.Status       = "Failure";
                response.ResponseStatus.ErrorMessage = "An Error Occurs :- " + ex.Message;
            }

            return(response);
        }
コード例 #2
0
        public async Task <AcceptSendToClientSetRes> AcceptSendToClient(SendToClientGetReq sendToClientGetReq)
        {
            AcceptSendToClientSetRes acceptSendToClientSetRes = new AcceptSendToClientSetRes();

            acceptSendToClientSetRes = await serviceProxy.PostData(_configuration.GetValue <string>("AgentApproval:AcceptSendToClient"), sendToClientGetReq, typeof(AcceptSendToClientSetRes));

            return(acceptSendToClientSetRes);
        }
コード例 #3
0
ファイル: AgentApproval.cs プロジェクト: dilip07156/CoreUI
        public OfflineMessageViewModel AcceptSendToClient(SendToClientGetReq request)
        {
            OfflineMessageViewModel model = new OfflineMessageViewModel();

            model.COHeaderViewModel = new COHeaderViewModel();
            try
            {
                AcceptSendToClientSetRes objAcceptSendToClientSetRes = agentApprovalProviders.AcceptSendToClient(request).Result;

                if (objAcceptSendToClientSetRes != null)
                {
                    model.QRFPriceID        = request.QRFPriceID;
                    model.QRFID             = request.QRFID;
                    model.SalesOfficerName  = objAcceptSendToClientSetRes.SalesOfficerName;
                    model.SalesOfficerPhone = objAcceptSendToClientSetRes.SalesOfficerPhone;
                    model.Status            = objAcceptSendToClientSetRes.Status;
                    model.MailStatus        = objAcceptSendToClientSetRes.MailStatus;
                    model.ErrorMessage      = objAcceptSendToClientSetRes.ResponseStatus?.ErrorMessage;

                    if (objAcceptSendToClientSetRes.CostingGetRes != null && objAcceptSendToClientSetRes.CostingGetRes.CostingGetProperties != null)
                    {
                        CostingGetProperties objResult = objAcceptSendToClientSetRes.CostingGetRes.CostingGetProperties;
                        model.COHeaderViewModel.QRFID         = objResult.QRFID;
                        model.COHeaderViewModel.AgentName     = objResult.AgentInfo.AgentName;
                        model.COHeaderViewModel.TourCode      = objResult.AgentProductInfo.TourCode;
                        model.COHeaderViewModel.TourName      = objResult.AgentProductInfo.TourName;
                        model.COHeaderViewModel.NoOfNights    = Convert.ToInt32(objResult.AgentProductInfo.Duration);
                        model.COHeaderViewModel.NoOfDays      = Convert.ToInt32(objResult.AgentProductInfo.Duration) + 1;
                        model.COHeaderViewModel.SalesPerson   = objResult.SalesOfficer;
                        model.COHeaderViewModel.ContactPerson = objResult.AgentInfo.ContactPerson;
                        model.COHeaderViewModel.Destination   = objResult.AgentProductInfo.Destination;
                        model.COHeaderViewModel.TravelDate    = objResult.DepartureDates.Count > 0 ? objResult.DepartureDates[0].Date : null;
                        model.COHeaderViewModel.Version       = objResult.VersionId;
                        model.COHeaderViewModel.SystemPhone   = objResult.AgentInfo.MobileNo;

                        // model.COHeaderViewModel.Pax = objResult.AgentPassengerInfo.Where(a => a.Type == "ADULT").Select(b => b.count).FirstOrDefault();
                        // model.COHeaderViewModel.CostingOfficer = objResult.CostingOfficer;
                        //  model.COHeaderViewModel.ProductAccountant = objResult.ProductAccountant;
                        //  model.COHeaderViewModel.ValidForTravel = objResult.ValidForTravel;
                        //  model.COHeaderViewModel.ValidForAcceptance = objResult.ValidForAcceptance;
                    }
                    else
                    {
                        model.COHeaderViewModel.QRFID              = "";
                        model.COHeaderViewModel.AgentName          = "";
                        model.COHeaderViewModel.TourCode           = "";
                        model.COHeaderViewModel.TourName           = "";
                        model.COHeaderViewModel.NoOfNights         = 0;
                        model.COHeaderViewModel.NoOfDays           = 0;
                        model.COHeaderViewModel.SalesPerson        = "";
                        model.COHeaderViewModel.ContactPerson      = "";
                        model.COHeaderViewModel.Destination        = "";
                        model.COHeaderViewModel.TravelDate         = DateTime.MinValue;
                        model.COHeaderViewModel.Version            = 0;
                        model.COHeaderViewModel.Pax                = 0;
                        model.COHeaderViewModel.CostingOfficer     = "";
                        model.COHeaderViewModel.ValidForTravel     = "";
                        model.COHeaderViewModel.ValidForAcceptance = "";
                    }
                }
            }
            catch (Exception ex)
            {
                model.Status       = "Failure";
                model.ErrorMessage = "An Error Occurs:- " + ex.Message;
            }
            return(model);
        }