Hi, I have written the code to save the entity.
private void Savedata()
{
try
{
string message;
accountnature.Description = ChangeCase.ToTitleCase(tbxdescription.Text.Trim());
accountnature.Createddate = ServerDateTime.getcurrentserverdatewithtime();
accountnature.CreateduserId = StandardMessage.loginuserid;
var succeeded = adapteraccountnature.SaveEntity(accountnature);
if (succeeded)
{
message = StandardMessage.datasavesuccess;
adapteraccountnature.CloseConnection();
DoRefresh();
}
else
{
message = StandardMessage.datasavefailure;
adapteraccountnature.CloseConnection();
}
MessageBox.Show(message);
}
catch (Exception)
{
var message = StandardMessage.DataAccessError;
errorProvider.SetError(tbxdescription, message);
}
}
Problem:
I do know what is the problem. After string message I am supposed to add the line adapteraccountnature.FetchEntity(accountnature);. Then it works fine. I have intentionally removed this line to test succeeded true /false
My Question is, why var succeeded = adapteraccountnature.SaveEntity(accountnature); does not return false when it did not save the entity
Even if I write bool succeeded , the result is same. Is this a bug or am I doing something wrong