示例#1
0
        public int calculateRiskProfile(RiskProfileAnalysis RiskProfileDetails)
        {
            RiskProfile profile=populateRiskProfile(RiskProfileDetails);
            int riskProfileApetite = calculateRiskProfileApetite(profile);
            int profileRating = calculateRiskProfileApetite(profile);

            int[,] scores = { { 0, 1, 1, 1, 1, 1 }, { 0, 1, 2, 2, 2, 2 }, { 0, 1, 2, 3, 3, 3 }, { 0, 1, 2, 3, 4, 4 }, { 0, 1, 2, 3, 4, 5 } };

            int riskApetite = calculateRiskProfileApetite(profile);
            int riskAbility = calculateRiskProfileAbility(profile);

            int score = scores[riskAbility, riskApetite];
            return score;
        }
示例#2
0
 public int calculateRiskProfileAbilityForPopulate(RiskProfileAnalysis RiskProfileDetails)
 {
     RiskProfile profile = populateRiskProfile(RiskProfileDetails);
     int riskProfileAbility = calculateRiskProfileAbility(profile);
     return riskProfileAbility;
 }
示例#3
0
        public void updateRiskProfileDetails(RiskProfileAnalysis riskProfile,string type)
        {
            RiskProfileAnalysis riskProfileAnalysis = null;
            try
            {
                dbDataContext ct = new dbDataContext();

                //retrieve existing saving goal
                var queryRiskProfileDetails = from al in ct.RiskProfileAnalysis
                                                  where al.caseId == riskProfile.caseId
                                                  select al;
                foreach (RiskProfileAnalysis riskProfileVariable in queryRiskProfileDetails)
                {
                    riskProfileAnalysis = riskProfileVariable;
                }

                riskProfileAnalysis.caseId=riskProfile.caseId;

                    riskProfileAnalysis.agreeWithRiskProfileoption1 = riskProfile.agreeWithRiskProfileoption1;
                    riskProfileAnalysis.agreeWithRiskProfileoption2 = riskProfile.agreeWithRiskProfileoption2;

                    riskProfileAnalysis.riskApetiteQuestion1option1 = riskProfile.riskApetiteQuestion1option1;
                    riskProfileAnalysis.riskApetiteQuestion1option2 = riskProfile.riskApetiteQuestion1option2;
                    riskProfileAnalysis.riskApetiteQuestion1option3 = riskProfile.riskApetiteQuestion1option3;
                    riskProfileAnalysis.riskApetiteQuestion1option4 = riskProfile.riskApetiteQuestion1option4;
                    riskProfileAnalysis.riskApetiteQuestion1option5 = riskProfile.riskApetiteQuestion1option5;
                    riskProfileAnalysis.riskApetiteQuestion1option6 = riskProfile.riskApetiteQuestion1option6;

                    riskProfileAnalysis.riskApetiteQuestion2option1 = riskProfile.riskApetiteQuestion2option1;
                    riskProfileAnalysis.riskApetiteQuestion2option2 = riskProfile.riskApetiteQuestion2option2;
                    riskProfileAnalysis.riskApetiteQuestion2option3 = riskProfile.riskApetiteQuestion2option3;
                    riskProfileAnalysis.riskApetiteQuestion2option4 = riskProfile.riskApetiteQuestion2option4;

                    riskProfileAnalysis.riskApetiteQuestion3option1 = riskProfile.riskApetiteQuestion3option1;
                    riskProfileAnalysis.riskApetiteQuestion3option2 = riskProfile.riskApetiteQuestion3option2;
                    riskProfileAnalysis.riskApetiteQuestion3option3 = riskProfile.riskApetiteQuestion3option3;
                    riskProfileAnalysis.riskApetiteQuestion3option4 = riskProfile.riskApetiteQuestion3option4;
                    riskProfileAnalysis.riskApetiteQuestion3option5 = riskProfile.riskApetiteQuestion3option5;

                    riskProfileAnalysis.riskApetiteQuestion4option1 = riskProfile.riskApetiteQuestion4option1;
                    riskProfileAnalysis.riskApetiteQuestion4option2 = riskProfile.riskApetiteQuestion4option2;
                    riskProfileAnalysis.riskApetiteQuestion4option3 = riskProfile.riskApetiteQuestion4option3;

                    riskProfileAnalysis.measuringRiskTakingAbilityQuestion1option1 = riskProfile.measuringRiskTakingAbilityQuestion1option1;
                    riskProfileAnalysis.measuringRiskTakingAbilityQuestion1option2 = riskProfile.measuringRiskTakingAbilityQuestion1option2;
                    riskProfileAnalysis.measuringRiskTakingAbilityQuestion1option3 = riskProfile.measuringRiskTakingAbilityQuestion1option3;
                    riskProfileAnalysis.measuringRiskTakingAbilityQuestion1option4 = riskProfile.measuringRiskTakingAbilityQuestion1option4;

                    riskProfileAnalysis.measuringRiskTakingAbilityQuestion2option1 = riskProfile.measuringRiskTakingAbilityQuestion2option1;
                    riskProfileAnalysis.measuringRiskTakingAbilityQuestion2option2 = riskProfile.measuringRiskTakingAbilityQuestion2option2;
                    riskProfileAnalysis.measuringRiskTakingAbilityQuestion2option3 = riskProfile.measuringRiskTakingAbilityQuestion2option3;

                    riskProfileAnalysis.measuringRiskTakingAbilityQuestion3option1 = riskProfile.measuringRiskTakingAbilityQuestion3option1;
                    riskProfileAnalysis.measuringRiskTakingAbilityQuestion3option2 = riskProfile.measuringRiskTakingAbilityQuestion3option2;
                    riskProfileAnalysis.measuringRiskTakingAbilityQuestion3option3 = riskProfile.measuringRiskTakingAbilityQuestion3option3;
                    riskProfileAnalysis.measuringRiskTakingAbilityQuestion3option4 = riskProfile.measuringRiskTakingAbilityQuestion3option4;

                    riskProfileAnalysis.measuringRiskTakingAbilityQuestion4option1 = riskProfile.measuringRiskTakingAbilityQuestion4option1;
                    riskProfileAnalysis.measuringRiskTakingAbilityQuestion4option2 = riskProfile.measuringRiskTakingAbilityQuestion4option2;
                    riskProfileAnalysis.measuringRiskTakingAbilityQuestion4option3 = riskProfile.measuringRiskTakingAbilityQuestion4option3;
                    riskProfileAnalysis.measuringRiskTakingAbilityQuestion4option4 = riskProfile.measuringRiskTakingAbilityQuestion4option4;

            if (riskProfileAnalysis.agreeWithRiskProfileoption2 == "true")
                {
                    riskProfileAnalysis.riskProfileValue = riskProfile.riskProfileValue;
                    riskProfileAnalysis.riskProfileName = getRiskProfileName(Int32.Parse(riskProfile.riskProfileValue));
                }
                else
                {
                    int score = calculateRiskProfile(riskProfile);
                    riskProfileAnalysis.riskProfileValue = score + "";
                    String profile_name = getRiskProfileName(score);
                    riskProfileAnalysis.riskProfileName = profile_name;

                }
                ct.SubmitChanges();
            }
            catch (Exception e)
            {
                string str = e.Message;
            }
        }
示例#4
0
        public void saveNewRiskProfile(RiskProfileAnalysis RiskProfileDetails)
        {
            try
            {
                dbDataContext ct = new dbDataContext();

                if (RiskProfileDetails.agreeWithRiskProfileoption2 == "true")
                {
                    RiskProfileDetails.riskProfileName = getRiskProfileName(Int32.Parse(RiskProfileDetails.riskProfileValue));
                }
                else
                {
                    int score = calculateRiskProfile(RiskProfileDetails);
                    RiskProfileDetails.riskProfileValue = score + "";
                    String profile_name = getRiskProfileName(score);
                    RiskProfileDetails.riskProfileName = profile_name;

                }

                ct.RiskProfileAnalysis.InsertOnSubmit(RiskProfileDetails);
                ct.SubmitChanges();
            }
            catch (Exception e)
            {
                string str = e.Message;
            }
        }
示例#5
0
        public RiskProfile populateRiskProfile(RiskProfileAnalysis RiskProfileDetails)
        {
            RiskProfile profile = new RiskProfile();
            if (RiskProfileDetails.riskApetiteQuestion1option1 == "true")
                profile.riskApetiteQuestion1 = "-16";
            if (RiskProfileDetails.riskApetiteQuestion1option2 == "true")
                profile.riskApetiteQuestion1 = "-3";
            if (RiskProfileDetails.riskApetiteQuestion1option3 == "true")
                profile.riskApetiteQuestion1 = "2";
            if (RiskProfileDetails.riskApetiteQuestion1option4 == "true")
                profile.riskApetiteQuestion1 = "8";
            if (RiskProfileDetails.riskApetiteQuestion1option5 == "true")
                profile.riskApetiteQuestion1 = "12";
            if (RiskProfileDetails.riskApetiteQuestion1option6 == "true")
                profile.riskApetiteQuestion1 = "16";

            if (RiskProfileDetails.riskApetiteQuestion2option1 == "true")
                profile.riskApetiteQuestion2 = "1";
            if (RiskProfileDetails.riskApetiteQuestion2option2 == "true")
                profile.riskApetiteQuestion2 = "2";
            if (RiskProfileDetails.riskApetiteQuestion2option3 == "true")
                profile.riskApetiteQuestion2 = "4";
            if (RiskProfileDetails.riskApetiteQuestion2option4 == "true")
                profile.riskApetiteQuestion2 = "5";

            if (RiskProfileDetails.riskApetiteQuestion3option1 == "true")
                profile.riskApetiteQuestion3 = "-4";
            if (RiskProfileDetails.riskApetiteQuestion3option2 == "true")
                profile.riskApetiteQuestion3 = "1";
            if (RiskProfileDetails.riskApetiteQuestion3option3 == "true")
                profile.riskApetiteQuestion3 = "4";
            if (RiskProfileDetails.riskApetiteQuestion3option4 == "true")
                profile.riskApetiteQuestion3 = "5";
            if (RiskProfileDetails.riskApetiteQuestion3option5 == "true")
                profile.riskApetiteQuestion3 = "6";

            if (RiskProfileDetails.riskApetiteQuestion4option1 == "true")
                profile.riskApetiteQuestion4 = "1";
            if (RiskProfileDetails.riskApetiteQuestion4option2 == "true")
                profile.riskApetiteQuestion4 = "3";
            if (RiskProfileDetails.riskApetiteQuestion4option3 == "true")
                profile.riskApetiteQuestion4 = "5";

            if (RiskProfileDetails.measuringRiskTakingAbilityQuestion1option1 == "true")
                profile.measuringRiskTakingAbilityQuestion1 = "-3";
            if (RiskProfileDetails.measuringRiskTakingAbilityQuestion1option2 == "true")
                profile.measuringRiskTakingAbilityQuestion1 = "0";
            if (RiskProfileDetails.measuringRiskTakingAbilityQuestion1option3 == "true")
                profile.measuringRiskTakingAbilityQuestion1 = "3";
            if (RiskProfileDetails.measuringRiskTakingAbilityQuestion1option4 == "true")
                profile.measuringRiskTakingAbilityQuestion1 = "5";

            if (RiskProfileDetails.measuringRiskTakingAbilityQuestion2option1 == "true")
                profile.measuringRiskTakingAbilityQuestion2 = "0";
            if (RiskProfileDetails.measuringRiskTakingAbilityQuestion2option2 == "true")
                profile.measuringRiskTakingAbilityQuestion2 = "3";
            if (RiskProfileDetails.measuringRiskTakingAbilityQuestion2option3 == "true")
                profile.measuringRiskTakingAbilityQuestion2 = "5";

            if (RiskProfileDetails.measuringRiskTakingAbilityQuestion3option1 == "true")
                profile.measuringRiskTakingAbilityQuestion3 = "0";
            if (RiskProfileDetails.measuringRiskTakingAbilityQuestion3option2 == "true")
                profile.measuringRiskTakingAbilityQuestion3 = "2";
            if (RiskProfileDetails.measuringRiskTakingAbilityQuestion3option3 == "true")
                profile.measuringRiskTakingAbilityQuestion3 = "3";
            if (RiskProfileDetails.measuringRiskTakingAbilityQuestion3option4 == "true")
                profile.measuringRiskTakingAbilityQuestion3 = "5";

            if (RiskProfileDetails.measuringRiskTakingAbilityQuestion4option1 == "true")
                profile.measuringRiskTakingAbilityQuestion4 = "0";
            if (RiskProfileDetails.measuringRiskTakingAbilityQuestion4option2 == "true")
                profile.measuringRiskTakingAbilityQuestion4 = "2";
            if (RiskProfileDetails.measuringRiskTakingAbilityQuestion4option3 == "true")
                profile.measuringRiskTakingAbilityQuestion4 = "3";
            if (RiskProfileDetails.measuringRiskTakingAbilityQuestion4option4 == "true")
                profile.measuringRiskTakingAbilityQuestion4 = "5";

            return profile;
        }
示例#6
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;
        }
示例#7
0
        public void copyRiskProfileBaseClass(RiskProfileAnalysis riskProfile)
        {
            if (riskApetiteQuestion1option1.Checked)
            {
                riskProfile.riskApetiteQuestion1option1 = "true";
            }

            if (riskApetiteQuestion1option2.Checked)
            {
                riskProfile.riskApetiteQuestion1option2 = "true";
            }

            if (riskApetiteQuestion1option3.Checked)
            {
                riskProfile.riskApetiteQuestion1option3 = "true";
            }

            if (riskApetiteQuestion1option4.Checked)
            {
                riskProfile.riskApetiteQuestion1option4 = "true";
            }

            if (riskApetiteQuestion1option5.Checked)
            {
                riskProfile.riskApetiteQuestion1option5 = "true";
            }

            if (riskApetiteQuestion1option6.Checked)
            {
                riskProfile.riskApetiteQuestion1option6 = "true";
            }

            if (riskApetiteQuestion2option1.Checked)
            {
                riskProfile.riskApetiteQuestion2option1 = "true";
            }

            if (riskApetiteQuestion2option2.Checked)
            {
                riskProfile.riskApetiteQuestion2option2 = "true";
            }

            if (riskApetiteQuestion2option3.Checked)
            {
                riskProfile.riskApetiteQuestion2option3 = "true";
            }

            if (riskApetiteQuestion2option4.Checked)
            {
                riskProfile.riskApetiteQuestion2option4 = "true";
            }

            if (riskApetiteQuestion3option1.Checked)
            {
                riskProfile.riskApetiteQuestion3option1 = "true";
            }

            if (riskApetiteQuestion3option2.Checked)
            {
                riskProfile.riskApetiteQuestion3option2 = "true";
            }

            if (riskApetiteQuestion3option3.Checked)
            {
                riskProfile.riskApetiteQuestion3option3 = "true";
            }

            if (riskApetiteQuestion3option4.Checked)
            {
                riskProfile.riskApetiteQuestion3option4 = "true";
            }

            if (riskApetiteQuestion3option5.Checked)
            {
                riskProfile.riskApetiteQuestion3option5 = "true";
            }

            if (riskApetiteQuestion4option1.Checked)
            {
                riskProfile.riskApetiteQuestion4option1 = "true";
            }

            if (riskApetiteQuestion4option2.Checked)
            {
                riskProfile.riskApetiteQuestion4option2 = "true";
            }

            if (riskApetiteQuestion4option3.Checked)
            {
                riskProfile.riskApetiteQuestion4option3 = "true";
            }

            if (measuringRiskTakingAbilityQuestion1option1.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion1option1 = "true";
            }

            if (measuringRiskTakingAbilityQuestion1option2.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion1option2 = "true";
            }

            if (measuringRiskTakingAbilityQuestion1option3.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion1option3 = "true";
            }
            if (measuringRiskTakingAbilityQuestion1option4.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion1option4 = "true";
            }

            if (measuringRiskTakingAbilityQuestion2option1.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion2option1 = "true";
            }

            if (measuringRiskTakingAbilityQuestion2option2.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion2option2 = "true";
            }

            if (measuringRiskTakingAbilityQuestion2option3.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion2option3 = "true";
            }

            if (measuringRiskTakingAbilityQuestion3option1.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion3option1 = "true";
            }

            if (measuringRiskTakingAbilityQuestion3option2.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion3option2 = "true";
            }

            if (measuringRiskTakingAbilityQuestion3option3.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion3option3 = "true";
            }

            if (measuringRiskTakingAbilityQuestion3option4.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion3option4 = "true";
            }

            if (measuringRiskTakingAbilityQuestion4option1.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion4option1 = "true";
            }

            if (measuringRiskTakingAbilityQuestion4option2.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion4option2 = "true";
            }

            if (measuringRiskTakingAbilityQuestion4option3.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion4option3 = "true";
            }

            if (measuringRiskTakingAbilityQuestion4option4.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion4option4 = "true";
            }
        }
示例#8
0
 partial void UpdateRiskProfileAnalysis(RiskProfileAnalysis instance);
        public void populateRiskProfile(RiskProfileAnalysis riskProfileAnalysis, string caseId)
        {
            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion1option1 == "true")
            {
                measuringRiskTakingAbilityQuestion1option1.Checked = true;
            }

               if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion1option2 == "true")
               {
               measuringRiskTakingAbilityQuestion1option2.Checked = true;
               }

            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion1option3 == "true")
            {
                measuringRiskTakingAbilityQuestion1option3.Checked = true;
            }

            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion1option4 == "true")
            {
                measuringRiskTakingAbilityQuestion1option4.Checked = true;
            }

            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion2option1 == "true")
            {
                measuringRiskTakingAbilityQuestion2option1.Checked = true;
            }

            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion2option2 == "true")
            {
                measuringRiskTakingAbilityQuestion2option2.Checked = true;
            }

            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion2option3 == "true")
            {
                measuringRiskTakingAbilityQuestion2option3.Checked = true;
            }

            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion3option1 == "true")
            {
                measuringRiskTakingAbilityQuestion3option1.Checked = true;
            }
            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion3option2 == "true")
            {
                measuringRiskTakingAbilityQuestion3option2.Checked = true;
            }
            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion3option3 == "true")
            {
                measuringRiskTakingAbilityQuestion3option3.Checked = true;
            }
            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion3option4 == "true")
            {
                measuringRiskTakingAbilityQuestion3option4.Checked = true;
            }

            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion4option1 == "true")
            {
                measuringRiskTakingAbilityQuestion4option1.Checked = true;
            }

            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion4option2 == "true")
            {
                measuringRiskTakingAbilityQuestion4option2.Checked = true;
            }

            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion4option3 == "true")
            {
                measuringRiskTakingAbilityQuestion4option3.Checked = true;
            }

            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion4option4 == "true")
            {
                measuringRiskTakingAbilityQuestion4option4.Checked = true;
            }

            if (riskProfileAnalysis.agreeWithRiskProfileoption2 == "true")
            {
                isPreferredRiskProfile.Value = "true";
            }
            else
                isPreferredRiskProfile.Value = "false";

            if (riskProfileAnalysis != null)
            {
                RiskProfileDAO dao = new RiskProfileDAO();
                int score = dao.calculateRiskProfileAbilityForPopulate(riskProfileAnalysis);
                //RiskProfileValue.InnerText = score + "";
            }

            activityId.Value = caseId;
        }
示例#10
0
        public void populateRiskProfile(RiskProfileAnalysis riskProfile,string caseId)
        {
            int riskApetiteQuestions = 0;
            int riskTakingAbilityQuestions = 0;

            int riskApetiteQuestionsScore = 0;
            int riskTakingAbilityquestionsScore = 0;

            RiskProfileDAO dao = new RiskProfileDAO();

            RiskProfileAnalysis riskProfileAnalysis = dao.getRiskProfileForCase(riskProfile.caseId);

            if (riskProfileAnalysis.riskApetiteQuestion1option1 == "true")
            {
                riskApetiteQuestions += 1;
                riskApetiteQuestionsScore += -16;
                riskApetiteQuestion1option1.Checked = true;
            }

            if (riskProfileAnalysis.riskApetiteQuestion1option2 == "true")
            {
                riskApetiteQuestionsScore += -3;
                riskApetiteQuestions += 1;
                riskApetiteQuestion1option2.Checked = true;
            }

            if (riskProfileAnalysis.riskApetiteQuestion1option3 == "true")
            {
                riskApetiteQuestionsScore += 2;
                riskApetiteQuestions += 1;
                riskApetiteQuestion1option3.Checked = true;
            }

            if (riskProfileAnalysis.riskApetiteQuestion1option4 == "true")
            {
                riskApetiteQuestionsScore += 8;
                riskApetiteQuestions += 1;
                riskApetiteQuestion1option4.Checked = true;
            }
            if (riskProfileAnalysis.riskApetiteQuestion1option5 == "true")
            {
                riskApetiteQuestionsScore += 12;
                riskApetiteQuestions += 1;
                riskApetiteQuestion1option5.Checked = true;
            }

            if (riskProfileAnalysis.riskApetiteQuestion1option6 == "true")
            {
                riskApetiteQuestionsScore += 16;
                riskApetiteQuestions += 1;
                riskApetiteQuestion1option6.Checked = true;
            }

            if (riskProfileAnalysis.riskApetiteQuestion2option1 == "true")
            {
                riskApetiteQuestionsScore += 1;
                riskApetiteQuestions += 1;
                riskApetiteQuestion2option1.Checked = true;
            }

            if (riskProfileAnalysis.riskApetiteQuestion2option2 == "true")
            {
                riskApetiteQuestionsScore += 2;
                riskApetiteQuestions += 1;
                riskApetiteQuestion2option2.Checked = true;
            }

            if (riskProfileAnalysis.riskApetiteQuestion2option3 == "true")
            {
                riskApetiteQuestionsScore += 4;
                riskApetiteQuestions += 1;
                riskApetiteQuestion2option3.Checked = true;
            }

            if (riskProfileAnalysis.riskApetiteQuestion2option4 == "true")
            {
                riskApetiteQuestionsScore += 5;
                riskApetiteQuestions += 1;
                riskApetiteQuestion2option4.Checked = true;
            }

            if (riskProfileAnalysis.riskApetiteQuestion3option1 == "true")
            {
                riskApetiteQuestionsScore += -4;
                riskApetiteQuestions += 1;
                riskApetiteQuestion3option1.Checked = true;
            }

            if (riskProfileAnalysis.riskApetiteQuestion3option2 == "true")
            {
                riskApetiteQuestionsScore += 1;
                riskApetiteQuestions += 1;
                riskApetiteQuestion3option2.Checked = true;
            }

            if (riskProfileAnalysis.riskApetiteQuestion3option3 == "true")
            {
                riskApetiteQuestionsScore += 4;
                riskApetiteQuestions += 1;
                riskApetiteQuestion3option3.Checked = true;
            }

            if (riskProfileAnalysis.riskApetiteQuestion3option4 == "true")
            {
                riskApetiteQuestionsScore += 5;
                riskApetiteQuestions += 1;
                riskApetiteQuestion3option4.Checked = true;
            }

            if (riskProfileAnalysis.riskApetiteQuestion3option5 == "true")
            {
                riskApetiteQuestionsScore += 6;
                riskApetiteQuestions += 1;
                riskApetiteQuestion3option5.Checked = true;
            }

            if (riskProfileAnalysis.riskApetiteQuestion4option1 == "true")
            {
                riskApetiteQuestionsScore += 1;
                riskApetiteQuestions += 1;
                riskApetiteQuestion4option1.Checked = true;
            }

            if (riskProfileAnalysis.riskApetiteQuestion4option2 == "true")
            {
                riskApetiteQuestionsScore += 3;
                riskApetiteQuestions += 1;
                riskApetiteQuestion4option2.Checked = true;
            }

            if (riskProfileAnalysis.riskApetiteQuestion4option3 == "true")
            {
                riskApetiteQuestionsScore += 5;
                riskApetiteQuestions += 1;
                riskApetiteQuestion4option3.Checked = true;
            }

            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion1option1 == "true")
            {
                riskTakingAbilityquestionsScore += -3;
                riskTakingAbilityQuestions += 1;
                measuringRiskTakingAbilityQuestion1option1.Checked = true;
            }

            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion1option2 == "true")
            {
                riskTakingAbilityquestionsScore += 0;
                riskTakingAbilityQuestions += 1;
                measuringRiskTakingAbilityQuestion1option2.Checked = true;
            }

            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion1option3 == "true")
            {
                riskTakingAbilityquestionsScore += 3;
                riskTakingAbilityQuestions += 1;
                measuringRiskTakingAbilityQuestion1option3.Checked = true;
            }

            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion1option4 == "true")
            {
                riskTakingAbilityquestionsScore += 5;
                riskTakingAbilityQuestions += 1;
                measuringRiskTakingAbilityQuestion1option4.Checked = true;
            }

            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion2option1 == "true")
            {
                riskTakingAbilityquestionsScore += 0;
                riskTakingAbilityQuestions += 1;
                measuringRiskTakingAbilityQuestion2option1.Checked = true;
            }

            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion2option2 == "true")
            {
                riskTakingAbilityquestionsScore += 3;
                riskTakingAbilityQuestions += 1;
                measuringRiskTakingAbilityQuestion2option2.Checked = true;
            }

            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion2option3 == "true")
            {
                riskTakingAbilityquestionsScore += 5;
                riskTakingAbilityQuestions += 1;
                measuringRiskTakingAbilityQuestion2option3.Checked = true;
            }

            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion3option1 == "true")
            {
                riskTakingAbilityquestionsScore += 0;
                riskTakingAbilityQuestions += 1;
                measuringRiskTakingAbilityQuestion3option1.Checked = true;
            }
            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion3option2 == "true")
            {
                riskTakingAbilityquestionsScore += 2;
                riskTakingAbilityQuestions += 1;
                measuringRiskTakingAbilityQuestion3option2.Checked = true;
            }
            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion3option3 == "true")
            {
                riskTakingAbilityquestionsScore += 3;
                riskTakingAbilityQuestions += 1;
                measuringRiskTakingAbilityQuestion3option3.Checked = true;
            }
            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion3option4 == "true")
            {
                riskTakingAbilityquestionsScore += 5;
                riskTakingAbilityQuestions += 1;
                measuringRiskTakingAbilityQuestion3option4.Checked = true;
            }

            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion4option1 == "true")
            {
                riskTakingAbilityquestionsScore += 0;
                riskTakingAbilityQuestions += 1;
                measuringRiskTakingAbilityQuestion4option1.Checked = true;
            }

            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion4option2 == "true")
            {
                riskTakingAbilityquestionsScore += 2;
                riskTakingAbilityQuestions += 1;
                measuringRiskTakingAbilityQuestion4option2.Checked = true;
            }

            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion4option3 == "true")
            {
                riskTakingAbilityquestionsScore += 3;
                riskTakingAbilityQuestions += 1;
                measuringRiskTakingAbilityQuestion4option3.Checked = true;
            }

            if (riskProfileAnalysis.measuringRiskTakingAbilityQuestion4option4 == "true")
            {
                riskTakingAbilityquestionsScore += 5;
                riskTakingAbilityQuestions += 1;
                measuringRiskTakingAbilityQuestion4option4.Checked = true;
            }

            if (riskProfileAnalysis.agreeWithRiskProfileoption2 == "true")
            {
                isPreferredRiskProfile.Value = "true";
            }
            else
                isPreferredRiskProfile.Value = "false";

            if (riskProfileAnalysis != null)
            {
                if (riskApetiteQuestions == 4)
                riskTakingAppetiteLabel.InnerText = riskApetiteQuestionsScore + "";

                if (riskTakingAbilityQuestions == 4)
                riskTakingAbilityLabel.InnerText = riskTakingAbilityquestionsScore + "";
                if (riskProfileAnalysis.riskProfileName != null)
                {
                    if ((riskApetiteQuestions == 4) && (riskTakingAbilityQuestions == 4))
                    {
                        finalRiskProfile.InnerText = riskProfileAnalysis.riskProfileName;
                    }
                }
            }

            activityId.Value = caseId;
            if (riskProfileAnalysis != null)
            {
                List<string> errors = printErrorMessages(riskProfileAnalysis);
                this.ErrorRepeater.DataSource = errors;
                this.ErrorRepeater.DataBind();
            }
        }
        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);
        }
        public void copyRiskProfileBaseClass(RiskProfileAnalysis riskProfile)
        {
            if (measuringRiskTakingAbilityQuestion1option1.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion1option1 = "true";
            }

            if (measuringRiskTakingAbilityQuestion1option2.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion1option2 = "true";
            }

            if (measuringRiskTakingAbilityQuestion1option3.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion1option3 = "true";
            }
            if (measuringRiskTakingAbilityQuestion1option4.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion1option4 = "true";
            }

            if (measuringRiskTakingAbilityQuestion2option1.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion2option1 = "true";
            }

            if (measuringRiskTakingAbilityQuestion2option2.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion2option2 = "true";
            }

            if (measuringRiskTakingAbilityQuestion2option3.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion2option3 = "true";
            }

            if (measuringRiskTakingAbilityQuestion3option1.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion3option1 = "true";
            }

            if (measuringRiskTakingAbilityQuestion3option2.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion3option2 = "true";
            }

            if (measuringRiskTakingAbilityQuestion3option3.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion3option3 = "true";
            }

            if (measuringRiskTakingAbilityQuestion3option4.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion3option4 = "true";
            }

            if (measuringRiskTakingAbilityQuestion4option1.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion4option1 = "true";
            }

            if (measuringRiskTakingAbilityQuestion4option2.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion4option2 = "true";
            }

            if (measuringRiskTakingAbilityQuestion4option3.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion4option3 = "true";
            }

            if (measuringRiskTakingAbilityQuestion4option4.Checked)
            {
                riskProfile.measuringRiskTakingAbilityQuestion4option4 = "true";
            }

            //string selectedValue = NotSelected.SelectedValue;
        }
示例#13
0
 partial void DeleteRiskProfileAnalysis(RiskProfileAnalysis instance);
示例#14
0
 public int calculateRiskProfileAppetiteForPopulate(RiskProfileAnalysis RiskProfileDetails)
 {
     RiskProfile profile = populateRiskProfile(RiskProfileDetails);
     int riskProfileApetite = calculateRiskProfileApetite(profile);
     return riskProfileApetite;
 }
示例#15
0
        public List<string> printErrorMessages(RiskProfileAnalysis riskProfileAnalysis)
        {
            List<string> list = new List<string>();

            if (riskProfileAnalysis != null)
            {
                RiskProfileDAO dao = new RiskProfileDAO();
                DAO.DTO.RiskProfile profile= dao.populateRiskProfile(riskProfileAnalysis);
                Utility.checkEmptyField(profile.riskApetiteQuestion1, list, "Please enter the Risk Appetite Question 1");
                Utility.checkEmptyField(profile.riskApetiteQuestion2, list, "Please enter the Risk Appetite Question 2");
                Utility.checkEmptyField(profile.riskApetiteQuestion3, list, "Please enter the Risk Appetite Question 3");
                Utility.checkEmptyField(profile.riskApetiteQuestion4, list, "Please enter the Risk Appetite Question 4");
                Utility.checkEmptyField(profile.measuringRiskTakingAbilityQuestion1, list, "Please enter the risk Taking Ability Question 5");
                Utility.checkEmptyField(profile.measuringRiskTakingAbilityQuestion2, list, "Please enter the risk Taking Ability Question 6");
                Utility.checkEmptyField(profile.measuringRiskTakingAbilityQuestion3, list, "Please enter the risk Taking Ability Question 7");
                Utility.checkEmptyField(profile.measuringRiskTakingAbilityQuestion4, list, "Please enter the risk Taking Ability Question 8");

            }
            return list;
        }
示例#16
0
        public string getRiskProfileStatus(RiskProfileAnalysis riskprofile)
        {
            string status = "incomplete";

            if(((riskprofile.riskApetiteQuestion1option1!=null && riskprofile.riskApetiteQuestion1option1!="") || (riskprofile.riskApetiteQuestion1option2!=null && riskprofile.riskApetiteQuestion1option2!="") || (riskprofile.riskApetiteQuestion1option3!=null && riskprofile.riskApetiteQuestion1option3!="") || (riskprofile.riskApetiteQuestion1option4!=null && riskprofile.riskApetiteQuestion1option4!="") || (riskprofile.riskApetiteQuestion1option5!=null && riskprofile.riskApetiteQuestion1option5!="") || (riskprofile.riskApetiteQuestion1option6!=null && riskprofile.riskApetiteQuestion1option6!="")) &&
                ((riskprofile.riskApetiteQuestion2option1!=null && riskprofile.riskApetiteQuestion2option1!="") || (riskprofile.riskApetiteQuestion2option2!=null && riskprofile.riskApetiteQuestion2option2!="") || (riskprofile.riskApetiteQuestion2option3!=null && riskprofile.riskApetiteQuestion2option3!="") || (riskprofile.riskApetiteQuestion2option4!=null && riskprofile.riskApetiteQuestion2option4!="")) &&
                ((riskprofile.riskApetiteQuestion3option1!=null && riskprofile.riskApetiteQuestion3option1!="") || (riskprofile.riskApetiteQuestion3option2!=null && riskprofile.riskApetiteQuestion3option2!="") || (riskprofile.riskApetiteQuestion3option3!=null && riskprofile.riskApetiteQuestion3option3!="") || (riskprofile.riskApetiteQuestion3option4!=null && riskprofile.riskApetiteQuestion3option4!="") || (riskprofile.riskApetiteQuestion3option5!=null && riskprofile.riskApetiteQuestion3option5!="")) &&
                ((riskprofile.riskApetiteQuestion4option1!=null && riskprofile.riskApetiteQuestion4option1!="") || (riskprofile.riskApetiteQuestion4option2!=null && riskprofile.riskApetiteQuestion4option2!="") || (riskprofile.riskApetiteQuestion4option3!=null && riskprofile.riskApetiteQuestion4option3!="")) &&
                ((riskprofile.measuringRiskTakingAbilityQuestion1option1!=null && riskprofile.measuringRiskTakingAbilityQuestion1option1!="") || (riskprofile.measuringRiskTakingAbilityQuestion1option2!=null && riskprofile.measuringRiskTakingAbilityQuestion1option2!="") || (riskprofile.measuringRiskTakingAbilityQuestion1option3!=null && riskprofile.measuringRiskTakingAbilityQuestion1option3!="") || (riskprofile.measuringRiskTakingAbilityQuestion1option4!=null && riskprofile.measuringRiskTakingAbilityQuestion1option4!="")) &&
                ((riskprofile.measuringRiskTakingAbilityQuestion2option1!=null && riskprofile.measuringRiskTakingAbilityQuestion2option1!="") || (riskprofile.measuringRiskTakingAbilityQuestion2option2!=null && riskprofile.measuringRiskTakingAbilityQuestion2option2!="") || (riskprofile.measuringRiskTakingAbilityQuestion2option3!=null && riskprofile.measuringRiskTakingAbilityQuestion2option3!="")) &&
                ((riskprofile.measuringRiskTakingAbilityQuestion3option1!=null && riskprofile.measuringRiskTakingAbilityQuestion3option1!="") || (riskprofile.measuringRiskTakingAbilityQuestion3option2!=null && riskprofile.measuringRiskTakingAbilityQuestion3option2!="") || (riskprofile.measuringRiskTakingAbilityQuestion3option3!=null && riskprofile.measuringRiskTakingAbilityQuestion3option3!="") || (riskprofile.measuringRiskTakingAbilityQuestion3option4!=null && riskprofile.measuringRiskTakingAbilityQuestion3option4!="")) &&
                ((riskprofile.measuringRiskTakingAbilityQuestion4option1 != null && riskprofile.measuringRiskTakingAbilityQuestion4option1 != "") || (riskprofile.measuringRiskTakingAbilityQuestion4option2 != null && riskprofile.measuringRiskTakingAbilityQuestion4option2 != "") || (riskprofile.measuringRiskTakingAbilityQuestion4option3 != null && riskprofile.measuringRiskTakingAbilityQuestion4option3 != "") || (riskprofile.measuringRiskTakingAbilityQuestion4option4 != null && riskprofile.measuringRiskTakingAbilityQuestion4option4 != "")))
            {
                status = "complete";
            }

            return status;
        }
示例#17
0
 partial void InsertRiskProfileAnalysis(RiskProfileAnalysis instance);