public bool UpdateArchiveSourceIsOnline(ArchiveSource paramSource)
		{
			if (this.Connection.State != ConnectionState.Open)
			{
				this.OpenConnection();
			}

			StringBuilder sbQuery = new StringBuilder();
			sbQuery.Append("UPDATE archivesource SET ");
			sbQuery.Append("SourceIsOnline = @SourceIsOnline, ");
			sbQuery.Append("SourceVersion = @SourceVersion ");
			sbQuery.Append("WHERE Id = @SourceId");

			var query = sbQuery.ToString();

			char isOnline = '0';

			if (paramSource.SourceIsOnline) {
				isOnline = '1';
			}

			using (var updCommand = new MySqlCommand(query, Connection))
			{
				
				updCommand.Parameters.AddWithValue("@SourceIsOnline", MySqlDbType.Binary).Value = isOnline;
				updCommand.Parameters.AddWithValue("@SourceVersion", MySqlDbType.Int64).Value = paramSource.SourceVersion;
				updCommand.Parameters.AddWithValue("@SourceId", MySqlDbType.Int64).Value = paramSource.Id;

				updCommand.ExecuteNonQuery();
			}

			this.CloseConnection();

			return true;
		}
		/// <summary>
		/// Selects the archive source online to list.
		/// </summary>
		/// <returns>The archive source online to list.</returns>
        public IList<ArchiveSource> SelectArchiveSourceOnlineToList()
        {
            string query = "SELECT * FROM archivesource WHERE SourceIsOnline = '1'";
            var sourceList = new List<ArchiveSource>();

            if (this.Connection.State != ConnectionState.Open)
            {
                this.OpenConnection();
            }

            MySqlCommand cmd = new MySqlCommand(query, this.Connection);
            MySqlDataReader dataReader = cmd.ExecuteReader();

            if (dataReader.HasRows)
            {
                while (dataReader.Read())
                {
                    var source = new ArchiveSource();
                    source.GetArchiveSource(dataReader);
                    sourceList.Add(source);
                }
            }

            dataReader.Close();
            this.CloseConnection();
            return sourceList;
        }
		/// <summary>
		/// Selects the archive source by identifier.
		/// </summary>
		/// <returns>The archive source by identifier.</returns>
		/// <param name="sourceId">Source identifier.</param>
        public ArchiveSource SelectArchiveSourceById(long sourceId)
        {
            string query = "SELECT * FROM archivesource WHERE Id = @SourceId";
            var source = new ArchiveSource();

            if (this.Connection.State != ConnectionState.Open)
            {
                this.OpenConnection();
            }

            MySqlCommand cmd = new MySqlCommand(query, this.Connection);
            cmd.Parameters.AddWithValue("@SourceId", sourceId);

            MySqlDataReader dataReader = cmd.ExecuteReader();

            if (dataReader.HasRows)
            {
                while (dataReader.Read())
                {
                    source = source.GetArchiveSource(dataReader);
                }
            }

            dataReader.Close();
            this.CloseConnection();
            return source;
        }