예제 #1
0
        public ActionResult Manage()
        {
            string EmailId = HttpContext.Request.Cookies["EmailId"] ?? ckUserEmailId;

            ManageViewModel manageViewModel = new ManageViewModel();

            LoginProviders     objLoginProvider      = new LoginProviders(_configuration);
            UserDetailsRequest objUserDetailsRequest = new UserDetailsRequest();

            objUserDetailsRequest.UserName = EmailId;

            UserDetailsResponse   objUserDetailsResponse = objLoginProvider.GetUserDetails(objUserDetailsRequest, token).Result;
            ContactDetailsRequest req1 = new ContactDetailsRequest()
            {
                Email = EmailId, Users = new mUsers {
                    VoyagerUser_Id = ckLoginUser_Id
                }
            };
            ContactDetailsResponse res1 = objLoginProvider.GetContactDetails(req1, token).Result;

            manageViewModel.Telephone      = res1.Contacts.TEL;
            manageViewModel.MobileNumber   = res1.Contacts.MOBILE;
            manageViewModel.FaxNumber      = res1.Contacts.FAX;
            manageViewModel.WebSite        = res1.Contacts.WEB;
            manageViewModel.VoyagerUser_Id = objUserDetailsResponse.VoyagerUser_Id;
            //manageViewModel.PhotoPath = _configuration.GetValue<string>("SystemSettings:CountryImageInitial") + objUserDetailsResponse.Photo;
            manageViewModel.PhotoPath = _configuration.GetValue <string>("UIBaseUrl") + objUserDetailsResponse.Photo;
            return(View(manageViewModel));
        }
예제 #2
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));
        }