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 #2
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));
        }
Beispiel #3
0
        public IActionResult ProposalPriceBreakup(string QRFID)
        {
            ProposalViewModel model           = new ProposalViewModel();
            ProposalLibrary   proposalLibrary = new ProposalLibrary(_configuration);

            #region Get Proposal Details by QRFId
            //proposalGetReq = new ProposalGetReq();
            //proposalGetReq.QRFID = QRFID;
            //proposalGetRes = coProviders.GetProposal(proposalGetReq, token).Result;
            //model.PriceBreakUp = proposalGetRes.Proposal.PriceBreakup;

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

            return(PartialView("_ProposalPriceBreakup", model.ProposalPriceBreakupViewModel));
        }