Exemplo n.º 1
0
        public async Task <QuoteAgentGetRes> GetDivisionList(QuoteSearchReq request, string ticket)
        {
            QuoteAgentGetRes response = new QuoteAgentGetRes();

            response = await serviceProxy.PostData(_configuration.GetValue <string>("ServiceMaster:GetDivisionList"), request, typeof(QuoteAgentGetRes), ticket);

            return(response);
        }
Exemplo n.º 2
0
        public async Task <QuoteAgentGetRes> GetQRFAgentByQRFID(QuoteAgentGetReq objQuoteAgentGetReq, string ticket)
        {
            QuoteAgentGetRes objQuoteAgentGetRes = new QuoteAgentGetRes();

            objQuoteAgentGetRes = await serviceProxy.PostData(_configuration.GetValue <string>("ServiceAgent:GetQRFAgentByQRFID"), objQuoteAgentGetReq, typeof(QuoteAgentGetRes), ticket);

            return(objQuoteAgentGetRes);
        }
Exemplo n.º 3
0
        public IActionResult ProposalCoveringNote(string QRFID)
        {
            ProposalCoveringNoteViewModel model = new ProposalCoveringNoteViewModel();

            #region Get Proposal Details by QRFId
            proposalGetReq       = new ProposalGetReq();
            proposalGetReq.QRFID = QRFID;
            proposalGetRes       = coProviders.GetProposal(proposalGetReq, token).Result;
            //model.CoveringNote = proposalGetRes.Proposal.CoveringNote;
            model.ProposalIncludeRegions = proposalGetRes.Proposal.ProposalIncludeRegions;
            model.CoveringNote           = model.CoveringNote != null?ReplaceCoveringNoteTableOfContents(proposalGetRes.Proposal.CoveringNote, proposalGetRes.Proposal.ProposalIncludeRegions) : null;

            #endregion

            #region Get Quote Info By QRFId
            SalesProviders   objSalesProvider   = new SalesProviders(_configuration);
            QuoteAgentGetReq objQRFAgentRequest = new QuoteAgentGetReq()
            {
                QRFID = QRFID
            };
            QuoteAgentGetRes        objQRFAgentResponse = objSalesProvider.GetQRFAgentByQRFID(objQRFAgentRequest, token).Result;
            QuoteAgentGetProperties objResult           = objQRFAgentResponse.QuoteAgentGetProperties;

            model.QRFID               = QRFID;
            model.CompanyName         = !string.IsNullOrEmpty(objQRFAgentResponse.QuoteAgentGetProperties.SalesPersonCompany) ? objQRFAgentResponse.QuoteAgentGetProperties.SalesPersonCompany : "";
            model.Destination         = !string.IsNullOrEmpty(objResult.AgentProductInfo.Destination) && objResult.AgentProductInfo.Destination.Contains('|') ? objResult.AgentProductInfo.Destination.Split('|')[1] : "";
            model.SalesPersonUserName = !string.IsNullOrEmpty(objQRFAgentResponse.QuoteAgentGetProperties.SalesPersonUserName) ? objQRFAgentResponse.QuoteAgentGetProperties.SalesPersonUserName : "";
            #endregion

            #region Agent Person Binding
            var agentContactPersonId   = objResult.AgentInfo.ContactPersonID;
            AgentContactDetailsReq req = new AgentContactDetailsReq()
            {
                VoyagerContact_Id = agentContactPersonId
            };
            AgentContactDetailsRes res = objSalesProvider.GetContactDetailsByContactID(req, token).Result;

            model.AgentTitle     = res.AgentContactDetailsProperties != null && !string.IsNullOrEmpty(res.AgentContactDetailsProperties.CommonTitle) ? res.AgentContactDetailsProperties.CommonTitle : "";
            model.AgentFirstName = res.AgentContactDetailsProperties != null && !string.IsNullOrEmpty(res.AgentContactDetailsProperties.FirstName) ? res.AgentContactDetailsProperties.FirstName : "";
            model.AgentLastName  = res.AgentContactDetailsProperties != null && !string.IsNullOrEmpty(res.AgentContactDetailsProperties.LastName) ? res.AgentContactDetailsProperties.LastName : "";
            #endregion

            #region Sales Person Details Binding
            var salesPersonContactEmail = objQRFAgentResponse.QuoteAgentGetProperties.SalesPerson;
            ContactDetailsRequest req1  = new ContactDetailsRequest()
            {
                Email = salesPersonContactEmail
            };
            ContactDetailsResponse res1 = loginProviders.GetContactDetails(req1, token).Result;

            model.SalesPersonCommonTitle = res1.Contacts != null && !string.IsNullOrEmpty(res1.Contacts.CommonTitle) ? res1.Contacts.CommonTitle : "";
            model.SalesPersonTitle       = res1.Contacts != null && !string.IsNullOrEmpty(res1.Contacts.TITLE) ? res1.Contacts.TITLE : "";
            model.SalesPersonFullName    = res1.Contacts != null && !string.IsNullOrEmpty(res1.Contacts.FIRSTNAME) && !string.IsNullOrEmpty(res1.Contacts.LastNAME) ? res1.Contacts.FIRSTNAME + " " + res1.Contacts.LastNAME : objQRFAgentResponse.QuoteAgentGetProperties.SalesPersonUserName;
            model.SalesPersonEmail       = res1.Contacts != null && !string.IsNullOrEmpty(res1.Contacts.MAIL) ? res1.Contacts.MAIL : salesPersonContactEmail;
            model.SalesPersonFax         = res1.Contacts != null && !string.IsNullOrEmpty(res1.Contacts.FAX) ? res1.Contacts.FAX : "";
            model.SalesPersonPhone       = res1.Contacts != null && !string.IsNullOrEmpty(res1.Contacts.MOBILE) ? res1.Contacts.MOBILE : "";

            #endregion

            return(PartialView("_ProposalCoveringNote", model));
        }