Beispiel #1
0
        public CkaAssessment calculateCKAOption(CkaAssessment assessment)
        {
            Boolean educational = areBothNull(assessment.educationalExperienceOption1, assessment.educationalExperienceOption2);
            Boolean investment = areBothNull(assessment.investmentExperienceOption1, assessment.investmentExperienceOption2);
            Boolean working = areBothNull(assessment.workingExperienceOption1, assessment.workingExperienceOption2);

            if ((educational == true) || (investment == true) || (working == true))
            {
                assessment.csaOutcomeOption1 = null;
                assessment.csaOutcomeOption2 = null;
            }
            else
            {
                if ((assessment.educationalExperienceOption1 == "true") || (assessment.financeRelatedKnowledgeOption1 == "true") || (assessment.investmentExperienceOption1 == "true") || (assessment.workingExperienceOption1 == "true"))
                {
                    assessment.csaOutcomeOption1 = "true";
                    assessment.csaOutcomeOption2 = "false";
                }
                else
                {
                    assessment.csaOutcomeOption1 = "false";
                    assessment.csaOutcomeOption2 = "true";
                }
            }
            return assessment;
        }
Beispiel #2
0
 public void saveNewCkaProfile(CkaAssessment ckaAssessment)
 {
     try
     {
         dbDataContext ct = new dbDataContext();
         ct.CkaAssessments.InsertOnSubmit(ckaAssessment);
         ct.SubmitChanges();
     }
     catch (Exception e)
     {
         string str = e.Message;
     }
 }
Beispiel #3
0
        public void copyRiskProfileBaseClass(CkaAssessment assessment)
        {
            /*if (agreeCKA.Checked)
            {
                assessment.agreeCKA = "true";
            }

            if (disagreeCKA.Checked)
            {
                assessment.disagreeCKA = "true";
            }*/

            if (educationalExperienceOption1.Checked)
            {
                assessment.educationalExperienceOption1 = "true";
            }

            if (educationalExperienceOption2.Checked)
            {
                assessment.educationalExperienceOption2 = "true";
            }
            assessment.educationalExperienceList = qualificationslist.Text;

            if (investmentExperienceOption1.Checked)
            {
                assessment.investmentExperienceOption1 = "true";
            }

            if (investmentExperienceOption2.Checked)
            {
                assessment.investmentExperienceOption2 = "true";
            }
            assessment.investmentExperienceList = investmentExperienceList.Text;

            if (workingExperienceOption1.Checked)
            {
                assessment.workingExperienceOption1 = "true";
            }

            if (workingExperienceOption2.Checked)
            {
                assessment.workingExperienceOption2 = "true";
            }
            assessment.workingExperienceList = workingExperienceList.Text;

            calculateCKAOption(assessment);
        }
Beispiel #4
0
        public void updateCkaDetails(CkaAssessment ckaAssessment)
        {
            CkaAssessment assessment = null;
            try
            {
                dbDataContext ct = new dbDataContext();
                var queryCkaDetails = from al in ct.CkaAssessments
                                           where al.caseId == ckaAssessment.caseId
                                           select al;
                foreach (CkaAssessment ckAssessment in queryCkaDetails)
                {
                    assessment = ckAssessment;
                }

                assessment.agreeCKA = ckaAssessment.agreeCKA;
                assessment.csaOutcomeOption1 = ckaAssessment.csaOutcomeOption1;
                assessment.csaOutcomeOption2 = ckaAssessment.csaOutcomeOption2;
                assessment.disagreeCKA = ckaAssessment.disagreeCKA;
                assessment.educationalExperienceOption1 = ckaAssessment.educationalExperienceOption1;
                assessment.educationalExperienceOption2 = ckaAssessment.educationalExperienceOption2;
                assessment.financeRelatedKnowledgeOption1 = ckaAssessment.financeRelatedKnowledgeOption1;
                assessment.financeRelatedKnowledgeOption2 = ckaAssessment.financeRelatedKnowledgeOption2;
                assessment.investmentExperienceOption1 = ckaAssessment.investmentExperienceOption1;
                assessment.investmentExperienceOption2 = ckaAssessment.investmentExperienceOption2;
                assessment.workingExperienceOption1 = ckaAssessment.workingExperienceOption1;
                assessment.workingExperienceOption2 = ckaAssessment.workingExperienceOption2;
                assessment.educationalExperienceList = ckaAssessment.educationalExperienceList;
                assessment.investmentExperienceList = ckaAssessment.investmentExperienceList;
                assessment.workingExperienceList = ckaAssessment.workingExperienceList;

                ct.SubmitChanges();

            }
            catch (Exception e)
            {
                string str = e.Message;
            }
        }
Beispiel #5
0
        public string getCkaStatus(CkaAssessment ckaassessment)
        {
            string status = "incomplete";

            if(((ckaassessment.investmentExperienceOption1!=null && ckaassessment.investmentExperienceOption1!="") || (ckaassessment.investmentExperienceOption2!=null && ckaassessment.investmentExperienceOption2!="")) &&
                ((ckaassessment.workingExperienceOption1!=null && ckaassessment.workingExperienceOption1!="") || (ckaassessment.workingExperienceOption2!=null && ckaassessment.workingExperienceOption2!="")) &&
                ((ckaassessment.educationalExperienceOption1!=null && ckaassessment.educationalExperienceOption1!="") || (ckaassessment.educationalExperienceOption2!=null && ckaassessment.educationalExperienceOption2!="")) &&
                ((ckaassessment.csaOutcomeOption1!=null && ckaassessment.csaOutcomeOption1!="") || (ckaassessment.csaOutcomeOption2!=null && ckaassessment.csaOutcomeOption2!="")))
            {
                status = "complete";
            }

            return status;
        }
Beispiel #6
0
        protected void ckaSubmit(object sender, EventArgs e)
        {
            activity = activityStatusDao.getActivity(10);
            ViewState["activity"] = activity;

            if (ViewState["caseId"] != null)
            {
                caseId = ViewState["caseId"].ToString();
            }

            CkaAssessment cka = new CkaAssessment();

            CkaDao dao = new CkaDao();

            CkaAssessment ckaAnalysis = dao.getCkaProfile(caseId);

            string status = "new";

            if (ckaAnalysis != null)
            {
                status = "update";
                copyRiskProfileBaseClass(cka);

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

            if (status == "new")
            {
                dao.saveNewCkaProfile(cka);
            }
            else
            {
                cka.caseId = caseId;
                dao.updateCkaDetails(cka);
            }

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

            string cstatus = activityStatusCheck.getCkaStatus(cka);
            activityStatusDao.saveOrUpdateActivityStatus(caseId, actv, cstatus);

            markStatusOnTab(caseId);

            string caseStatus = activityStatusCheck.getZPlanStatus(caseId);

            string url = Server.MapPath("~/_layouts/Zurich/Printpages/");

            pdfData = activityStatusCheck.sendDataToSalesPortal(caseId, caseStatus, url, sendPdf);

            populateCka(cka, caseId);
        }
Beispiel #7
0
        public List<string> printErrorMessages(CkaAssessment assessment)
        {
            List<string> list = new List<string>();

            if (assessment != null)
            {
                /*if ((assessment.agreeCKA == null || assessment.agreeCKA == "") && (assessment.disagreeCKA == null || assessment.disagreeCKA == ""))
                {
                    list.Add("Please fill Customer Knowledge Assessment details");
                }*/

                if ((assessment.educationalExperienceOption1 == null || assessment.educationalExperienceOption1 == "") && (assessment.educationalExperienceOption2 == null || assessment.educationalExperienceOption2 == ""))
                {
                    list.Add("Please fill Educational Qualifications details");
                }

                if ((assessment.educationalExperienceOption1 == "true") && (assessment.educationalExperienceList == "" || assessment.educationalExperienceList == null))
                {
                    list.Add("Please fill Educational Qualifications details");
                }

                if ((assessment.investmentExperienceOption1 == null || assessment.investmentExperienceOption1 == "") && (assessment.investmentExperienceOption2 == null || assessment.investmentExperienceOption2 == ""))
                {
                    list.Add("Please fill Investment Experience details");
                }

                if ((assessment.investmentExperienceOption1 == "true") && (assessment.investmentExperienceList == "" || assessment.investmentExperienceList == null))
                {
                    list.Add("Please fill Investment Experience details");
                }

                if ((assessment.workingExperienceOption1 == null || assessment.workingExperienceOption1 == "") && (assessment.workingExperienceOption2 == null || assessment.workingExperienceOption2 == ""))
                {
                    list.Add("Please fill Work Experience details");
                }

                if ((assessment.workingExperienceOption1 == "true") && (assessment.workingExperienceList == "" || assessment.workingExperienceList == null))
                {
                    list.Add("Please fill Work Experience details");
                }
            }
            return list;
        }
Beispiel #8
0
        public void populateCka(CkaAssessment assessment, string caseId)
        {
            /*if (assessment.agreeCKA == "true")
            {
                agreeCKA.Checked = true;
            }

            if (assessment.disagreeCKA == "true")
            {
                disagreeCKA.Checked = true;
            }*/

            if (assessment.csaOutcomeOption1 == "true")
            {
                csaOutcomeOption1.Checked = true;
            }

            if (assessment.csaOutcomeOption2== "true")
            {
                csaOutcomeOption2.Checked = true;
            }

            if (assessment.educationalExperienceOption1 == "true")
            {
                educationalExperienceOption1.Checked = true;
            }

            if (assessment.educationalExperienceOption2 == "true")
            {
                educationalExperienceOption2.Checked = true;
            }

            if (assessment.investmentExperienceOption1 == "true")
            {
                investmentExperienceOption1.Checked = true;
            }

            if (assessment.investmentExperienceOption2 == "true")
            {
                investmentExperienceOption2.Checked = true;
            }

            if (assessment.workingExperienceOption1 == "true")
            {
                workingExperienceOption1.Checked = true;
            }

            if (assessment.workingExperienceOption2 == "true")
            {
                workingExperienceOption2.Checked = true;
            }

            qualificationslist.Text = assessment.educationalExperienceList;
            investmentExperienceList.Text = assessment.investmentExperienceList;
            workingExperienceList.Text = assessment.workingExperienceList;

            if (assessment != null)
            {
                List<string> errors = printErrorMessages(assessment);
                this.ErrorRepeater.DataSource = errors;
                this.ErrorRepeater.DataBind();
            }
        }
Beispiel #9
0
 partial void DeleteCkaAssessment(CkaAssessment instance);
Beispiel #10
0
 partial void UpdateCkaAssessment(CkaAssessment instance);
Beispiel #11
0
 partial void InsertCkaAssessment(CkaAssessment instance);