Пример #1
0
        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));
        }
Пример #2
0
        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));
        }
Пример #3
0
        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));
        }
Пример #4
0
        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));
        }
Пример #5
0
        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);
        }
Пример #6
0
        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);
        }
Пример #7
0
        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);
        }
Пример #8
0
        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);
        }