132 lines
5.3 KiB
C#
132 lines
5.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Data.OleDb;
|
|
|
|
namespace DatabaseExport
|
|
{
|
|
public class MMEFigures : AbstractOLEDbWrapper
|
|
{
|
|
public long ID { get; }
|
|
|
|
public string TxtShortName { get; }
|
|
|
|
public string TxtDescription { get; }
|
|
|
|
public string TxtRemarks { get; }
|
|
|
|
public DateTime DatRevision { get; }
|
|
|
|
public long IntAuthor { get; }
|
|
|
|
public ushort IntPage { get; }
|
|
|
|
public ushort IntPages { get; }
|
|
|
|
public string TxtImageFile { get; }
|
|
|
|
public long IntVersion { get; }
|
|
|
|
public bool BolExpired { get; }
|
|
|
|
public string TxtSortKey { get; }
|
|
|
|
public bool BitStdPath { get; }
|
|
|
|
public long IntIDStdPath { get; }
|
|
|
|
public string TxtPath { get; }
|
|
|
|
public DateTime Last_Change { get; }
|
|
|
|
public string Last_Change_Text { get; }
|
|
|
|
public string History { get; }
|
|
|
|
public MMEFigures(long id, string txtShortName, string txtDescription, string txtRemarks, DateTime datRevision, long intAuthor,
|
|
ushort intPage, ushort intPages, string txtImageFile, long version, bool bExpired, string txtSortKey,
|
|
bool bitStdPath, long intIDStdPath, string txtPath, DateTime lastChange, string lastChangeText, string history)
|
|
{
|
|
ID = id;
|
|
TxtShortName = txtShortName;
|
|
TxtDescription = txtDescription;
|
|
TxtRemarks = txtRemarks;
|
|
DatRevision = datRevision;
|
|
IntAuthor = intAuthor;
|
|
IntPage = intPage;
|
|
IntPages = intPages;
|
|
TxtImageFile = txtImageFile;
|
|
IntVersion = version;
|
|
BolExpired = bExpired;
|
|
TxtSortKey = txtSortKey;
|
|
BitStdPath = bitStdPath;
|
|
IntIDStdPath = intIDStdPath;
|
|
TxtPath = txtPath;
|
|
Last_Change = lastChange;
|
|
Last_Change_Text = lastChangeText;
|
|
History = history;
|
|
|
|
}
|
|
public static MMEFigures[] GetFigures()
|
|
{
|
|
var figures = new List<MMEFigures>();
|
|
using (var cmd = DbOperations.GetISOCommand())
|
|
{
|
|
cmd.CommandText = "SELECT * FROM MMEFIGURES";
|
|
cmd.CommandType = CommandType.Text;
|
|
try
|
|
{
|
|
using (var ISOReader = cmd.ExecuteReader())
|
|
{
|
|
while (ISOReader.Read())
|
|
{
|
|
try
|
|
{
|
|
var id = Convert.ToInt64(ISOReader["ID"]);
|
|
var txtShortName = ISOReader["txtShortName"].ToString();
|
|
var txtDescription = ISOReader["txtDescription"].ToString();
|
|
var txtRemarks = ISOReader["txtRemarks"].ToString();
|
|
var datRevision = DateTime.MinValue;
|
|
if (!DBNull.Value.Equals(ISOReader["datRevision"]))
|
|
{
|
|
datRevision = (DateTime)ISOReader["datRevision"];
|
|
}
|
|
var intAuthor = Convert.ToInt64(ISOReader["intAuthor"]);
|
|
var intPage = Convert.ToUInt16(ISOReader["intPage"]);
|
|
var intPages = Convert.ToUInt16(ISOReader["intPages"]);
|
|
var txtImageFile = ISOReader["txtImageFile"].ToString();
|
|
var version = Convert.ToInt64(ISOReader["intVersion"]);
|
|
var bExpired = (bool)ISOReader["bolExpired"];
|
|
var txtSortKey = ISOReader["txtSortKey"].ToString();
|
|
var bitStdPath = (bool)ISOReader["bitStdPath"];
|
|
var intIDStdPath = Convert.ToInt64(ISOReader["IntIDStdPath"]);
|
|
var txtPath = ISOReader["txtPath"].ToString();
|
|
var lastChange = DateTime.MinValue;
|
|
if (!DBNull.Value.Equals(ISOReader["LAST_CHANGE"]))
|
|
{
|
|
datRevision = (DateTime)ISOReader["LAST_CHANGE"];
|
|
}
|
|
var lastChangeText = ISOReader["LAST_CHANGE_TEXT"].ToString();
|
|
var history = ISOReader["HISTORY"].ToString();
|
|
figures.Add(new MMEFigures(id, txtShortName, txtDescription, txtRemarks, datRevision, intAuthor, intPage,
|
|
intPages, txtImageFile, version, bExpired, txtSortKey, bitStdPath, intIDStdPath, txtPath, lastChange,
|
|
lastChangeText, history));
|
|
}
|
|
catch (Exception)
|
|
{
|
|
//ignore
|
|
}
|
|
}
|
|
ISOReader.Close();
|
|
}
|
|
}
|
|
finally
|
|
{
|
|
cmd.Connection.Dispose();
|
|
}
|
|
}
|
|
return figures.ToArray();
|
|
}
|
|
}
|
|
}
|