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 /// /// Default (private) constructor inicializing lists /// protected WorkplaceRegistration() { } /// /// Public constructor /// /// Workplace name /// User name /// IP address /// Process name /// Workstep name 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); } } }