Add XML documentation.

This commit is contained in:
2018-04-12 11:50:02 +01:00
parent c11bb150c5
commit 20ec27eecb
40 changed files with 967 additions and 92 deletions

View File

@@ -27,6 +27,7 @@
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
using System;
using System.Collections.Generic;
using System.Data;
@@ -37,6 +38,11 @@ namespace Cicm.Database
{
public partial class Operations
{
/// <summary>
/// Gets all admins
/// </summary>
/// <param name="entries">All admins</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetAdmins(out List<Admin> entries)
{
#if DEBUG
@@ -67,6 +73,13 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets the specified number of admins since the specified start
/// </summary>
/// <param name="entries">List of admins</param>
/// <param name="start">Start of query</param>
/// <param name="count">How many entries to retrieve</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetAdmins(out List<Admin> entries, ulong start, ulong count)
{
#if DEBUG
@@ -97,6 +110,11 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets admin by specified id
/// </summary>
/// <param name="id">Id</param>
/// <returns>Admin with specified id, <c>null</c> if not found or error</returns>
public Admin GetAdmin(int id)
{
#if DEBUG
@@ -126,6 +144,10 @@ namespace Cicm.Database
}
}
/// <summary>
/// Counts the number of administrators in the database
/// </summary>
/// <returns>Entries in database</returns>
public long CountAdmins()
{
#if DEBUG
@@ -140,6 +162,12 @@ namespace Cicm.Database
catch { return 0; }
}
/// <summary>
/// Adds a new administrator to the database
/// </summary>
/// <param name="entry">Entry to add</param>
/// <param name="id">ID of added entry</param>
/// <returns><c>true</c> if added correctly, <c>false</c> otherwise</returns>
public bool AddAdmin(Admin entry, out long id)
{
#if DEBUG
@@ -167,6 +195,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Updated an administrator in the database
/// </summary>
/// <param name="entry">Updated entry</param>
/// <returns><c>true</c> if updated correctly, <c>false</c> otherwise</returns>
public bool UpdateAdmin(Admin entry)
{
#if DEBUG
@@ -188,6 +221,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Removes an administrator from the database
/// </summary>
/// <param name="id">ID of entry to remove</param>
/// <returns><c>true</c> if removed correctly, <c>false</c> otherwise</returns>
public bool RemoveAdmin(long id)
{
#if DEBUG

View File

@@ -27,6 +27,7 @@
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
using System;
using System.Collections.Generic;
using System.Data;
@@ -37,6 +38,11 @@ namespace Cicm.Database
{
public partial class Operations
{
/// <summary>
/// Gets all browser tests
/// </summary>
/// <param name="entries">All browser tests</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetBrowserTests(out List<BrowserTest> entries)
{
#if DEBUG
@@ -67,6 +73,13 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets the specified number of browser tests since the specified start
/// </summary>
/// <param name="entries">List of browser tests</param>
/// <param name="start">Start of query</param>
/// <param name="count">How many entries to retrieve</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetBrowserTests(out List<BrowserTest> entries, ulong start, ulong count)
{
#if DEBUG
@@ -97,6 +110,11 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets browser test by specified id
/// </summary>
/// <param name="id">Id</param>
/// <returns>Browser test with specified id, <c>null</c> if not found or error</returns>
public BrowserTest GetBrowserTest(int id)
{
#if DEBUG
@@ -126,6 +144,10 @@ namespace Cicm.Database
}
}
/// <summary>
/// Counts the number of browser tests in the database
/// </summary>
/// <returns>Entries in database</returns>
public long CountBrowserTests()
{
#if DEBUG
@@ -140,6 +162,12 @@ namespace Cicm.Database
catch { return 0; }
}
/// <summary>
/// Adds a new browser test to the database
/// </summary>
/// <param name="entry">Entry to add</param>
/// <param name="id">ID of added entry</param>
/// <returns><c>true</c> if added correctly, <c>false</c> otherwise</returns>
public bool AddBrowserTest(BrowserTest entry, out long id)
{
#if DEBUG
@@ -169,6 +197,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Updated a browser test in the database
/// </summary>
/// <param name="entry">Updated entry</param>
/// <returns><c>true</c> if updated correctly, <c>false</c> otherwise</returns>
public bool UpdateBrowserTest(BrowserTest entry)
{
#if DEBUG
@@ -193,6 +226,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Removes a browser test from the database
/// </summary>
/// <param name="id">ID of entry to remove</param>
/// <returns><c>true</c> if removed correctly, <c>false</c> otherwise</returns>
public bool RemoveBrowserTest(long id)
{
#if DEBUG

View File

@@ -27,6 +27,7 @@
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
using System;
using System.Collections.Generic;
using System.Data;
@@ -37,6 +38,11 @@ namespace Cicm.Database
{
public partial class Operations
{
/// <summary>
/// Gets all companies
/// </summary>
/// <param name="entries">All companies</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetCompanies(out List<Company> entries)
{
#if DEBUG
@@ -67,6 +73,13 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets the specified number of companies since the specified start
/// </summary>
/// <param name="entries">List of companies</param>
/// <param name="start">Start of query</param>
/// <param name="count">How many entries to retrieve</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetCompanies(out List<Company> entries, ulong start, ulong count)
{
#if DEBUG
@@ -97,6 +110,11 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets company by specified id
/// </summary>
/// <param name="id">Id</param>
/// <returns>Company with specified id, <c>null</c> if not found or error</returns>
public Company GetCompany(int id)
{
#if DEBUG
@@ -126,6 +144,10 @@ namespace Cicm.Database
}
}
/// <summary>
/// Counts the number of companies in the database
/// </summary>
/// <returns>Entries in database</returns>
public long CountCompanies()
{
#if DEBUG
@@ -140,6 +162,12 @@ namespace Cicm.Database
catch { return 0; }
}
/// <summary>
/// Adds a new company to the database
/// </summary>
/// <param name="entry">Entry to add</param>
/// <param name="id">ID of added entry</param>
/// <returns><c>true</c> if added correctly, <c>false</c> otherwise</returns>
public bool AddCompany(Company entry, out long id)
{
#if DEBUG
@@ -167,6 +195,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Updated a company in the database
/// </summary>
/// <param name="entry">Updated entry</param>
/// <returns><c>true</c> if updated correctly, <c>false</c> otherwise</returns>
public bool UpdateCompany(Company entry)
{
#if DEBUG
@@ -188,6 +221,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Removes a company from the database
/// </summary>
/// <param name="id">ID of entry to remove</param>
/// <returns><c>true</c> if removed correctly, <c>false</c> otherwise</returns>
public bool RemoveCompany(long id)
{
#if DEBUG

View File

@@ -27,6 +27,7 @@
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
using System;
using System.Collections.Generic;
using System.Data;
@@ -37,6 +38,11 @@ namespace Cicm.Database
{
public partial class Operations
{
/// <summary>
/// Gets all computers
/// </summary>
/// <param name="entries">All computers</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetComputers(out List<Computer> entries)
{
#if DEBUG
@@ -67,6 +73,13 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets the specified number of computers since the specified start
/// </summary>
/// <param name="entries">List of computers</param>
/// <param name="start">Start of query</param>
/// <param name="count">How many entries to retrieve</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetComputers(out List<Computer> entries, ulong start, ulong count)
{
#if DEBUG
@@ -97,6 +110,11 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets computer by specified id
/// </summary>
/// <param name="id">Id</param>
/// <returns>Computer with specified id, <c>null</c> if not found or error</returns>
public Computer GetComputer(int id)
{
#if DEBUG
@@ -126,6 +144,10 @@ namespace Cicm.Database
}
}
/// <summary>
/// Counts the number of computers in the database
/// </summary>
/// <returns>Entries in database</returns>
public long CountComputers()
{
#if DEBUG
@@ -140,6 +162,12 @@ namespace Cicm.Database
catch { return 0; }
}
/// <summary>
/// Adds a new administrator to the database
/// </summary>
/// <param name="entry">Entry to add</param>
/// <param name="id">ID of added entry</param>
/// <returns><c>true</c> if added correctly, <c>false</c> otherwise</returns>
public bool AddComputer(Computer entry, out long id)
{
#if DEBUG
@@ -169,6 +197,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Updated a computer in the database
/// </summary>
/// <param name="entry">Updated entry</param>
/// <returns><c>true</c> if updated correctly, <c>false</c> otherwise</returns>
public bool UpdateComputer(Computer entry)
{
#if DEBUG
@@ -194,6 +227,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Removes a computer from the database
/// </summary>
/// <param name="id">ID of entry to remove</param>
/// <returns><c>true</c> if removed correctly, <c>false</c> otherwise</returns>
public bool RemoveComputer(long id)
{
#if DEBUG

View File

@@ -27,6 +27,7 @@
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
using System;
using System.Collections.Generic;
using System.Data;
@@ -36,6 +37,11 @@ namespace Cicm.Database
{
public partial class Operations
{
/// <summary>
/// Gets all consoles
/// </summary>
/// <param name="entries">All consoles</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetConsoles(out List<Console> entries)
{
#if DEBUG
@@ -66,6 +72,13 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets the specified number of videogame consoles since the specified start
/// </summary>
/// <param name="entries">List of videogame consoles</param>
/// <param name="start">Start of query</param>
/// <param name="count">How many entries to retrieve</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetConsoles(out List<Console> entries, ulong start, ulong count)
{
#if DEBUG
@@ -96,6 +109,11 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets videogame console by specified id
/// </summary>
/// <param name="id">Id</param>
/// <returns>Videogame console with specified id, <c>null</c> if not found or error</returns>
public Console GetConsole(int id)
{
#if DEBUG
@@ -125,6 +143,10 @@ namespace Cicm.Database
}
}
/// <summary>
/// Counts the number of videogame consoles in the database
/// </summary>
/// <returns>Entries in database</returns>
public long CountConsoles()
{
#if DEBUG
@@ -139,6 +161,12 @@ namespace Cicm.Database
catch { return 0; }
}
/// <summary>
/// Adds a new videogame console to the database
/// </summary>
/// <param name="entry">Entry to add</param>
/// <param name="id">ID of added entry</param>
/// <returns><c>true</c> if added correctly, <c>false</c> otherwise</returns>
public bool AddConsole(Console entry, out long id)
{
#if DEBUG
@@ -168,6 +196,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Updated an videogame console in the database
/// </summary>
/// <param name="entry">Updated entry</param>
/// <returns><c>true</c> if updated correctly, <c>false</c> otherwise</returns>
public bool UpdateConsole(Console entry)
{
#if DEBUG
@@ -193,6 +226,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Removes a videogame console from the database
/// </summary>
/// <param name="id">ID of entry to remove</param>
/// <returns><c>true</c> if removed correctly, <c>false</c> otherwise</returns>
public bool RemoveConsole(long id)
{
#if DEBUG

View File

@@ -27,6 +27,7 @@
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
using System;
using System.Collections.Generic;
using System.Data;
@@ -37,6 +38,11 @@ namespace Cicm.Database
{
public partial class Operations
{
/// <summary>
/// Gets all console companies
/// </summary>
/// <param name="entries">All console companies</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetConsoleCompanies(out List<ConsoleCompany> entries)
{
#if DEBUG
@@ -67,6 +73,13 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets the specified number of console companies since the specified start
/// </summary>
/// <param name="entries">List of console companies</param>
/// <param name="start">Start of query</param>
/// <param name="count">How many entries to retrieve</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetConsoleCompanies(out List<ConsoleCompany> entries, ulong start, ulong count)
{
#if DEBUG
@@ -97,6 +110,11 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets console company by specified id
/// </summary>
/// <param name="id">Id</param>
/// <returns>Console company with specified id, <c>null</c> if not found or error</returns>
public ConsoleCompany GetConsoleCompany(int id)
{
#if DEBUG
@@ -126,6 +144,10 @@ namespace Cicm.Database
}
}
/// <summary>
/// Counts the number of console companies in the database
/// </summary>
/// <returns>Entries in database</returns>
public long CountConsoleCompanies()
{
#if DEBUG
@@ -140,6 +162,12 @@ namespace Cicm.Database
catch { return 0; }
}
/// <summary>
/// Adds a new console company to the database
/// </summary>
/// <param name="entry">Entry to add</param>
/// <param name="id">ID of added entry</param>
/// <returns><c>true</c> if added correctly, <c>false</c> otherwise</returns>
public bool AddConsoleCompany(ConsoleCompany entry, out long id)
{
#if DEBUG
@@ -167,6 +195,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Updated a console company in the database
/// </summary>
/// <param name="entry">Updated entry</param>
/// <returns><c>true</c> if updated correctly, <c>false</c> otherwise</returns>
public bool UpdateConsoleCompany(ConsoleCompany entry)
{
#if DEBUG
@@ -188,6 +221,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Removes a console company from the database
/// </summary>
/// <param name="id">ID of entry to remove</param>
/// <returns><c>true</c> if removed correctly, <c>false</c> otherwise</returns>
public bool RemoveConsoleCompany(long id)
{
#if DEBUG

View File

@@ -27,6 +27,7 @@
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
using System;
using System.Collections.Generic;
using System.Data;
@@ -37,6 +38,11 @@ namespace Cicm.Database
{
public partial class Operations
{
/// <summary>
/// Gets all CPUs
/// </summary>
/// <param name="entries">All CPUs</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetCpus(out List<Cpu> entries)
{
#if DEBUG
@@ -67,6 +73,13 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets the specified number of CPUs since the specified start
/// </summary>
/// <param name="entries">List of CPUs</param>
/// <param name="start">Start of query</param>
/// <param name="count">How many entries to retrieve</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetCpus(out List<Cpu> entries, ulong start, ulong count)
{
#if DEBUG
@@ -97,6 +110,11 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets CPU by specified id
/// </summary>
/// <param name="id">Id</param>
/// <returns>CPU with specified id, <c>null</c> if not found or error</returns>
public Cpu GetCpu(int id)
{
#if DEBUG
@@ -126,6 +144,10 @@ namespace Cicm.Database
}
}
/// <summary>
/// Counts the number of CPUs in the database
/// </summary>
/// <returns>Entries in database</returns>
public long CountCpus()
{
#if DEBUG
@@ -140,6 +162,12 @@ namespace Cicm.Database
catch { return 0; }
}
/// <summary>
/// Adds a new CPU to the database
/// </summary>
/// <param name="entry">Entry to add</param>
/// <param name="id">ID of added entry</param>
/// <returns><c>true</c> if added correctly, <c>false</c> otherwise</returns>
public bool AddCpu(Cpu entry, out long id)
{
#if DEBUG
@@ -167,6 +195,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Updated a CPU in the database
/// </summary>
/// <param name="entry">Updated entry</param>
/// <returns><c>true</c> if updated correctly, <c>false</c> otherwise</returns>
public bool UpdateCpu(Cpu entry)
{
#if DEBUG
@@ -188,6 +221,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Removes a CPU from the database
/// </summary>
/// <param name="id">ID of entry to remove</param>
/// <returns><c>true</c> if removed correctly, <c>false</c> otherwise</returns>
public bool RemoveCpu(long id)
{
#if DEBUG

View File

@@ -27,6 +27,7 @@
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
using System;
using System.Collections.Generic;
using System.Data;
@@ -37,6 +38,11 @@ namespace Cicm.Database
{
public partial class Operations
{
/// <summary>
/// Gets all disk formats
/// </summary>
/// <param name="entries">All disk formats</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetDiskFormats(out List<DiskFormat> entries)
{
#if DEBUG
@@ -67,6 +73,13 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets the specified number of disk formats since the specified start
/// </summary>
/// <param name="entries">List of disk formats</param>
/// <param name="start">Start of query</param>
/// <param name="count">How many entries to retrieve</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetDiskFormats(out List<DiskFormat> entries, ulong start, ulong count)
{
#if DEBUG
@@ -97,6 +110,11 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets disk format by specified id
/// </summary>
/// <param name="id">Id</param>
/// <returns>Disk format with specified id, <c>null</c> if not found or error</returns>
public DiskFormat GetDiskFormat(int id)
{
#if DEBUG
@@ -126,6 +144,10 @@ namespace Cicm.Database
}
}
/// <summary>
/// Counts the number of disk formats in the database
/// </summary>
/// <returns>Entries in database</returns>
public long CountDiskFormats()
{
#if DEBUG
@@ -140,6 +162,12 @@ namespace Cicm.Database
catch { return 0; }
}
/// <summary>
/// Adds a new disk format to the database
/// </summary>
/// <param name="entry">Entry to add</param>
/// <param name="id">ID of added entry</param>
/// <returns><c>true</c> if added correctly, <c>false</c> otherwise</returns>
public bool AddDiskFormat(DiskFormat entry, out long id)
{
#if DEBUG
@@ -167,6 +195,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Updated a disk format in the database
/// </summary>
/// <param name="entry">Updated entry</param>
/// <returns><c>true</c> if updated correctly, <c>false</c> otherwise</returns>
public bool UpdateDiskFormat(DiskFormat entry)
{
#if DEBUG
@@ -188,6 +221,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Removes a disk format from the database
/// </summary>
/// <param name="id">ID of entry to remove</param>
/// <returns><c>true</c> if removed correctly, <c>false</c> otherwise</returns>
public bool RemoveDiskFormat(long id)
{
#if DEBUG

View File

@@ -27,6 +27,7 @@
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
using System;
using System.Collections.Generic;
using System.Data;
@@ -37,6 +38,11 @@ namespace Cicm.Database
{
public partial class Operations
{
/// <summary>
/// Gets all DSPs
/// </summary>
/// <param name="entries">All DSPs</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetDsps(out List<Dsp> entries)
{
#if DEBUG
@@ -67,6 +73,13 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets the specified number of DSPs since the specified start
/// </summary>
/// <param name="entries">List of DSPs</param>
/// <param name="start">Start of query</param>
/// <param name="count">How many entries to retrieve</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetDsps(out List<Dsp> entries, ulong start, ulong count)
{
#if DEBUG
@@ -97,6 +110,11 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets DSP by specified id
/// </summary>
/// <param name="id">Id</param>
/// <returns>DSP with specified id, <c>null</c> if not found or error</returns>
public Dsp GetDsp(int id)
{
#if DEBUG
@@ -126,6 +144,10 @@ namespace Cicm.Database
}
}
/// <summary>
/// Counts the number of DSPs in the database
/// </summary>
/// <returns>Entries in database</returns>
public long CountDsps()
{
#if DEBUG
@@ -140,6 +162,12 @@ namespace Cicm.Database
catch { return 0; }
}
/// <summary>
/// Adds a new DSP to the database
/// </summary>
/// <param name="entry">Entry to add</param>
/// <param name="id">ID of added entry</param>
/// <returns><c>true</c> if added correctly, <c>false</c> otherwise</returns>
public bool AddDsp(Dsp entry, out long id)
{
#if DEBUG
@@ -167,6 +195,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Updated a DSP in the database
/// </summary>
/// <param name="entry">Updated entry</param>
/// <returns><c>true</c> if updated correctly, <c>false</c> otherwise</returns>
public bool UpdateDsp(Dsp entry)
{
#if DEBUG
@@ -188,6 +221,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Removes a DSP from the database
/// </summary>
/// <param name="id">ID of entry to remove</param>
/// <returns><c>true</c> if removed correctly, <c>false</c> otherwise</returns>
public bool RemoveDsp(long id)
{
#if DEBUG

View File

@@ -27,6 +27,7 @@
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
using System;
using System.Collections.Generic;
using System.Data;
@@ -37,6 +38,11 @@ namespace Cicm.Database
{
public partial class Operations
{
/// <summary>
/// Gets all forbidden accesses
/// </summary>
/// <param name="entries">All forbidden accesses</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetForbiddens(out List<Forbidden> entries)
{
#if DEBUG
@@ -67,6 +73,13 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets the specified number of forbidden accesses since the specified start
/// </summary>
/// <param name="entries">List of forbidden accesses</param>
/// <param name="start">Start of query</param>
/// <param name="count">How many entries to retrieve</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetForbiddens(out List<Forbidden> entries, ulong start, ulong count)
{
#if DEBUG
@@ -97,6 +110,11 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets forbidden entry by specified id
/// </summary>
/// <param name="id">Id</param>
/// <returns>Forbidden entry with specified id, <c>null</c> if not found or error</returns>
public Forbidden GetForbidden(int id)
{
#if DEBUG
@@ -126,6 +144,10 @@ namespace Cicm.Database
}
}
/// <summary>
/// Counts the number of Forbidden accesses in the database
/// </summary>
/// <returns>Entries in database</returns>
public long CountForbiddens()
{
#if DEBUG
@@ -140,6 +162,12 @@ namespace Cicm.Database
catch { return 0; }
}
/// <summary>
/// Adds a new forbidden to the database
/// </summary>
/// <param name="entry">Entry to add</param>
/// <param name="id">ID of added entry</param>
/// <returns><c>true</c> if added correctly, <c>false</c> otherwise</returns>
public bool AddForbidden(Forbidden entry, out long id)
{
#if DEBUG
@@ -168,6 +196,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Updated a forbidden access in the database
/// </summary>
/// <param name="entry">Updated entry</param>
/// <returns><c>true</c> if updated correctly, <c>false</c> otherwise</returns>
public bool UpdateForbidden(Forbidden entry)
{
#if DEBUG
@@ -190,6 +223,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Removes a forbidden access from the database
/// </summary>
/// <param name="id">ID of entry to remove</param>
/// <returns><c>true</c> if removed correctly, <c>false</c> otherwise</returns>
public bool RemoveForbidden(long id)
{
#if DEBUG

View File

@@ -27,6 +27,7 @@
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
using System;
using System.Collections.Generic;
using System.Data;
@@ -37,6 +38,11 @@ namespace Cicm.Database
{
public partial class Operations
{
/// <summary>
/// Gets all GPUs
/// </summary>
/// <param name="entries">All GPUs</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetGpus(out List<Gpu> entries)
{
#if DEBUG
@@ -67,6 +73,13 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets the specified number of GPUs since the specified start
/// </summary>
/// <param name="entries">List of GPUs</param>
/// <param name="start">Start of query</param>
/// <param name="count">How many entries to retrieve</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetGpus(out List<Gpu> entries, ulong start, ulong count)
{
#if DEBUG
@@ -97,6 +110,11 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets GPU by specified id
/// </summary>
/// <param name="id">Id</param>
/// <returns>GPU with specified id, <c>null</c> if not found or error</returns>
public Gpu GetGpu(int id)
{
#if DEBUG
@@ -126,6 +144,10 @@ namespace Cicm.Database
}
}
/// <summary>
/// Counts the number of GPUs in the database
/// </summary>
/// <returns>Entries in database</returns>
public long CountGpus()
{
#if DEBUG
@@ -140,6 +162,12 @@ namespace Cicm.Database
catch { return 0; }
}
/// <summary>
/// Adds a new GPU to the database
/// </summary>
/// <param name="entry">Entry to add</param>
/// <param name="id">ID of added entry</param>
/// <returns><c>true</c> if added correctly, <c>false</c> otherwise</returns>
public bool AddGpu(Gpu entry, out long id)
{
#if DEBUG
@@ -167,6 +195,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Updated a GPU in the database
/// </summary>
/// <param name="entry">Updated entry</param>
/// <returns><c>true</c> if updated correctly, <c>false</c> otherwise</returns>
public bool UpdateGpu(Gpu entry)
{
#if DEBUG
@@ -188,6 +221,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Removes a GPU from the database
/// </summary>
/// <param name="id">ID of entry to remove</param>
/// <returns><c>true</c> if removed correctly, <c>false</c> otherwise</returns>
public bool RemoveGpu(long id)
{
#if DEBUG

View File

@@ -27,6 +27,7 @@
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
using System;
using System.Data;
using Cicm.Database.Schemas.Sql;
@@ -35,6 +36,10 @@ namespace Cicm.Database
{
public partial class Operations
{
/// <summary>
/// Initializes tables in the database
/// </summary>
/// <returns><c>true</c> if initialized correctly, <c>false</c> otherwise</returns>
public bool InitializeNewDatabase()
{
Console.WriteLine("Creating new database version {0}", DB_VERSION);

View File

@@ -27,6 +27,7 @@
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
using System;
using System.Collections.Generic;
using System.Data;
@@ -37,6 +38,11 @@ namespace Cicm.Database
{
public partial class Operations
{
/// <summary>
/// Gets all log entries
/// </summary>
/// <param name="entries">All log entries</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetLogs(out List<Log> entries)
{
#if DEBUG
@@ -67,6 +73,13 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets the specified number of log entries since the specified start
/// </summary>
/// <param name="entries">List of log entries</param>
/// <param name="start">Start of query</param>
/// <param name="count">How many entries to retrieve</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetLogs(out List<Log> entries, ulong start, ulong count)
{
#if DEBUG
@@ -97,6 +110,11 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets log entry by specified id
/// </summary>
/// <param name="id">Id</param>
/// <returns>Log entry with specified id, <c>null</c> if not found or error</returns>
public Log GetLog(int id)
{
#if DEBUG
@@ -126,6 +144,10 @@ namespace Cicm.Database
}
}
/// <summary>
/// Counts the number of log entries in the database
/// </summary>
/// <returns>Entries in database</returns>
public long CountLogs()
{
#if DEBUG
@@ -140,6 +162,12 @@ namespace Cicm.Database
catch { return 0; }
}
/// <summary>
/// Adds a new access log entry to the database
/// </summary>
/// <param name="entry">Entry to add</param>
/// <param name="id">ID of added entry</param>
/// <returns><c>true</c> if added correctly, <c>false</c> otherwise</returns>
public bool AddLog(Log entry, out long id)
{
#if DEBUG
@@ -168,6 +196,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Updated an access log in the database
/// </summary>
/// <param name="entry">Updated entry</param>
/// <returns><c>true</c> if updated correctly, <c>false</c> otherwise</returns>
public bool UpdateLog(Log entry)
{
#if DEBUG
@@ -190,6 +223,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Removes an access log entry from the database
/// </summary>
/// <param name="id">ID of entry to remove</param>
/// <returns><c>true</c> if removed correctly, <c>false</c> otherwise</returns>
public bool RemoveLog(long id)
{
#if DEBUG

View File

@@ -27,6 +27,7 @@
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
using System;
using System.Collections.Generic;
using System.Data;
@@ -37,6 +38,11 @@ namespace Cicm.Database
{
public partial class Operations
{
/// <summary>
/// Gets all money donations
/// </summary>
/// <param name="entries">All money donations</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetMoneyDonations(out List<MoneyDonation> entries)
{
#if DEBUG
@@ -67,6 +73,13 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets the specified number of money donations since the specified start
/// </summary>
/// <param name="entries">List of money donations</param>
/// <param name="start">Start of query</param>
/// <param name="count">How many entries to retrieve</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetMoneyDonations(out List<MoneyDonation> entries, ulong start, ulong count)
{
#if DEBUG
@@ -97,6 +110,11 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets money donation by specified id
/// </summary>
/// <param name="id">Id</param>
/// <returns>Money donation with specified id, <c>null</c> if not found or error</returns>
public MoneyDonation GetMoneyDonation(int id)
{
#if DEBUG
@@ -126,6 +144,10 @@ namespace Cicm.Database
}
}
/// <summary>
/// Counts the number of money donations in the database
/// </summary>
/// <returns>Entries in database</returns>
public long CountMoneyDonations()
{
#if DEBUG
@@ -140,6 +162,12 @@ namespace Cicm.Database
catch { return 0; }
}
/// <summary>
/// Adds a new money donation to the database
/// </summary>
/// <param name="entry">Entry to add</param>
/// <param name="id">ID of added entry</param>
/// <returns><c>true</c> if added correctly, <c>false</c> otherwise</returns>
public bool AddMoneyDonation(MoneyDonation entry, out long id)
{
#if DEBUG
@@ -167,6 +195,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Updated a money donation in the database
/// </summary>
/// <param name="entry">Updated entry</param>
/// <returns><c>true</c> if updated correctly, <c>false</c> otherwise</returns>
public bool UpdateMoneyDonation(MoneyDonation entry)
{
#if DEBUG
@@ -189,6 +222,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Removes a money donation from the database
/// </summary>
/// <param name="id">ID of entry to remove</param>
/// <returns><c>true</c> if removed correctly, <c>false</c> otherwise</returns>
public bool RemoveMoneyDonation(long id)
{
#if DEBUG

View File

@@ -27,6 +27,7 @@
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
using System;
using System.Collections.Generic;
using System.Data;
@@ -37,6 +38,11 @@ namespace Cicm.Database
{
public partial class Operations
{
/// <summary>
/// Gets all MPUs
/// </summary>
/// <param name="entries">All MPUs</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetMpus(out List<Mpu> entries)
{
#if DEBUG
@@ -67,6 +73,13 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets the specified number of MPUs since the specified start
/// </summary>
/// <param name="entries">List of MPUs</param>
/// <param name="start">Start of query</param>
/// <param name="count">How many entries to retrieve</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetMpus(out List<Mpu> entries, ulong start, ulong count)
{
#if DEBUG
@@ -97,6 +110,11 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets MPU by specified id
/// </summary>
/// <param name="id">Id</param>
/// <returns>MPU with specified id, <c>null</c> if not found or error</returns>
public Mpu GetMpu(int id)
{
#if DEBUG
@@ -126,6 +144,10 @@ namespace Cicm.Database
}
}
/// <summary>
/// Counts the number of MPUs in the database
/// </summary>
/// <returns>Entries in database</returns>
public long CountMpus()
{
#if DEBUG
@@ -140,6 +162,12 @@ namespace Cicm.Database
catch { return 0; }
}
/// <summary>
/// Adds a new MPU to the database
/// </summary>
/// <param name="entry">Entry to add</param>
/// <param name="id">ID of added entry</param>
/// <returns><c>true</c> if added correctly, <c>false</c> otherwise</returns>
public bool AddMpu(Mpu entry, out long id)
{
#if DEBUG
@@ -167,6 +195,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Updated an MPU in the database
/// </summary>
/// <param name="entry">Updated entry</param>
/// <returns><c>true</c> if updated correctly, <c>false</c> otherwise</returns>
public bool UpdateMpu(Mpu entry)
{
#if DEBUG

View File

@@ -27,6 +27,7 @@
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
using System;
using System.Collections.Generic;
using System.Data;
@@ -37,6 +38,11 @@ namespace Cicm.Database
{
public partial class Operations
{
/// <summary>
/// Gets all site news
/// </summary>
/// <param name="entries">All site news</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetNews(out List<News> entries)
{
#if DEBUG
@@ -67,6 +73,13 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets the specified number of site news since the specified start
/// </summary>
/// <param name="entries">List of site news</param>
/// <param name="start">Start of query</param>
/// <param name="count">How many entries to retrieve</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetNews(out List<News> entries, ulong start, ulong count)
{
#if DEBUG
@@ -97,6 +110,11 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets site news by specified id
/// </summary>
/// <param name="id">Id</param>
/// <returns>Site news with specified id, <c>null</c> if not found or error</returns>
public News GetNews(int id)
{
#if DEBUG
@@ -126,6 +144,10 @@ namespace Cicm.Database
}
}
/// <summary>
/// Counts the number of site news in the database
/// </summary>
/// <returns>Entries in database</returns>
public long CountNews()
{
#if DEBUG
@@ -140,6 +162,12 @@ namespace Cicm.Database
catch { return 0; }
}
/// <summary>
/// Adds a new site news to the database
/// </summary>
/// <param name="entry">Entry to add</param>
/// <param name="id">ID of added entry</param>
/// <returns><c>true</c> if added correctly, <c>false</c> otherwise</returns>
public bool AddNews(News entry, out long id)
{
#if DEBUG
@@ -167,6 +195,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Updated a site news in the database
/// </summary>
/// <param name="entry">Updated entry</param>
/// <returns><c>true</c> if updated correctly, <c>false</c> otherwise</returns>
public bool UpdateNews(News entry)
{
#if DEBUG
@@ -188,6 +221,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Removes a site news entry from the database
/// </summary>
/// <param name="id">ID of entry to remove</param>
/// <returns><c>true</c> if removed correctly, <c>false</c> otherwise</returns>
public bool RemoveNews(long id)
{
#if DEBUG

View File

@@ -27,12 +27,14 @@
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
using System.Data;
namespace Cicm.Database
{
public partial class Operations
{
/// <summary>Last known database version</summary>
const int DB_VERSION = 2;
readonly IDbConnection dbCon;

View File

@@ -27,6 +27,7 @@
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
using System;
using System.Collections.Generic;
using System.Data;
@@ -37,6 +38,11 @@ namespace Cicm.Database
{
public partial class Operations
{
/// <summary>
/// Gets all owned computers
/// </summary>
/// <param name="entries">All owned computers</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetOwnOwnComputers(out List<OwnComputer> entries)
{
#if DEBUG
@@ -67,6 +73,13 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets the specified number of owned computers since the specified start
/// </summary>
/// <param name="entries">List of owned computers</param>
/// <param name="start">Start of query</param>
/// <param name="count">How many entries to retrieve</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetOwnOwnComputers(out List<OwnComputer> entries, ulong start, ulong count)
{
#if DEBUG
@@ -97,6 +110,11 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets owned computer by specified id
/// </summary>
/// <param name="id">Id</param>
/// <returns>Owned computer with specified id, <c>null</c> if not found or error</returns>
public OwnComputer GetOwnComputer(int id)
{
#if DEBUG
@@ -126,6 +144,10 @@ namespace Cicm.Database
}
}
/// <summary>
/// Counts the number of owned computers in the database
/// </summary>
/// <returns>Entries in database</returns>
public long CountOwnOwnComputers()
{
#if DEBUG
@@ -140,6 +162,12 @@ namespace Cicm.Database
catch { return 0; }
}
/// <summary>
/// Adds a new owned computer to the database
/// </summary>
/// <param name="entry">Entry to add</param>
/// <param name="id">ID of added entry</param>
/// <returns><c>true</c> if added correctly, <c>false</c> otherwise</returns>
public bool AddOwnComputer(OwnComputer entry, out long id)
{
#if DEBUG
@@ -169,6 +197,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Updated an owned computer in the database
/// </summary>
/// <param name="entry">Updated entry</param>
/// <returns><c>true</c> if updated correctly, <c>false</c> otherwise</returns>
public bool UpdateOwnComputer(OwnComputer entry)
{
#if DEBUG
@@ -193,6 +226,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Removes an owned computer from the database
/// </summary>
/// <param name="id">ID of entry to remove</param>
/// <returns><c>true</c> if removed correctly, <c>false</c> otherwise</returns>
public bool RemoveOwnComputer(long id)
{
#if DEBUG

View File

@@ -27,6 +27,7 @@
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
using System;
using System.Collections.Generic;
using System.Data;
@@ -37,6 +38,11 @@ namespace Cicm.Database
{
public partial class Operations
{
/// <summary>
/// Gets all owned consoles
/// </summary>
/// <param name="entries">All owned consoles</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetOwnOwnConsoles(out List<OwnConsole> entries)
{
#if DEBUG
@@ -67,6 +73,13 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets the specified number of owned consoles since the specified start
/// </summary>
/// <param name="entries">List of owned consoles</param>
/// <param name="start">Start of query</param>
/// <param name="count">How many entries to retrieve</param>
/// <returns><c>true</c> if <see cref="entries" /> is correct, <c>false</c> otherwise</returns>
public bool GetOwnOwnConsoles(out List<OwnConsole> entries, ulong start, ulong count)
{
#if DEBUG
@@ -97,6 +110,11 @@ namespace Cicm.Database
}
}
/// <summary>
/// Gets owned console by specified id
/// </summary>
/// <param name="id">Id</param>
/// <returns>Owned console with specified id, <c>null</c> if not found or error</returns>
public OwnConsole GetOwnConsole(int id)
{
#if DEBUG
@@ -126,6 +144,10 @@ namespace Cicm.Database
}
}
/// <summary>
/// Counts the number of owned consoles in the database
/// </summary>
/// <returns>Entries in database</returns>
public long CountOwnOwnConsoles()
{
#if DEBUG
@@ -140,6 +162,12 @@ namespace Cicm.Database
catch { return 0; }
}
/// <summary>
/// Adds a new owned console to the database
/// </summary>
/// <param name="entry">Entry to add</param>
/// <param name="id">ID of added entry</param>
/// <returns><c>true</c> if added correctly, <c>false</c> otherwise</returns>
public bool AddOwnConsole(OwnConsole entry, out long id)
{
#if DEBUG
@@ -168,6 +196,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Updated an owned console in the database
/// </summary>
/// <param name="entry">Updated entry</param>
/// <returns><c>true</c> if updated correctly, <c>false</c> otherwise</returns>
public bool UpdateOwnConsole(OwnConsole entry)
{
#if DEBUG
@@ -191,6 +224,11 @@ namespace Cicm.Database
return true;
}
/// <summary>
/// Removes an owned console from the database
/// </summary>
/// <param name="id">ID of entry to remove</param>
/// <returns><c>true</c> if removed correctly, <c>false</c> otherwise</returns>
public bool RemoveOwnConsole(long id)
{
#if DEBUG

View File

@@ -27,10 +27,15 @@
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
namespace Cicm.Database
{
public partial class Operations
{
/// <summary>
/// Updates opened database to last known version
/// </summary>
/// <returns><c>true</c> if updated correctly, <c>false</c> otherwise</returns>
public bool UpdateDatabase()
{
// Do nothing