using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GreenTree.Nachtragsmanagement.Core.Domain.Site
{
public class Site : BaseEntity
{
#region Fields
///
/// Userlist
///
private ICollection _users;
///
/// Appendixlist
///
private ICollection _appendices;
///
/// Deviations related to the site
///
private ICollection _deviations;
#endregion
///
/// CustomNumber for identification
///
public string CustomNumber { get; set; }
///
/// Description
///
public string Description { get; set; }
///
/// Beginning of the site
///
public DateTime? Start { get; set; }
///
/// Ending of the site
///
public DateTime? End { get; set; }
///
/// Editable comment
///
public string Comment { get; set; }
///
/// Determines if the site is completely finished
///
public bool Finished { get; set; }
///
/// Users responsible for this site
///
public virtual ICollection Users
{
get { return _users ?? ( _users = new List()); }
protected set { _users = value; }
}
///
/// Appendices related to the site
///
public virtual ICollection Appendices
{
get { return _appendices ?? (_appendices = new List()); }
protected set { _appendices = value; }
}
///
/// Deviations related to the site
///
public virtual ICollection Deviations
{
get { return _deviations ?? (_deviations = new List()); }
protected set { _deviations = value; }
}
#region Helper
///
/// Adds missing deviations and removes not selected deviations
///
/// Site deviations.
public void SetDeviations(ICollection deviations)
{
Deviations = deviations;
}
///
/// Adds missing appendices and removes not selected appendices
///
/// Site appendices.
public void SetAppendices(ICollection appendices)
{
Appendices = appendices;
}
///
/// Adds missing users and removes not selected users
///
/// Site users.
public void SetUsers(ICollection users)
{
Users = users;
}
#endregion
}
}