using System; using System.Collections.Generic; namespace HRM.BO { #region UserAccessType public class UserAccessType : BasicBaseObject { #region Constructor public UserAccessType() { PayrollTypeID = 0; UserID = 0; UserObj = null; // A row nobody approved yet is never live access (see UserAccessTypeMakerChecker_DB_Changes.sql). AccessTypeStatus = EnumAuthStatus.NewNotYetApprove; } #endregion #region Properties public int PayrollTypeID { get; set; } public string Description { get; set; } public int UserID { get; set; } public User UserObj { get; set; } /// /// UserAccessType.Status: Approved (5) = live; NewNotYetApprove (2) = requested, not live yet; /// DeletedNotYetApprove (3) = removal requested, still live until approved. /// public EnumAuthStatus AccessTypeStatus { get; set; } public int? ApprovedBy { get; set; } public DateTime? ApprovedDate { get; set; } #endregion } #endregion #region UserAccessType Service public interface IUserAccessTypeService { UserAccessType Get(int id); List Get(); List GetByUserID(int userID); int Save(UserAccessType item); void Save(List userAccessTypes); void Delete(int id); // Maker-checker (Authentication > User Access Type) /// Maker: records the wanted payroll types of a user as pending changes. Returns how many rows changed. int RequestChange(int userID, List payrollTypeIDs, int makerID); /// Checker: makes every pending change of the user live. void Approve(int userID, int approverID); /// Checker: drops every pending change of the user; access stays as it was. void Reject(int userID); } #endregion }