Пример #1
0
            public static bool UpdateRecord(string tableName, string updateColumnValues)
            {
                string sqlCommand = "update " + tableName + " SET " + updateColumnValues;

                SQLModule.ExcuteCommand(sqlCommand);
                return(true);
            }
Пример #2
0
            public static bool DeleteRecord(string tableName, string primaryKey, string primaryKeyValue)
            {
                string sqlCommand = "delete " + tableName + " WHERE " + primaryKey + " = " + primaryKeyValue;

                SQLModule.ExcuteCommand(sqlCommand);

                return(true);
            }
Пример #3
0
            public static string AddRecord(string tableName, string fieldList, string fieldValues)
            {
                string sqlCommand = "insert into " + tableName + "(" + fieldList + ") Values (" + fieldValues + "); ";

                SQLModule.ExcuteCommand(sqlCommand);

                //get primary key
                string primaryKey = GetPrimaryKey(tableName);

                //assuming that we will get a table and a row everytime
                string newRecSuccess = "{\"Result\":\"OK\"}";

                return(newRecSuccess);
            }