Beispiel #1
0
        public IActionResult ProposalInclusionsExclusions(string QRFID)
        {
            ProposalInclusionsExclusionsViewModel    model         = new ProposalInclusionsExclusionsViewModel();
            List <App.ViewModels.TermsAndConditions> lstInclusions = new List <App.ViewModels.TermsAndConditions>();
            List <App.ViewModels.TermsAndConditions> lstExclusions = new List <App.ViewModels.TermsAndConditions>();

            #region Get Proposal Inclusions by QRFId
            proposalGetReq         = new ProposalGetReq();
            proposalGetReq.QRFID   = QRFID;
            proposalGetReq.Section = "Inclusions";
            proposalGetRes         = coProviders.GetProposal(proposalGetReq, token).Result;

            if (!string.IsNullOrEmpty(proposalGetRes.Proposal.Inclusions))
            {
                model.Inclusions = proposalGetRes.Proposal.Inclusions;
            }
            else
            {
                foreach (var p in proposalGetRes.TermsAndConditions)
                {
                    lstInclusions.Add(new App.ViewModels.TermsAndConditions {
                        Section = p.Section, Tcs = p.Tcs, OrderNumber = p.OrderNr
                    });
                }
            }
            #endregion

            #region Get Proposal Exclusions by QRFId
            proposalGetReq         = new ProposalGetReq();
            proposalGetReq.QRFID   = QRFID;
            proposalGetReq.Section = "Exclusions";
            proposalGetRes         = coProviders.GetProposal(proposalGetReq, token).Result;

            if (!string.IsNullOrEmpty(proposalGetRes.Proposal.Inclusions))
            {
                model.Exclusions = proposalGetRes.Proposal.Exclusions;
            }
            else
            {
                foreach (var p in proposalGetRes.TermsAndConditions)
                {
                    lstExclusions.Add(new App.ViewModels.TermsAndConditions {
                        Section = p.Section, Tcs = p.Tcs, OrderNumber = p.OrderNr
                    });
                }
            }
            #endregion

            #region Inclusion/Exclusion binding
            model.InclusionList = lstInclusions;
            model.ExclusionList = lstExclusions;
            #endregion

            return(PartialView("_ProposalInclusionsExclusions", model));
        }
        public IActionResult Proposal()
        {
            string QRFID     = Request.Query["QRFId"];
            bool   GetStatus = false;

            ProposalViewModel model = new ProposalViewModel();

            model.MenuViewModel.QRFID    = QRFID;
            model.MenuViewModel.MenuName = "Proposal";
            model.CurrentDate            = DateTime.Now.ToString("dd MMM yyyy");
            string username = "";

            username       = HttpContext.Request.Cookies["UserName"] ?? ckUserName;
            model.UserName = username;

            #region Get Costing Officer Tour Info Header By QRFId
            NewQuoteViewModel modelQuote = new NewQuoteViewModel();
            modelQuote.QRFID                    = QRFID;
            model.COHeaderViewModel             = cOCommonLibrary.GetCOTourInfoHeader(ref modelQuote, token);
            model.MenuViewModel.EnquiryPipeline = modelQuote.mdlMenuViewModel.EnquiryPipeline;
            #endregion

            ProposalLibrary proposalLibrary = new ProposalLibrary(_configuration);

            CompanyOfficerGetRes officerGetRes = new CompanyOfficerGetRes();
            CompanyOfficerGetReq officerGetReq = new CompanyOfficerGetReq();
            officerGetReq.CompanyId = ckUserCompanyId;
            officerGetReq.UserRole  = "Product Accountant";
            officerGetRes           = agentProviders.GetCompanyOfficers(officerGetReq, token).Result;

            model.OfficerList = officerGetRes.ContactDetails;
            var salespipelineres = agentProviders.GetAutomatedSalesPipelineRoles(new SettingsAutomatedGetReq {
                CompanyId = ckUserCompanyId, QRFId = QRFID, UserRole = officerGetReq.UserRole
            }, token).Result;
            if (!string.IsNullOrEmpty(salespipelineres?.ResponseStatus?.Status))
            {
                model.Officer = salespipelineres.UserEmailId;
            }
            #region PriceBreakUp
            if (!string.IsNullOrEmpty(QRFID))
            {
                model.QRFID = QRFID;
                GetStatus   = proposalLibrary.GetProposalPriceBreakupByQRFId(_configuration, token, ref model, QRFID);
            }

            ProposalGetReq request  = new ProposalGetReq();
            ProposalGetRes response = new ProposalGetRes();
            request.QRFID = QRFID;
            response      = coProviders.GetProposal(request, token).Result;
            if (response != null)
            {
                model.ProposalId = response.Proposal.ProposalId;
                model.ProposalPriceBreakupViewModel.PriceBreakUp = response.Proposal.PriceBreakup;
            }

            #endregion
            return(View(model));
        }
Beispiel #3
0
        public IActionResult Proposal(string QRFID)
        {
            ProposalViewModel model = new ProposalViewModel();

            model.MenuViewModel.QRFID    = QRFID;
            model.MenuViewModel.MenuName = "Proposal";

            bool GetStatus = false;

            #region Get Costing Officer Tour Info Header By QRFId
            NewQuoteViewModel modelQuote = new NewQuoteViewModel();
            modelQuote.QRFID                            = QRFID;
            model.COHeaderViewModel                     = cOCommonLibrary.GetCOTourInfoHeader(ref modelQuote, token);
            model.MenuViewModel.EnquiryPipeline         = modelQuote.mdlMenuViewModel.EnquiryPipeline;
            model.AgentApprovalHeaderButtons            = new AgentApprovalHeaderButtons();
            model.AgentApprovalHeaderButtons.QRFID      = QRFID;
            model.AgentApprovalHeaderButtons.QRFPriceID = model.COHeaderViewModel.QRFPriceID;
            #endregion

            ProposalLibrary proposalLibrary = new ProposalLibrary(_configuration);

            #region PriceBreakUp
            if (!string.IsNullOrEmpty(QRFID))
            {
                model.QRFID = QRFID;
                GetStatus   = proposalLibrary.GetProposalPriceBreakupByQRFId(_configuration, token, ref model, QRFID);
            }

            ProposalGetReq request  = new ProposalGetReq();
            ProposalGetRes response = new ProposalGetRes();
            request.QRFID = QRFID;
            response      = coProviders.GetProposal(request, token).Result;
            if (response != null)
            {
                model.ProposalId = response.Proposal.ProposalId;
                model.ProposalPriceBreakupViewModel.PriceBreakUp = response.Proposal.PriceBreakup;
            }
            #endregion

            return(View("Proposal/Proposal", model));
        }