private void CreateField(string tableName, PropertyInfo property) { var field = (UserFieldsMD)company.GetBusinessObject(BoObjectTypes.oUserFields); var adapter = new PropertyUserFieldAdapter(tableName, property, field); adapter.Execute(); var addUserField = new AddUserField(company, field); addUserField.OnError += OnAddUserFieldError; addUserField.Execute(); }
private void CreateFieldsFromXDocument(XDocument xml) { var userFields = xml.Descendants(@"UserField"); foreach (var userField in userFields) { var field = (UserFieldsMD)company.GetBusinessObject(BoObjectTypes.oUserFields); var adapter = new UserFieldAdapter(field, userField); adapter.Execute(); var addUserField = new AddUserField(company, field); addUserField.OnError += OnAddUserFieldError; addUserField.Execute(); } }