Пример #1
0
        protected void riskProfileSubmit(object sender, EventArgs e)
        {
            string caseId = "";
            if (ViewState["caseId"] != null)
            {
                caseId = ViewState["caseId"].ToString();
            }

            caseNumber.Value = caseId;

            RiskProfileAnalysis riskProfile = new RiskProfileAnalysis();

            RiskProfileDAO dao = new RiskProfileDAO();

            RiskProfileAnalysis riskProfileAnalysis = dao.getRiskProfileForCase(caseId);

            string status = "new";

            if (riskProfileAnalysis != null)
            {
                status = "update";
                copyRiskProfileBaseClass(riskProfile);

            }
            else
            {
                riskProfile.caseId = caseId;
                copyRiskProfileBaseClass(riskProfile);
            }

            if (status == "new")
            {
                dao.saveNewRiskProfile(riskProfile);
            }
            else
            {
                riskProfile.caseId = caseId;
                dao.updateRiskProfileDetails(riskProfile, "riskApetite");
            }

            string actv = "";
            if (ViewState["activity"] != null)
            {
                actv = ViewState["activity"].ToString();
            }

            string cstatus = activityStatusCheck.getRiskProfileStatus(riskProfile);
            activityStatusDao.saveOrUpdateActivityStatus(caseId, actv, cstatus);

            PortFolioModellingDAO poftFolioDAO = new PortFolioModellingDAO();
            poftFolioDAO.DeletePoftFolioBuilderForCapitalPreservation(caseId);

            markStatusOnTab(caseId);

            string caseStatus = activityStatusCheck.getZPlanStatus(caseId);

            string url = Server.MapPath("~/_layouts/Zurich/Printpages/");
            pdfData = activityStatusCheck.sendDataToSalesPortal(caseId, caseStatus, url, sendPdf);

            populateRiskProfile(riskProfile,caseId);
            riskProfileSaveSuccess.Visible = true;
        }
        protected void riskProfileSubmit(object sender, EventArgs e)
        {
            string caseId = "";
            if (ViewState["caseId"] != null)
            {
                caseId = ViewState["caseId"].ToString();
            }
            //string caseId="2020";
            caseNumber.Value = caseId;

            RiskProfileAnalysis riskProfile = new RiskProfileAnalysis();

            RiskProfileDAO dao = new RiskProfileDAO();

            RiskProfileAnalysis riskProfileAnalysis = dao.getRiskProfileForCase(caseId);

            string status = "new";

            if (riskProfileAnalysis != null)
            {
                status = "update";
                copyRiskProfileBaseClass(riskProfile);

            }
            else
            {
                riskProfile.caseId = caseId;
                copyRiskProfileBaseClass(riskProfile);
            }

            if (status == "new")
            {
                dao.saveNewRiskProfile(riskProfile);
            }
            else
            {
                riskProfile.caseId = caseId;
                dao.updateRiskProfileDetails(riskProfile,"measuringRiskTakingAbility");
            }

            populateRiskProfile(riskProfile, caseId);
        }