Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        public IActionResult QRFSummary(string filterByDay = null, string filterByServiceType = null)
        {
            try
            {
                string QRFID = Request.Query["QRFId"];
                QRFSummaryViewModel model = new QRFSummaryViewModel();
                model.QRFID = QRFID;
                model.MenuViewModel.QRFID    = QRFID;
                model.MenuViewModel.MenuName = "Summary";
                model.CurrentDate            = DateTime.Now.ToString("dd MMM yyyy");
                bool   GetStatus = false;
                string username  = "";
                IRequestCookieCollection objCookies = HttpContext.Request.Cookies;
                objCookies.TryGetValue("UserName", out username);
                username       = string.IsNullOrEmpty(username) ? ckUserName : username;
                model.UserName = username;
                #region Get Quote Info By QRFId
                NewQuoteViewModel modelQuote = new NewQuoteViewModel();
                modelQuote.QRFID = QRFID;
                SalesQuoteLibrary quoteLibrary = new SalesQuoteLibrary(_configuration);
                GetStatus = quoteLibrary.GetQRFAgentByQRFId(_configuration, token, ref modelQuote);
                if (GetStatus)
                {
                    model.TourInfoHeaderViewModel = modelQuote.TourInfoHeaderViewModel;
                }

                CompanyOfficerGetRes officerGetRes = new CompanyOfficerGetRes();
                CompanyOfficerGetReq officerGetReq = new CompanyOfficerGetReq();
                officerGetReq.CompanyId = ckUserCompanyId;
                officerGetReq.UserRole  = "Costing Officer";
                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;
                }
                #endregion
                return(View(model));
            }
            catch (Exception ex)
            {
                throw;
            }
        }