Exemplo n.º 1
0
            public static bool UpdateRecord(string tableName, string updateColumnValues)
            {
                string sqlCommand = "update " + tableName + " SET " + updateColumnValues;

                SQLModule.ExcuteCommand(sqlCommand);
                return(true);
            }
Exemplo n.º 2
0
            public static bool DeleteRecord(string tableName, string primaryKey, string primaryKeyValue)
            {
                string sqlCommand = "delete " + tableName + " WHERE " + primaryKey + " = " + primaryKeyValue;

                SQLModule.ExcuteCommand(sqlCommand);

                return(true);
            }
Exemplo n.º 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);
            }