Ejemplo n.º 1
0
        private bool saveFamilyNeeds()
        {
            familyNeed familyNeeds = new familyNeed();

            familyNeeds.familyIncPrNeeded = Convert.ToInt32(familyIncPrNeeded.SelectedValue);
            familyNeeds.mortgageNeeded = Convert.ToInt32(mortgagePrNeeded.SelectedValue);

            if (familyNeeds.familyIncPrNeeded == 2)
            {
                familyNeeds.replacementIncomeRequired = txtReplacementIncome.Text;
                familyNeeds.yearsOfSupportRequired = txtYrsOfSupport.Text;
                familyNeeds.inflationAdjustedReturns = txtInflationAdjustedReturns.Text;
                familyNeeds.lumpSumRequired = txtLumpSumRequired.Text;
                familyNeeds.otherLiabilities = txtOtherLiabilities.Text;
                familyNeeds.emergencyFundsNeeded = txtEmergencyFundsNeeded.Text;
                familyNeeds.finalExpenses = txtFinalExpenses.Text;
                familyNeeds.otherFundingNeeds = txtOtherFundingNeeds.Text;
                //familyNeeds.otherComments = txtotherComments.Text;
                familyNeeds.totalRequired = txtTotalRequired.Text;
                familyNeeds.existingLifeInsurance = txtExistingLifeInsurance.Text;
                familyNeeds.existingAssetsFamilyneeds = txtExistingAssetsFamilyneeds.Text;
                //familyNeeds.totalShortfallSurplus = txtTotalShortfallSurplus.Text;
                familyNeeds.totalShortfallSurplus = hiddenTotalShortfallSurplus.Value;
            }
            else if (familyNeeds.familyIncPrNeeded == 1 || familyNeeds.familyIncPrNeeded == 0)
            {
                familyNeeds.replacementIncomeRequired = "0";
                familyNeeds.yearsOfSupportRequired = "0";
                familyNeeds.inflationAdjustedReturns = "0";
                familyNeeds.lumpSumRequired = "0";
                familyNeeds.otherLiabilities = "0";
                familyNeeds.emergencyFundsNeeded = "0";
                familyNeeds.finalExpenses = "0";
                familyNeeds.otherFundingNeeds = "0";
                //familyNeeds.otherComments = txtotherComments.Text;
                familyNeeds.totalRequired = "0";
                familyNeeds.existingLifeInsurance = "0";
                familyNeeds.existingAssetsFamilyneeds = "0";
                //familyNeeds.totalShortfallSurplus = txtTotalShortfallSurplus.Text;
                familyNeeds.totalShortfallSurplus = "0";
            }

            if (familyNeeds.mortgageNeeded == 2)
            {
                familyNeeds.mortgageProtectionOutstanding = txtMortgageProtectionOutstanding.Text;
                familyNeeds.mortgageProtectionInsurances = txtMortgageProtectionInsurances.Text;
                familyNeeds.mortgageProtectionTotal = hiddentxtMortgageProtectionTotal.Value;
            }
            else if (familyNeeds.mortgageNeeded == 1 || familyNeeds.mortgageNeeded == 0)
            {
                familyNeeds.mortgageProtectionOutstanding = "0";
                familyNeeds.mortgageProtectionInsurances = "0";
                familyNeeds.mortgageProtectionTotal = "0";
            }

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

            int noofea = 0;
            if (familyNeeds.familyIncPrNeeded == 2)
            {
                if (noofmembers.Value != "")
                {
                    noofea = Int16.Parse(noofmembers.Value);
                }
            }

            EntitySet<familyNeedsAsset> eaFNeedsList = new EntitySet<familyNeedsAsset>();
            if (noofea > 0)
            {
                for (int i = 1; i <= noofea; i++)
                {
                    familyNeedsAsset eafn = new familyNeedsAsset();
                    eafn.asset = Request.Form["prifamily-" + i];
                    eafn.presentValue = Request.Form["prifamilyneeds_" + i];

                    if ((Request.Form["prifamily-" + i] != null) && (Request.Form["prifamilyneeds_" + i] != null))
                    {
                        eaFNeedsList.Add(eafn);
                    }

                }
                familyNeeds.familyNeedsAssets = eaFNeedsList;
            }

            if (ViewState["casetypefamily"] != null && ViewState["casetypefamily"].ToString() == "new")
            {
                familyNeeds = familyNeedsDAO.saveFamilyNeeds(familyNeeds);
            }
            else if (ViewState["casetypefamily"] != null && ViewState["casetypefamily"].ToString() == "update")
            {
                familyNeeds = familyNeedsDAO.updateFamilyNeeds(familyNeeds);
            }

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

            string status = activityStatusCheck.getProtectionGoalFamilyStatus(familyNeeds);
            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 (familyNeeds != null)
            {
                populateFamilyNeed(familyNeeds);
            }
            else
            {
                return false;
            }

            return true;
        }
Ejemplo n.º 2
0
 partial void DeletefamilyNeedsAsset(familyNeedsAsset instance);
Ejemplo n.º 3
0
 partial void InsertfamilyNeedsAsset(familyNeedsAsset instance);
Ejemplo n.º 4
0
 partial void UpdatefamilyNeedsAsset(familyNeedsAsset instance);
Ejemplo n.º 5
0
		private void detach_familyNeedsAssets(familyNeedsAsset entity)
		{
			this.SendPropertyChanging();
			entity.familyNeed = null;
		}