|
using System;
using System.Collections.Generic;
using System.Text;
namespace DocumentBaseLibrary
{
[Serializable]
public class Document
{
int _id;
public int ID
{
get { return _id; }
set { _id = value; }
}
string _title;
public string Title
{
get { return _title; }
set { _title = value; }
}
string _description;
public string Description
{
get { return _description; }
set { _description = value; }
}
string _depositor;
public string Depositor
{
get { return _depositor; }
set { _depositor = value; }
}
Category _category;
public Category Category
{
get { return _category; }
set { _category = value; }
}
Status _status;
public Status Status
{
get { return _status; }
set { _status = value; }
}
DateTime _createdDate;
public DateTime CreatedDate
{
get { return _createdDate; }
set { _createdDate = value; }
}
DateTime _lastUpdatedDate;
public DateTime LastUpdatedDate
{
get { return _lastUpdatedDate; }
set { _lastUpdatedDate = value; }
}
string _note;
public string Note
{
get { return _note; }
set { _note = value; }
}
public override string ToString()
{
return string.Format("{0}, {1}, {2}", ID, Title, Status);
}
public static bool operator ==(Document documentA, Document documentB)
{
if (object.ReferenceEquals(documentA, null) && object.ReferenceEquals(documentB, null)) return true;
if (object.ReferenceEquals(documentA,null) || object.ReferenceEquals(documentB, null)) return false;
if (documentA.ID == documentB.ID) return true;
else return false;
}
public static bool operator !=(Document documentA, Document documentB)
{
if (object.ReferenceEquals(documentA, null) && object.ReferenceEquals(documentB, null)) return false;
if (object.ReferenceEquals(documentA, null) || object.ReferenceEquals(documentB, null)) return true;
if (documentA.ID == documentB.ID) return false;
else return true;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.