Here is the code in question. Standard code that I have used successfully in the past and just merged it to use LLBLGenPro. The record is not being saved and the two lines below "AddTheClient" never get executed. The catch is also not executed.
private void btnAdd_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
if (Page.IsValid)
{
try
{
string _title;
int _id = AddTheClient(out _title);
// LogModification(_id, _title, "Added");
DataEntryArea.Visible = false;
SuccessArea.Visible = true;
}
catch (Exception ex)
{
DisplayError(ex.Message);
}
}
else
{
DisplayError("Invalid Information.");
}
}
private int AddTheClient(out string title)
{
ClientEntity _newClient = new ClientEntity();
_newClient.AccountNumber = txtAccountNumber.Text.Trim();
_newClient.Title = txtTitle.Text.Trim();
_newClient.Address = txtAddress.Text.Trim();
_newClient.Address2 = txtAddress2.Text.Trim();
_newClient.City = txtCity.Text.Trim();
if (ddlStateId.SelectedValue != "0") _newClient.StateId = Int32.Parse(ddlStateId.SelectedValue);
_newClient.ZipCode = txtZipCode.Text.Trim();
_newClient.Country = txtCountry.Text.Trim();
_newClient.Phone = txtPhone.Text.Trim();
_newClient.Fax = txtFax.Text.Trim();
_newClient.EmailAddress = txtEmailAddress.Text.Trim();
_newClient.WebsiteUrl = txtWebsiteUrl.Text.Trim();
_newClient.DefaultCommissionCheckPayee = txtDefaultCommissionCheckPayee.Text.Trim();
_newClient.DefaultBuyerClosingsCostTypeId = Int32.Parse(ddlDefaultBuyerClosingsCostTypeId.SelectedValue);
_newClient.DefaultBuyerClosingsCostAmount = txtDefaultBuyerClosingsCostAmount.Text.Trim();
_newClient.DefaultSellerClosingsCostTypeId = Int32.Parse(ddlDefaultSellerClosingsCostTypeId.SelectedValue);
_newClient.DefaultSellerClosingsCostAmount = txtDefaultSellerClosingsCostAmount.Text.Trim();
_newClient.Notes = txtNotes.Text.Trim();
_newClient.CreateBy = HttpContext.Current.User.Identity.Name;
_newClient.Save();
title = _newClient.Title;
return _newClient.Id;
}