2018-08-28 07:58:58 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
2021-05-27 15:30:04 +00:00
|
|
|
|
namespace SharedDatabase.Entities
|
2018-08-28 07:58:58 +00:00
|
|
|
|
{
|
|
|
|
|
|
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;
|
|
|
|
|
|
}
|
2019-03-01 13:16:04 +00:00
|
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
|
{
|
|
|
|
|
|
return string.Format("Name={0} User={1}", Workplace, UserName);
|
|
|
|
|
|
}
|
2018-08-28 07:58:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|