public int delete_contact(DBColumn search_column, string key) { var delete = new DeleteCommand(configuration, null); delete.Where = new BinaryExpression(new ColumnExpression(search_column), new ConstantExpression(key, search_column), BinaryOperationType.Equal); ContactListTransaction transaction = new ContactListTransaction(); transaction.Add(delete); return(configuration.RunTransaction(transaction)); }
public int update_contact(DBColumn search_column, string key, IDictionary <string, object> new_values) { var update = new UpdateCommand(configuration, null); update.Where = new BinaryExpression(new ColumnExpression(search_column), new ConstantExpression(key, search_column), BinaryOperationType.Equal); new_values.ForEach(item => { update.UpdateData[configuration.ColumnMap[item.Key]] = item.Value; }); ContactListTransaction transaction = new ContactListTransaction(); transaction.Add(update); return(configuration.RunTransaction(transaction)); }
public int UpdateContacts(DBColumn search_column, string key, DBColumn value_column, string new_value) { var update = new UpdateCommand(configuration, null); update.Where = new BinaryExpression(new ColumnExpression(search_column), new ConstantExpression(key, search_column), BinaryOperationType.Equal); update.UpdateData[value_column] = new_value; ContactListTransaction transaction = new ContactListTransaction(); transaction.Add(update); return(configuration.RunTransaction(transaction)); }
public int insert_contact(IDictionary <string, object> columns, string status = null) { var insert = new InsertCommand(configuration); columns.ForEach(item => { insert.Contact[configuration.ColumnMap[item.Key]] = item.Value; }); if (!string.IsNullOrWhiteSpace(status)) { insert.Contact[ContactListConfiguration.Status] = status; } ContactListTransaction transaction = new ContactListTransaction(); transaction.Add(insert); return(configuration.RunTransaction(transaction)); }
public int update_contact(DBColumn search_column, string key, IDictionary<string, object> new_values) { var update = new UpdateCommand(configuration, null); update.Where = new BinaryExpression(new ColumnExpression(search_column), new ConstantExpression(key, search_column), BinaryOperationType.Equal); new_values.ForEach(item => { update.UpdateData[configuration.ColumnMap[item.Key]] = item.Value; }); ContactListTransaction transaction = new ContactListTransaction(); transaction.Add(update); return configuration.RunTransaction(transaction); }
public int UpdateContacts(DBColumn search_column, string key, DBColumn value_column, string new_value) { var update = new UpdateCommand(configuration, null); update.Where = new BinaryExpression(new ColumnExpression(search_column), new ConstantExpression(key, search_column), BinaryOperationType.Equal); update.UpdateData[value_column] = new_value; ContactListTransaction transaction = new ContactListTransaction(); transaction.Add(update); return configuration.RunTransaction(transaction); }
public int insert_contact(IDictionary<string, object> columns, string status = null) { var insert = new InsertCommand(configuration); columns.ForEach(item => { insert.Contact[configuration.ColumnMap[item.Key]] = item.Value; }); if (!string.IsNullOrWhiteSpace(status)) { insert.Contact[ContactListConfiguration.Status] = status; } ContactListTransaction transaction = new ContactListTransaction(); transaction.Add(insert); return configuration.RunTransaction(transaction); }
public int delete_contact(DBColumn search_column, string key) { var delete = new DeleteCommand(configuration, null); delete.Where = new BinaryExpression(new ColumnExpression(search_column), new ConstantExpression(key, search_column), BinaryOperationType.Equal); ContactListTransaction transaction = new ContactListTransaction(); transaction.Add(delete); return configuration.RunTransaction(transaction); }