コード例 #1
0
ファイル: db.designer.cs プロジェクト: pmehra1/wen-zurich
 partial void DeletemyNeedsCriticalAsset(myNeedsCriticalAsset instance);
コード例 #2
0
ファイル: db.designer.cs プロジェクト: pmehra1/wen-zurich
 partial void UpdatemyNeedsCriticalAsset(myNeedsCriticalAsset instance);
コード例 #3
0
ファイル: db.designer.cs プロジェクト: pmehra1/wen-zurich
		private void detach_myNeedsCriticalAssets(myNeedsCriticalAsset entity)
		{
			this.SendPropertyChanging();
			entity.myNeed = null;
		}
コード例 #4
0
ファイル: db.designer.cs プロジェクト: pmehra1/wen-zurich
 partial void InsertmyNeedsCriticalAsset(myNeedsCriticalAsset instance);
コード例 #5
0
        private bool saveMyNeeds()
        {
            myNeed myNeeds = new myNeed();

            myNeeds.criticalIllnessPrNeeded = Convert.ToInt16(criticalIllnessPr.SelectedValue);

            if (criticalIllnessPr.SelectedValue == "2")
            {
                myNeeds.replacementIncomeRequired = replacementIncomeRequired.Text;
                myNeeds.lumpSumRequiredForTreatment = txtlumpSumRequiredForTreatment.Text;
                myNeeds.yearsOfSupportRequired = yearsOfSupportRequired.Text;
                myNeeds.inflatedAdjustedReturns = inflatedAdjustedReturns.Text;
                myNeeds.replacementAmountRequired = replacementAmountRequired.Text;
                myNeeds.criticalIllnessInsurance = txtCriticalIllnessInsurance.Text;
                myNeeds.existingAssetsMyneeds = txtExistingAssetsMyNeedsCritical.Text;
                myNeeds.totalShortfallSurplusMyNeeds = hiddentxtTotalShortfallSurplusMyNeeds.Value;
                myNeeds.totalRequired = totalRequired.Text;
            }
            else if (criticalIllnessPr.SelectedValue == "1" || criticalIllnessPr.SelectedValue == "0")
            {
                myNeeds.replacementIncomeRequired = "0";
                myNeeds.lumpSumRequiredForTreatment = "0";
                myNeeds.yearsOfSupportRequired = "0";
                myNeeds.inflatedAdjustedReturns = "0";
                myNeeds.replacementAmountRequired = "0";
                myNeeds.criticalIllnessInsurance = "0";
                myNeeds.existingAssetsMyneeds = "0";
                myNeeds.totalShortfallSurplusMyNeeds = "0";
                myNeeds.totalRequired = "0";
            }

            myNeeds.hospitalmedCoverNeeded = Convert.ToInt16(hospitalmedCoverNeeded.SelectedValue);
            myNeeds.accidentalhealthCoverNeeded = Convert.ToInt16(accidentalHealthCoverNeeded.SelectedValue);

            if (hospitalmedCoverNeeded.SelectedValue == "2")
            {
                myNeeds.typeOfHospitalCoverage = ddlHospitalTypeList.SelectedValue;

                if (ddlExistingPlanList.SelectedValue == "")
                {
                    myNeeds.anyExistingPlans = null;
                }
                else
                {
                    myNeeds.anyExistingPlans = ddlExistingPlanList.SelectedValue == "1" ? true : false;
                }

                if (ddlRoomTypeList.SelectedValue == "")
                {
                    myNeeds.typeOfRoomCoverage = null;
                }
                else
                {
                    myNeeds.typeOfRoomCoverage = Convert.ToInt16(ddlRoomTypeList.SelectedValue);
                }
            }
            else if (hospitalmedCoverNeeded.SelectedValue == "1" || hospitalmedCoverNeeded.SelectedValue == "0")
            {
                myNeeds.typeOfHospitalCoverage = "";
                myNeeds.anyExistingPlans = null;
                myNeeds.typeOfRoomCoverage = null;
            }

               if (ddlCoverageOldageYesNo.SelectedValue == "")
               {
               myNeeds.coverageOldageYesNo = null;
               }
               else
               {
               myNeeds.coverageOldageYesNo = ddlCoverageOldageYesNo.SelectedValue == "1" ? true : false;
               }

               if (ddlEpOldageYesNo.SelectedValue == "")
               {
               myNeeds.epOldageYesNo = null;
               }
               else
               {
               myNeeds.epOldageYesNo = ddlEpOldageYesNo.SelectedValue == "1" ? true : false;
               }

               if (ddlCoveragePersonalYesNo.SelectedValue == "")
               {
               myNeeds.coveragePersonalYesNo = null;
               }
               else
               {
               myNeeds.coveragePersonalYesNo = ddlCoveragePersonalYesNo.SelectedValue == "1" ? true : false;
               }

               if (ddlEpPersonalYesNo.SelectedValue == "")
               {
               myNeeds.epPersonalYesNo = null;
               }
               else
               {
               myNeeds.epPersonalYesNo = ddlEpPersonalYesNo.SelectedValue == "1" ? true : false;
               }

               if (coverageOutpatientMedExp.SelectedValue == "")
               {
               myNeeds.coverageOutpatientMedExp = null;
               }
               else
               {
               myNeeds.coverageOutpatientMedExp = coverageOutpatientMedExp.SelectedValue == "1" ? true : false;
               }
               if (epOutpatientMedExp.SelectedValue == "")
               {
               myNeeds.epOutpatientMedExp = null;
               }
               else
               {
               myNeeds.epOutpatientMedExp = epOutpatientMedExp.SelectedValue == "1" ? true : false;
               }
               if (coverageLossOfIncome.SelectedValue == "")
               {
               myNeeds.coverageLossOfIncome = null;
               }
               else
               {
               myNeeds.coverageLossOfIncome = coverageLossOfIncome.SelectedValue == "1" ? true : false;
               }
               if (epLossOfIncome.SelectedValue == "")
               {
               myNeeds.epLossOfIncome = null;
               }
               else
               {
               myNeeds.epLossOfIncome = epLossOfIncome.SelectedValue == "1" ? true : false;
               }
               if (coverageOldageDisabilities.SelectedValue == "")
               {
               myNeeds.coverageOldageDisabilities = null;
               }
               else
               {
               myNeeds.coverageOldageDisabilities = coverageOldageDisabilities.SelectedValue == "1" ? true : false;
               }
               if (epOldageDisabilities.SelectedValue == "")
               {
               myNeeds.epOldageDisabilities = null;
               }
               else
               {
               myNeeds.epOldageDisabilities = epOldageDisabilities.SelectedValue == "1" ? true : false;
               }
               if (coverageDentalExp.SelectedValue == "")
               {
               myNeeds.coverageDentalExp = null;
               }
               else
               {
               myNeeds.coverageDentalExp = coverageDentalExp.SelectedValue == "1" ? true : false;
               }
               if (epDentalExp.SelectedValue == "")
               {
               myNeeds.epDentalExp = null;
               }
               else
               {
               myNeeds.epDentalExp = epDentalExp.SelectedValue == "1" ? true : false;
               }

               if (ddlExistingPlanList.SelectedValue == "" && ddlEpOldageYesNo.SelectedValue == "" && ddlEpPersonalYesNo.SelectedValue == "" && epOutpatientMedExp.SelectedValue == "" && epLossOfIncome.SelectedValue == "" && epOldageDisabilities.SelectedValue == "" && epDentalExp.SelectedValue == "")
               {
               myNeeds.existingPlansDetail = "";
               }
               else
               {
               if (ddlExistingPlanList.SelectedValue != "" || ddlEpOldageYesNo.SelectedValue != "" || ddlEpPersonalYesNo.SelectedValue != "" || epOutpatientMedExp.SelectedValue != "" || epLossOfIncome.SelectedValue != "" || epOldageDisabilities.SelectedValue != "" || epDentalExp.SelectedValue != "")
               {
                   myNeeds.existingPlansDetail = DetailsOfExistingPlans.Text;
               }
               }

            myNeeds.disabilityPrNeeded = Convert.ToInt16(disabilityPr.SelectedValue);

            if (disabilityPr.SelectedValue == "2")
            {
                myNeeds.disabilityProtectionReplacementIncomeRequired = disabilityProtectionReplacementIncomeRequired.Text;
                myNeeds.disabilityYearsOfSupport = disabilityYearsOfSupport.Text;
                myNeeds.disabilityReplacementAmountRequired = disabilityReplacementAmountRequired.Text;
                myNeeds.disabilityInsurance = disabilityInsurance.Text;
                myNeeds.inflationAdjustedReturns = inflationAdjustedReturns.Text;
                myNeeds.existingAssetsMyneedsDisability = txtExistingAssetsMyneedsDisability.Text;
                myNeeds.shortfallSurplusMyNeeds = hiddentxtShortfallSurplusMyNeeds.Value;
            }
            else if (disabilityPr.SelectedValue == "1" || disabilityPr.SelectedValue == "0")
            {
                myNeeds.disabilityProtectionReplacementIncomeRequired = "0";
                myNeeds.disabilityYearsOfSupport = "0";
                myNeeds.disabilityReplacementAmountRequired = "0";
                myNeeds.disabilityInsurance = "0";
                myNeeds.inflationAdjustedReturns = "0";
                myNeeds.existingAssetsMyneedsDisability = "0";
                myNeeds.shortfallSurplusMyNeeds = "0";
            }

            myNeeds.caseId = ViewState["caseId"].ToString();

            int noofeacritical = 0;
            if (criticalIllnessPr.SelectedValue == "2")
            {
                if (noofcriticalassets.Value != "")
                {
                    noofeacritical = Int16.Parse(noofcriticalassets.Value);
                }
            }

            EntitySet<myNeedsCriticalAsset> eaMyNeedsCriticalList = new EntitySet<myNeedsCriticalAsset>();
            if (noofeacritical > 0)
            {
                for (int i = 1; i <= noofeacritical; i++)
                {
                    myNeedsCriticalAsset eaMNCritical = new myNeedsCriticalAsset();
                    eaMNCritical.asset = Request.Form["primyneedscritical-" + i];
                    eaMNCritical.presentValue = Request.Form["primyneedplus_" + i];

                    if ((Request.Form["primyneedscritical-" + i] != null) && (Request.Form["primyneedplus_" + i] != null))
                    {
                        eaMyNeedsCriticalList.Add(eaMNCritical);
                    }

                }
                myNeeds.myNeedsCriticalAssets = eaMyNeedsCriticalList;
            }

            int noOfDisability = 0;
            if (disabilityPr.SelectedValue == "2")
            {
                if (noofdisabilityassets.Value != "")
                {
                    noOfDisability = Int16.Parse(noofdisabilityassets.Value);
                }
            }

            EntitySet<myNeedsDisabilityAsset> eaMyNeedsDisabilityList = new EntitySet<myNeedsDisabilityAsset>();
            if (noOfDisability > 0)
            {
                for (int i = 1; i <= noOfDisability; i++)
                {
                    myNeedsDisabilityAsset eaMNDisability = new myNeedsDisabilityAsset();
                    eaMNDisability.asset = Request.Form["primyneedsdisb-" + i];
                    eaMNDisability.presentValue = Request.Form["primyneedpluspart2_" + i];

                    if ((Request.Form["primyneedsdisb-" + i] != null) && (Request.Form["primyneedpluspart2_" + i] != null))
                    {
                        eaMyNeedsDisabilityList.Add(eaMNDisability);
                    }

                }
                myNeeds.myNeedsDisabilityAssets = eaMyNeedsDisabilityList;
            }

            if (ViewState["casetypemyneeds"] != null && ViewState["casetypemyneeds"].ToString() == "new")
            {
                myNeeds = myNeedsDAO.saveMyNeeds(myNeeds);
            }
            else if (ViewState["casetypemyneeds"] != null && ViewState["casetypemyneeds"].ToString() == "update")
            {
                myNeeds = myNeedsDAO.updateMyNeeds(myNeeds);
            }

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

            string status = activityStatusCheck.getProtectionGoalMyneedsStatus(myNeeds);
            activityStatusDao.saveOrUpdateActivityStatus(ViewState["caseId"].ToString(), actv, status);

            markStatusOnTab(ViewState["caseId"].ToString());

            string caseStatus = activityStatusCheck.getZPlanStatus(ViewState["caseId"].ToString());

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

            pdfData = activityStatusCheck.sendDataToSalesPortal(ViewState["caseId"].ToString(), caseStatus, url, sendPdf);

            if (myNeeds != null)
            {
                populateMyNeed(myNeeds);
            }
            else
            {
                return false;
            }

            return true;
        }