private static string clearLogsBetween(DBStorage db, string message) { RobotLogQuery query; try { query = (RobotLogQuery)JsonConvert.DeserializeObject(message, typeof(RobotLogQuery)); } catch (Exception) { return("ERR"); } if (query == null || query.idRobot <= 0 || query.offset < 0 || query.limit <= 0) { return("ERR"); } return(db.clearRobotLogs(query.idRobot, query.start, query.end) ? "OK" : "ERR"); }
private static string clearLogs(DBStorage db, string message) { short robotId; try { robotId = Int16.Parse(message); } catch (Exception) { return("ERR"); } if (robotId <= 0) { return("ERR"); } return(db.clearRobotLogs(robotId) ? "OK" : "ERR"); }