tbf/TracingDB/Entities/WorkplaceRegistration.cs

57 lines
1.9 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TracingDB.Entities
{
public class WorkplaceRegistration
{
public virtual int Id { get; protected set; }
public virtual string Workplace { get; set; }
public virtual bool Active { get; set; }
public virtual DateTime TimeStamp { get; set; }
public virtual DateTime ValidUntil { get; set; }
public virtual string UserName { get; set; }
public virtual string IPAddress { get; set; }
public virtual string ProcessName { get; set; }
public virtual string WorkstepName { get; set; }
public virtual int Count { get; set; } /// Count of produced parts, not mapped to the database
/// <summary>
/// Default (private) constructor inicializing lists
/// </summary>
protected WorkplaceRegistration()
{
}
/// <summary>
/// Public constructor
/// </summary>
/// <param name="workplace">Workplace name</param>
/// <param name="user">User name</param>
/// <param name="ipAddress">IP address</param>
/// <param name="processName">Process name</param>
/// <param name="workstepName">Workstep name</param>
public WorkplaceRegistration(string workplace, string user, string ipAddress, string processName, string workstepName)
{
this.Workplace = workplace;
this.Active = true;
this.TimeStamp = DateTime.Now;
this.ValidUntil = DateTime.Now + new TimeSpan(8, 0, 0);
this.UserName = user;
this.IPAddress = ipAddress;
this.ProcessName = processName;
this.WorkstepName = workstepName;
}
public override string ToString()
{
return string.Format("Name={0} User={1}", Workplace, UserName);
}
}
}