public bool DeleteFileUploadInfo(FileUploadInfo deleteFileUploadInfo) { int res = 0; String deleteSql = $"delete from {tableName} where id={deleteFileUploadInfo.ID}"; MySqlConnectHelper mysqlCnn = MySqlConnectPoolHelper.getPool().getConnection(); res = mysqlCnn.SelectDB(dbName); res = mysqlCnn.ExecuteNonQuery(CommandType.Text, deleteSql, null); MySqlConnectPoolHelper.getPool().closeConnection(mysqlCnn); mysqlCnn = null; if (res > 0) { return(true); } return(false); }
public bool InsertFileUploadInfo(FileUploadInfo newFileUploadInfo) { int res = 0; String currentDate = DateTime.Now.ToLocalTime().ToString(); String FilePathList = string.Join(",", newFileUploadInfo.FilePathList); String deleteSql = $"insert into {tableName} VALUES(NULL,'{currentDate}','{newFileUploadInfo.Content}','{newFileUploadInfo.UserName}','{FilePathList}')"; MySqlConnectHelper mysqlCnn = MySqlConnectPoolHelper.getPool().getConnection(); res = mysqlCnn.SelectDB(dbName); res = mysqlCnn.ExecuteNonQuery(CommandType.Text, deleteSql, null); MySqlConnectPoolHelper.getPool().closeConnection(mysqlCnn); mysqlCnn = null; if (res > 0) { return(true); } return(false); }