示例#1
0
        public async Task <QuoteThirdPartyGetRes> GetPartnerQuoteDetails(QuoteThirdPartyGetReq request, string ticket)
        {
            QuoteThirdPartyGetRes response = new QuoteThirdPartyGetRes();

            response = await serviceProxy.PostData(_configuration.GetValue <string>("ServiceQuote:GetPartnerQuoteDetails"), request, typeof(QuoteThirdPartyGetRes), ticket);

            return(response);
        }
示例#2
0
        public IActionResult GetPartnerQuoteDetails(QuoteThirdPartyGetReq model)
        {
            QuoteThirdPartyGetRes response = new QuoteThirdPartyGetRes();

            response = salesProviders.GetPartnerQuoteDetails(model, token).Result;

            if (response != null && !string.IsNullOrEmpty(response.QRFID) && !string.IsNullOrEmpty(response.CurrentPipeline))
            {
                if (string.Compare(response.CurrentPipeline, _configuration.GetValue <string>("PipeLines:Quote"), true) == 0)
                {
                    return(RedirectToAction("NewQuote", new { QRFID = response.QRFID, PartnerEntityCode = model.PartnerEntityCode, Application = model.Application, Module = model.Module, Operation = model.Operation }));
                }
                else if (string.Compare(response.CurrentPipeline, _configuration.GetValue <string>("PipeLines:Costing"), true) == 0)
                {
                    return(RedirectToAction("Itinerary", "Itinerary", new { QRFID = response.QRFID, PartnerEntityCode = model.PartnerEntityCode, Application = model.Application, Module = model.Module, Operation = model.Operation }));
                }
                else if (string.Compare(response.CurrentPipeline, _configuration.GetValue <string>("PipeLines:CostingApproval"), true) == 0)
                {
                    return(RedirectToAction("Itinerary", "Itinerary", new { QRFID = response.QRFID, PartnerEntityCode = model.PartnerEntityCode, Application = model.Application, Module = model.Module, Operation = model.Operation }));
                }
                else if (string.Compare(response.CurrentPipeline, _configuration.GetValue <string>("PipeLines:Amendment"), true) == 0)
                {
                    return(RedirectToAction("Itinerary", "Amendment", new { QRFID = response.QRFID, PartnerEntityCode = model.PartnerEntityCode, Application = model.Application, Module = model.Module, Operation = model.Operation }));
                }
                else if (string.Compare(response.CurrentPipeline, _configuration.GetValue <string>("PipeLines:AgentApproval"), true) == 0)
                {
                    return(RedirectToAction("Itinerary", "AgentApproval", new { QRFID = response.QRFID, PartnerEntityCode = model.PartnerEntityCode, Application = model.Application, Module = model.Module, Operation = model.Operation }));
                }
                else if (string.Compare(response.CurrentPipeline, _configuration.GetValue <string>("PipeLines:Handover"), true) == 0)
                {
                    return(RedirectToAction("Itinerary", "Handover", new { QRFID = response.QRFID, PartnerEntityCode = model.PartnerEntityCode, Application = model.Application, Module = model.Module, Operation = model.Operation }));
                }
            }
            else
            {
                AgentThirdPartyGetRes responseNew = new AgentThirdPartyGetRes();
                responseNew = agentProviders.GetPartnerAgentContactDetails(new AgentThirdPartyGetReq()
                {
                    Application = model.Application, PartnerEntityCode = model.PartnerEntityContactCode, PartnerEntityName = ""
                }, token).Result;
                if (responseNew != null)
                {
                    return(RedirectToAction("NewQuote", new { PartnerEntityCode = model.PartnerEntityCode, Application = model.Application, Module = model.Module, Operation = model.Operation, ContactId = responseNew.ContactId, CompanyId = responseNew.CompanyId }));
                }
                return(View("IntegrationError"));
            }

            return(View("IntegrationError"));
        }
示例#3
0
        public IActionResult NewQuote()
        {
            try
            {
                string QRFID             = Request.Query["QRFId"];
                string SubStep           = Convert.ToString(Request.Query["SubStep"]);
                string Module            = Request.Query["Module"];
                string PartnerEntityCode = Request.Query["PartnerEntityCode"];
                string Application       = Request.Query["Application"];
                string Operation         = Request.Query["Operation"];
                string CompanyId         = Request.Query["CompanyId"];
                string ContactId         = Request.Query["ContactId"];

                if (!string.IsNullOrEmpty(SubStep) && SubStep == "Routing")
                {
                    NewQuoteViewModel model = GetRoutingDetails(QRFID);
                    return(PartialView("_QuoteRouting", model.mdlQuoteRoutingViewModel));
                }
                else if (!string.IsNullOrEmpty(SubStep) && SubStep == "Margins")
                {
                    bool IsCostingMargin    = Convert.ToBoolean(Request.Query["IsCostingMargin"]);
                    NewQuoteViewModel model = GetMarginDetails(QRFID, IsCostingMargin);
                    TempData["IsCostingMargin"] = IsCostingMargin;
                    return(PartialView("_QuoteMargins", model.mdlQuoteMarginViewModel));
                }
                else
                {
                    NewQuoteViewModel model = new NewQuoteViewModel();
                    bool GetStatus          = false;
                    model.mdlMenuViewModel.QRFID                       = QRFID;
                    model.mdlQuoteAgentInfoViewModel.Module            = Module;
                    model.mdlQuoteAgentInfoViewModel.PartnerEntityCode = PartnerEntityCode;
                    model.mdlQuoteAgentInfoViewModel.Application       = Application;
                    model.mdlQuoteAgentInfoViewModel.Operation         = Operation;
                    SalesQuoteLibrary quoteLibrary = new SalesQuoteLibrary(_configuration);
                    #region Agent Info
                    if (!string.IsNullOrEmpty(QRFID))
                    {
                        QuoteThirdPartyGetReq modelreq = new QuoteThirdPartyGetReq();
                        model.QRFID    = QRFID;
                        modelreq.QrfID = QRFID;
                        model.mdlQuoteDateRangeViewModel.QRFID = QRFID;
                        GetStatus = quoteLibrary.GetQRFAgentByQRFId(_configuration, token, ref model);

                        QuoteThirdPartyGetRes response = salesProviders.GetPartnerQuoteDetails(modelreq, token).Result;
                        if (response != null)
                        {
                            model.mdlQuoteAgentInfoViewModel.Module            = response?.PartnerEntityName;
                            model.mdlQuoteAgentInfoViewModel.PartnerEntityCode = response?.PartnerEntityCode;
                            model.mdlQuoteAgentInfoViewModel.Application       = response?.ApplicationName?.ToLower();
                        }
                    }
                    else if (!string.IsNullOrEmpty(ContactId) && !string.IsNullOrEmpty(CompanyId))
                    {
                        model.mdlQuoteAgentInfoViewModel.AgentId = CompanyId;
                        var agentInfo = agentProviders.GetAgentDetailedInfo(new AgentGetReq()
                        {
                            CompanyId = CompanyId
                        }, token).Result;
                        model.mdlQuoteAgentInfoViewModel.AgentName     = agentInfo.AgentDetails.Name;
                        model.mdlQuoteAgentInfoViewModel.ContactPerson = ContactId;
                        var contactInfo = agentInfo.AgentDetails.ContactDetails.Where(a => a.Contact_Id == ContactId).FirstOrDefault();
                        model.mdlQuoteAgentInfoViewModel.Email    = contactInfo.MAIL;
                        model.mdlQuoteAgentInfoViewModel.MobileNo = contactInfo.MOBILE;
                    }

                    quoteLibrary.LoadQuoteAgentInfo(_configuration, token, ref model, ckUserEmailId, ckUserCompanyId);
                    #endregion

                    if (model.mdlQuoteAgentInfoViewModel.ContactPersonList.Count == 0)
                    {
                        model.mdlQuoteAgentInfoViewModel.MobileNo = "";
                        model.mdlQuoteAgentInfoViewModel.Email    = "";
                    }

                    return(View(model));
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }