コード例 #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);
        }