eDosStationFull/eDosStation_Backup_2025.02.04_07.47.06/User.cs

74 lines
1.9 KiB
C#
Raw Permalink Normal View History

2026-08-18 12:15:26 +02:00
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;
}
}
}