public void btnSave_Click(object sender, EventArgs e) { try { // customerExpenseVo.DateOfEntry = DateBo.GetFormattedDate(Convert.ToDateTime(txtDateOfEntry.Text.ToString()),"en-GB"); customerExpenseVo.DateOfEntry = Convert.ToDateTime(txtDateOfEntry.Text.ToString()); customerExpenseVo.Transportation = Double.Parse(txtTranMonthly.Text.ToString()); customerExpenseVo.TransportationYr = Double.Parse(txtTranYearly.Text.ToString()); customerExpenseVo.CurrencyCodeTransportation = int.Parse(ddlTranCurrency.SelectedValue.ToString()); customerExpenseVo.Food = Double.Parse(txtFoodMonthly.Text.ToString()); customerExpenseVo.FoodYr = Double.Parse(txtFoodYearly.Text.ToString()); customerExpenseVo.CurrencyCodeFood = int.Parse(ddlFoodCurrency.SelectedValue.ToString()); customerExpenseVo.Clothing = Double.Parse(txtCloMonthly.Text.ToString()); customerExpenseVo.ClothingYr = Double.Parse(txtCloYearly.Text.ToString()); customerExpenseVo.CurrencyCodeClothing = int.Parse(ddlCloCurrency.SelectedValue.ToString()); customerExpenseVo.Home = Double.Parse(txtHomeMonthly.Text.ToString()); customerExpenseVo.HomeYr = Double.Parse(txtHomeYearly.Text.ToString()); customerExpenseVo.CurrencyCodeHome = int.Parse(ddlHomeCurrency.SelectedValue.ToString()); customerExpenseVo.Utilities = Double.Parse(txtUtiMonthly.Text.ToString()); customerExpenseVo.UtilitiesYr = Double.Parse(txtUtiYearly.Text.ToString()); customerExpenseVo.CurrencyCodeUtilities = int.Parse(ddlUtiCurrency.SelectedValue.ToString()); customerExpenseVo.SelfCare = Double.Parse(txtSCMonthly.Text.ToString()); customerExpenseVo.SelfCareYr = Double.Parse(txtSCYearly.Text.ToString()); customerExpenseVo.CurrencyCodeSelfCare = int.Parse(ddlSCCurrency.SelectedValue.ToString()); customerExpenseVo.HealthCare = Double.Parse(txtHCMonthly.Text.ToString()); customerExpenseVo.HealthCareYr = Double.Parse(txtHCYearly.Text.ToString()); customerExpenseVo.CurrencyCodeHealthCare = int.Parse(ddlHCCurrency.SelectedValue.ToString()); customerExpenseVo.Education = Double.Parse(txtEduMonthly.Text.ToString()); customerExpenseVo.EducationYr = Double.Parse(txtEduYearly.Text.ToString()); customerExpenseVo.CurrencyCodeEducation = int.Parse(ddlEduCurrency.SelectedValue.ToString()); customerExpenseVo.Pets = Double.Parse(txtPetsMonthly.Text.ToString()); customerExpenseVo.PetsYr = Double.Parse(txtPetsYearly.Text.ToString()); customerExpenseVo.CurrencyCodePets = int.Parse(ddlPetsCurrency.SelectedValue.ToString()); customerExpenseVo.Entertainment = Double.Parse(txtEntMonthly.Text.ToString()); customerExpenseVo.EntertainmentYr = Double.Parse(txtEntYearly.Text.ToString()); customerExpenseVo.CurrencyCodeEntertainment = int.Parse(ddlEntCurrency.SelectedValue.ToString()); customerExpenseVo.Miscellaneous = Double.Parse(txtMisMonthly.Text.ToString()); customerExpenseVo.MiscellaneousYr = Double.Parse(txtMisYearly.Text.ToString()); customerExpenseVo.CurrencyCodeMiscellaneous = int.Parse(ddlMisCurrency.SelectedValue.ToString()); txttotal.Text = (double.Parse(txtTranMonthly.Text) + double.Parse(txtFoodMonthly.Text) + double.Parse(txtCloMonthly.Text) + double.Parse(txtHomeMonthly.Text) + double.Parse(txtUtiMonthly.Text) + double.Parse(txtSCMonthly.Text) + double.Parse(txtHCMonthly.Text) + double.Parse(txtEduMonthly.Text) + double.Parse(txtPetsMonthly.Text) + double.Parse(txtEntMonthly.Text) + double.Parse(txtMisMonthly.Text)).ToString(); txttotalyear.Text = (double.Parse(txtTranYearly.Text) + double.Parse(txtFoodYearly.Text) + double.Parse(txtCloYearly.Text) + double.Parse(txtHomeYearly.Text) + double.Parse(txtUtiYearly.Text) + double.Parse(txtSCYearly.Text) + double.Parse(txtHCYearly.Text) + double.Parse(txtEduYearly.Text) + double.Parse(txtPetsYearly.Text) + double.Parse(txtEntYearly.Text) + double.Parse(txtMisYearly.Text)).ToString(); txttotalyear.Visible = true; txttotal.Visible = true; lbltotal.Visible = true; ddlTotal.Visible = true; if (btnSave.Text == "Save") { customerBo.AddCustomerExpenseDetails(rmVo.UserId, customerVo.CustomerId, customerExpenseVo); DisableAllControls(); btnSave.Visible = false; btnEdit.Visible = true; txttotalyear.Visible = true; txttotal.Visible = true; lbltotal.Visible = true; ddlTotal.Visible = true; } else { customerBo.UpdateCustomerExpenseDetails(rmVo.UserId, customerVo.CustomerId, customerExpenseVo); DisableAllControls(); btnSave.Visible = false; } } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "CustomerExpense.ascx:btnSave_Click()"); object[] objects = new object[2]; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }