77 lines
2.2 KiB
C#
77 lines
2.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace HRM.BO
|
|
{
|
|
#region UserLogInInfo
|
|
|
|
public class UserLogInInfo : BasicBaseObject
|
|
{
|
|
#region Constructor
|
|
|
|
public UserLogInInfo()
|
|
{
|
|
UserID = 0;
|
|
LoginTime = DateTime.Now;
|
|
PCNumber = string.Empty;
|
|
LogoutTime = null;
|
|
LogoutType = null;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Properties
|
|
|
|
public int UserID { get; set; }
|
|
public DateTime LoginTime { get; set; }
|
|
|
|
public DateTime? LogoutTime { get; set; }
|
|
public EnumLogoutType? LogoutType { get; set; }
|
|
public string PCNumber { get; set; }
|
|
// Client of the login (UserLoginInfo_ClientInfo_DB_Changes.sql).
|
|
// Filled by UserLogInInfoService.Save from the HTTP request when not set.
|
|
public string IPAddress { get; set; }
|
|
/// <summary>Mobile / tab device id; null for a browser login.</summary>
|
|
public string DeviceId { get; set; }
|
|
#endregion
|
|
|
|
#region Audit Trail (display only, not persisted)
|
|
|
|
// Filled only by GetAuditTrail (joined from Users) for the System Audit Trail screen.
|
|
public string LoginID { get; set; }
|
|
public string UserName { get; set; }
|
|
|
|
#endregion
|
|
|
|
//#region Service Factory IUserLogInInfoService : IUserLogInInfoService
|
|
|
|
//internal static IUserLogInInfoService Service
|
|
//{
|
|
// get { return Services.Factory.CreateService<IUserLogInInfoService>(typeof(IUserLogInInfoService)); }
|
|
//}
|
|
|
|
|
|
//#endregion
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region IUserLogInInfo Service
|
|
|
|
public interface IUserLogInInfoService
|
|
{
|
|
UserLogInInfo Get(int id);
|
|
List<UserLogInInfo> Get();
|
|
List<UserLogInInfo> Get(string sLoginID);
|
|
List<UserLogInInfo> GetLastLogin(string sLoginID, bool isWebLogin);
|
|
int Save(UserLogInInfo item);
|
|
List<UserLogInInfo> Get(DateTime dtFrom, DateTime dtTo);
|
|
List<UserLogInInfo> GetLoggedUsers();
|
|
void Delete(int id);
|
|
void UpdateLogoutTime(int nLoginID);
|
|
long NoofLogin(int nUserID);
|
|
List<UserLogInInfo> GetAuditTrail(DateTime dtFrom, DateTime dtTo);
|
|
}
|
|
|
|
#endregion
|
|
} |