73 lines
2 KiB
C#
73 lines
2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data.SqlClient;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace eDosStation
|
|
{
|
|
public class User
|
|
{
|
|
public const string ErrorEPDInUse = "EPD in use";
|
|
|
|
public int PersID { get; set; }
|
|
public string LastName { get; set; }
|
|
public string FirstName { get; set; }
|
|
public string conCode { get; set; }
|
|
public string Language { get; set; }
|
|
public bool? AccessAllow { get; set; }
|
|
public double? Margin { get; set; }
|
|
public int? VisitIDLocked { get; set; }
|
|
public string ReasonNoAccess { get; set; }
|
|
public string UserComment { get; set; }
|
|
|
|
public bool AllOk = false;
|
|
|
|
public bool hasEPD { get; set; }
|
|
|
|
public int Error = 0;
|
|
public string ErrorMessage;
|
|
internal int? activeVisit;
|
|
internal bool? isAgent;
|
|
|
|
public string FullUserName()
|
|
{
|
|
return string.Concat(FirstName, " ", LastName);
|
|
}
|
|
public bool HasMessage ()
|
|
{
|
|
return AccessAllow != true || !string.IsNullOrEmpty(UserComment) || !string.IsNullOrEmpty(ReasonNoAccess);
|
|
}
|
|
|
|
public bool AllowShowTask()
|
|
{
|
|
return AllOk == true && !hasEPD && (VisitIDLocked == null || VisitIDLocked==0);
|
|
}
|
|
|
|
public User()
|
|
{
|
|
SetNotFound();
|
|
Error = 0;
|
|
}
|
|
|
|
public void SetNotFound()
|
|
{
|
|
Error = 0;
|
|
PersID = 0;
|
|
LastName = "Not Found";
|
|
FirstName = "Not Found";
|
|
conCode = "A1";
|
|
Language = "N";
|
|
AccessAllow = false;
|
|
activeVisit = null;
|
|
Margin = 0;
|
|
VisitIDLocked = 0;
|
|
ReasonNoAccess = "Not found";
|
|
UserComment = string.Empty;
|
|
hasEPD = false;
|
|
AllOk = false;
|
|
isAgent = false;
|
|
}
|
|
}
|
|
}
|