// Helper method to validate record details private bool ValidateRecord(SupplierCl record) { string validationErrors = string.Empty; bool hasErrors = false; if (string.IsNullOrWhiteSpace(record.SupName)) { hasErrors = true; validationErrors = "Role Name must not be empty\n"; } this.LastError = validationErrors; return(!hasErrors); }
// Utility method for copying the details of a record private void CopyRecord(SupplierCl source, SupplierCl destination) { destination.SupID = source.SupID; destination.SupName = source.SupName; }
private void Edit() { this.oldRecord = new SupplierCl(); this.CopyRecord(this.Current, this.oldRecord); this.IsEditing = true; }