internal static void UpdateDefendantInsuranceInformation(DefendantInsuranceDetails defInsurance, string fileID) { string query = string.Format(Constants.EXISTS_CLIENT_DEFENDANT_INSURANCE_DETAILS_QUERY, fileID); object isPresent = DBHelper.GetScalarValue(query); int result = 0; if (isPresent == null) { query = string.Format(Constants.INSERT_CLIENT_DEFENDANT_INSURANCE_DETAILS_QUERY, fileID, defInsurance.NameOfInsured, defInsurance.InsuranceCompany, defInsurance.Address, defInsurance.City, defInsurance.State, defInsurance.Zip, defInsurance.Phone, defInsurance.Adjuster, defInsurance.ClaimNumber, defInsurance.PolicyLimits); result = DBHelper.ExecuteNonQuery(query); } else { query = string.Format(Constants.UPDATE_CLIENT_DEFENDANT_INSURANCE_DETAILS_QUERY, fileID, defInsurance.NameOfInsured, defInsurance.InsuranceCompany, defInsurance.Address, defInsurance.City, defInsurance.State, defInsurance.Zip, defInsurance.Phone, defInsurance.Adjuster, defInsurance.ClaimNumber, defInsurance.PolicyLimits); result = DBHelper.ExecuteNonQuery(query); } }
private void btnSaveDefendantInsuranceInfo_Click(object sender, RoutedEventArgs e) { try { if (string.IsNullOrEmpty(txtDefendantInsuranceNameOfInsured.Text) && string.IsNullOrEmpty(txtDefendantInsuranceCompany.Text) && string.IsNullOrEmpty(txtDefendantInsuranceAddress.Text) && string.IsNullOrEmpty(txtDefendantInsuranceCity.Text) && string.IsNullOrEmpty(txtDefendantInsuranceState.Text) && string.IsNullOrEmpty(txtDefendantInsuranceZip.Text) && string.IsNullOrEmpty(txtDefendantInsurancePhone.Text) && string.IsNullOrEmpty(txtDefendantInsuranceAdjuster.Text) && string.IsNullOrEmpty(txtDefendantInsuranceClaimNumber.Text) && string.IsNullOrEmpty(txtDefendantInsurancePolicyLimits.Text)) { return; } DefendantInsuranceDetails defInsurance = new DefendantInsuranceDetails(); defInsurance.NameOfInsured = txtDefendantInsuranceNameOfInsured.Text; defInsurance.InsuranceCompany = txtDefendantInsuranceCompany.Text; defInsurance.Address = txtDefendantInsuranceAddress.Text; defInsurance.City = txtDefendantInsuranceCity.Text; defInsurance.State = txtDefendantInsuranceState.Text; defInsurance.Zip = txtDefendantInsuranceZip.Text; defInsurance.Phone = txtDefendantInsurancePhone.Text; defInsurance.Adjuster = txtDefendantInsuranceAdjuster.Text; defInsurance.ClaimNumber = txtDefendantInsuranceClaimNumber.Text; defInsurance.PolicyLimits = txtDefendantInsurancePolicyLimits.Text; BusinessLogic.UpdateDefendantInsuranceInformation(defInsurance, txtFileNo.Text); Helper.ShowInformationMessageBox("Defendant Insurance Information Saved."); UpdateStatusClientDefendentInsuranceInfo(true); dgClientFileList.SelectedIndex = -1; dgClientFileList.SelectedIndex = 0; } catch (Exception ex) { Helper.LogException(ex); } }
internal static void SaveDefendantInsuranceInformation(DefendantInsuranceDetails defInsurance, string fileID) { string query = string.Format(Constants.INSERT_CLIENT_DEFENDANT_INSURANCE_DETAILS_QUERY, fileID, defInsurance.NameOfInsured, defInsurance.InsuranceCompany, defInsurance.Address, defInsurance.City, defInsurance.State, defInsurance.Zip, defInsurance.Phone, defInsurance.Adjuster, defInsurance.ClaimNumber, defInsurance.PolicyLimits); int result = DBHelper.ExecuteNonQuery(query); }
private void SaveDefendantInsuranceInformation() { try { if (string.IsNullOrEmpty(txtDefendantInsuranceNameOfInsured.Text) && string.IsNullOrEmpty(txtDefendantInsuranceCompany.Text) && string.IsNullOrEmpty(txtDefendantInsuranceAddress.Text) && string.IsNullOrEmpty(txtDefendantInsuranceCity.Text) && string.IsNullOrEmpty(txtDefendantInsuranceState.Text) && string.IsNullOrEmpty(txtDefendantInsuranceZip.Text) && string.IsNullOrEmpty(txtDefendantInsurancePhone.Text) && string.IsNullOrEmpty(txtDefendantInsuranceAdjuster.Text) && string.IsNullOrEmpty(txtDefendantInsuranceClaimNumber.Text) && string.IsNullOrEmpty(txtDefendantInsurancePolicyLimits.Text)) { return; } DefendantInsuranceDetails defInsurance = new DefendantInsuranceDetails(); defInsurance.NameOfInsured = txtDefendantInsuranceNameOfInsured.Text; defInsurance.InsuranceCompany = txtDefendantInsuranceCompany.Text; defInsurance.Address = txtDefendantInsuranceAddress.Text; defInsurance.City = txtDefendantInsuranceCity.Text; defInsurance.State = txtDefendantInsuranceState.Text; defInsurance.Zip = txtDefendantInsuranceZip.Text; defInsurance.Phone = txtDefendantInsurancePhone.Text; defInsurance.Adjuster = txtDefendantInsuranceAdjuster.Text; defInsurance.ClaimNumber = txtDefendantInsuranceClaimNumber.Text; defInsurance.PolicyLimits = txtDefendantInsurancePolicyLimits.Text; BusinessLogic.SaveDefendantInsuranceInformation(defInsurance, txtFileNo.Text); } catch (Exception ex) { Helper.LogException(ex); } }