I have a form with textboxes, dropdownlist etc. If something is updated I create a note e.g. if the user changes the name of the country.
if (cust.CountryName.ToString() != ddlCountry.SelectedItem.Text)
{
Customer.Notes.InsertNote(cust.ID, Company.Current.CompanyID, DateTime.Now, "Country changed from '" + cust.CountryName + "' to '" + ddlCountry.SelectedItem.Text + "'", CurrentUser.UserID, 1);
}
A note is created saying what was changed, by which user and the date and time.
I have a lot of similar if statements for different fields in the form, but I want to create a note for all the fields that don't need a special note. For some fields I just want to create a note like:
Customer.Notes.InsertNote(cust.ID, Company.Current.CompanyID, DateTime.Now, "Customer updated" , CurrentUser.UserID, 1);
It doesn't matter what exactly was changed. I just want to know the customer form was updated.
Is there a way to check the other fields in the form without creating a separate if statement for each field? Basically if something is updated and its not any of the if statements, create the note "Customer updated"
Aucun commentaire:
Enregistrer un commentaire