Compare commits

..

No commits in common. "main" and "dev_mohaimen" have entirely different histories.

874 changed files with 14725 additions and 18863 deletions

View File

@ -1,55 +0,0 @@
/*
ADParameterBasicUserIDNullable_DB_Changes.sql
Why:
ADParameterDA.Insert (HRM.DA/DA/AllowDeduct/ADParameterDA.cs) wrote a hard-coded 1 into
dbo.ADPARAMETERBASIC.USERID. On databases with no USERS.USERID = 1 (MasterProjectDBUATBRAC)
every allowance parameter save fails on FK_ADPARAMETERBASIC_USERS. The insert will stop
writing USERID, so the column has to accept NULL.
What:
Makes dbo.ADPARAMETERBASIC.USERID int NULL. The foreign key FK_ADPARAMETERBASIC_USERS is kept:
it is dropped only for the ALTER and re-created on USERS(USERID). A NULL value is allowed by the
foreign key; any value written stays checked.
Run order:
Run BEFORE deploying the code that removes USERID from the insert (a NOT NULL column with no
value in the INSERT fails). Re-runnable: does nothing when the column is already nullable.
*/
IF COL_LENGTH('dbo.ADPARAMETERBASIC', 'USERID') IS NOT NULL
AND COLUMNPROPERTY(OBJECT_ID('dbo.ADPARAMETERBASIC'), 'USERID', 'AllowsNull') = 0
BEGIN
BEGIN TRANSACTION;
IF OBJECT_ID('dbo.FK_ADPARAMETERBASIC_USERS', 'F') IS NOT NULL
ALTER TABLE dbo.ADPARAMETERBASIC DROP CONSTRAINT FK_ADPARAMETERBASIC_USERS;
ALTER TABLE dbo.ADPARAMETERBASIC ALTER COLUMN USERID int NULL;
ALTER TABLE dbo.ADPARAMETERBASIC WITH NOCHECK
ADD CONSTRAINT FK_ADPARAMETERBASIC_USERS FOREIGN KEY (USERID) REFERENCES dbo.USERS (USERID);
COMMIT TRANSACTION;
PRINT 'dbo.ADPARAMETERBASIC.USERID is now NULL-able (FK_ADPARAMETERBASIC_USERS re-created).';
END
ELSE
PRINT 'dbo.ADPARAMETERBASIC.USERID is already NULL-able (or missing) - nothing to do.';
GO
-- Part 2: USERID carries DEFAULT ((1)), so an INSERT that leaves the column out still writes 1 and
-- fails the same foreign key. Drop that default so the column stays NULL.
DECLARE @dfName sysname;
SELECT @dfName = dc.name
FROM sys.default_constraints dc
JOIN sys.columns c ON c.object_id = dc.parent_object_id AND c.column_id = dc.parent_column_id
WHERE dc.parent_object_id = OBJECT_ID('dbo.ADPARAMETERBASIC') AND c.name = 'USERID';
IF @dfName IS NOT NULL
BEGIN
EXEC ('ALTER TABLE dbo.ADPARAMETERBASIC DROP CONSTRAINT ' + @dfName);
PRINT 'Default constraint ' + @dfName + ' on dbo.ADPARAMETERBASIC.USERID dropped.';
END
ELSE
PRINT 'dbo.ADPARAMETERBASIC.USERID has no default - nothing to do.';
GO

View File

@ -1,59 +0,0 @@
/* ============================================================================
Bad login attempt - client IP address and device id
----------------------------------------------------------------------------
BadLoginAttemptInfoService.Save now records who tried to log in:
PCNumber computer name - reverse DNS of the client IP (falls back to the
IP when there is no name). Can be a fully-qualified host name,
so it is widened to NVARCHAR(255) below if it is narrower.
IPAddress client IP - first X-Forwarded-For entry, else the connection's
remote address. 45 chars fits the longest IPv6 text form.
DeviceId mobile / tab device id (request header X-Device-Id / DeviceId,
or set by the caller); NULL for a browser login.
Run order: run this BEFORE deploying the matching code. BadLoginAttemptInfoDA
.Insert and BadLoginAttemptInfoService.MapObject name both new columns, so
without them every bad-login save and the System Audit Trail's "Bad Login
Attempt" tab fail. Guarded; safe to re-run.
============================================================================ */
IF OBJECT_ID('dbo.BadLoginAttemptInfo') IS NULL
BEGIN
RAISERROR('dbo.BadLoginAttemptInfo does not exist on this database.', 16, 1);
RETURN;
END;
GO
IF COL_LENGTH('dbo.BadLoginAttemptInfo', 'IPAddress') IS NULL
BEGIN
ALTER TABLE dbo.BadLoginAttemptInfo ADD IPAddress NVARCHAR(45) NULL;
END;
GO
IF COL_LENGTH('dbo.BadLoginAttemptInfo', 'DeviceId') IS NULL
BEGIN
ALTER TABLE dbo.BadLoginAttemptInfo ADD DeviceId NVARCHAR(200) NULL;
END;
GO
/* Widen PCNumber to NVARCHAR(255) when it is narrower (keeping its nullability),
so a long host name can not make the insert fail. MAX (-1) is left alone. */
DECLARE @maxLength SMALLINT, @typeName SYSNAME, @isNullable BIT;
SELECT @maxLength = c.max_length, @typeName = t.name, @isNullable = c.is_nullable
FROM sys.columns c
JOIN sys.types t ON t.user_type_id = c.user_type_id
WHERE c.object_id = OBJECT_ID('dbo.BadLoginAttemptInfo')
AND c.name = 'PCNumber';
IF @maxLength IS NOT NULL
AND @maxLength <> -1
AND ( (@typeName IN ('nvarchar', 'nchar') AND @maxLength < 510)
OR (@typeName IN ('varchar', 'char') AND @maxLength < 255) )
BEGIN
DECLARE @sql NVARCHAR(400) =
N'ALTER TABLE dbo.BadLoginAttemptInfo ALTER COLUMN PCNumber NVARCHAR(255) '
+ CASE WHEN @isNullable = 1 THEN N'NULL' ELSE N'NOT NULL' END + N';';
EXEC sp_executesql @sql;
END;
GO

View File

@ -106,9 +106,7 @@ npm test # ng test (Karma, entry src/test.ts)
Both SPAs `ng serve` on 4200, so only one of the two can run at a time.
- `npm run lint` is **broken**: `angular.json` still points at the `@angular-devkit/build-angular:tslint`
builder (with a `tslint.json`), which no longer exists in Angular 19. The `@angular-eslint/*` and `eslint` 9 devDependencies are
installed, but there is no ESLint config file and no `@angular-eslint/builder:lint` target yet, so
wiring ESLint up means adding both.
builder (with a `tslint.json`), which no longer exists in Angular 19. There is no ESLint config.
- `npm test` works, but coverage is nominal — 18 `.spec.ts` files across the whole app. Single spec:
`ng test --include='**/some.component.spec.ts'`.
- There are no `*.Tests.csproj` anywhere in the solution.
@ -438,38 +436,6 @@ calendar's Users dropdown once came back silently empty for exactly this reason.
column: use the pattern in `CalendarItemDA.UserEmailExpression`, which checks `COL_LENGTH` once per process
and builds `COALESCE(EmailAddress, Email)` from whichever columns exist. Server-side SQL errors that the UI
swallows land in `HRM.UI/Log/Error.log` (`ExceptionLog`), the first place to look.
Two places don't follow that pattern yet. `UserDA.Insert` writes only `Email`, so creating a user fails on a
database that lacks it (the pending `UsersEmailColumn_DB_Changes.sql` adds it; its header wrongly says Insert
writes both columns). `UserService.MapObject`
reads only `Email` (the `EmailAddress` line is commented out), so the user list's `email` is blank wherever
addresses live in `EmailAddress`.
Gotcha in user approval: `UserDA.Approve` always sets `Status = Approved` (5), whatever the request was. So
"approving" an `Inactive_Not_Yet_Approve` (9) or `Inactive` (8) user **re-activates** them, and a deactivation
can never actually be approved. The user list labels that action "Re-activate" for this reason; the fix
belongs in the server.
### Authentication pages: maker-checker and audit log
Role, Role Permission, User, User Role and User Access Type (Authentication menu) are **maker-checker**: a
change is saved with an `EnumAuthStatus` (`HRM.BO/HRBasic/Enums.cs`) pending state — `NewNotYetApprove` (2),
`DeletedNotYetApprove` (3), `EditedNotYetApprove` (4), `Inactive_Not_Yet_Approve` (9) — and only becomes
`Approved` (5) / `Rejected` (10) when a second user approves it (`UserAccessTypeService.RequestChange` /
`Approve` / `Reject`, `RoleService` for roles and permissions). Follow that state set for any new
Authentication page rather than inventing a status column.
The **System Audit Log** page (`SystemAuditHistoryService`, `HRM.DA/DA/Users/SystemAuditHistoryDA.cs`) writes
nothing itself: it reads `Z_ROLE`, `Z_ROLEPERMISSION`, `Z_USERS`, `Z_USERROLE`, `Z_USERACCESSTYPE`, which
**database triggers** (`trRole`, `trRolePermission`, `trUsers`, `truserrole`, `trUserAccessType`) fill. Only
`trRole` and `trUserAccessType` are scripted (root `SystemAuditHistory_DB_Changes.sql`); the other three
already exist in the databases and are not in the repo. Triggers must be set-based (approve/reject touch many
rows in one statement). The acting user reaches a trigger through `SESSION_CONTEXT(N'AuditUserID')`, set by
`UserAccessTypeDA` (`sp_set_session_context`) inside the same transaction — do the same when auditing a new
table. That script's stated prerequisite, `UserAccessTypeMakerChecker_DB_Changes.sql`, is not in this repo.
`AuthController.CipherMechanism` (`api/Authentication/CipherMechanism`, Angular `authentication/cipher-engine`)
encrypts a value with the same `Ease.NetCore` cipher used for passwords — another reason that NuGet stays at
1.0.5.
`PayrollTypeID` is the scoping key threaded through most payroll/attendance queries — when adding a
query that returns employee data, check whether existing siblings filter by it. Reading `EmployeeID`
@ -498,9 +464,7 @@ When behavior differs between clients, look for or add a Logic key rather than b
## Branches: one product, many client deployments
**This checkout is not that repo.** It is `HRM-10` (`origin` = `103.197.204.162:3025/CelHRTeam/HRM-10`),
a fresh import whose history starts at one squashed commit (`838b8d4` "first commit"). Since then it
uses ordinary short-lived branches: `main` is the integration branch (PR target), with per-developer
branches (`dev_<name>`, `dev_<name>_<feature>`, `shamim`) merged back into it.
a fresh import with a single branch `main` and a single squashed commit (`838b8d4` "first commit").
None of the older history exists here: every commit hash quoted elsewhere in this file (`c8588ce67`,
`91369150c`, `ac179c03e`, `73f466cd0`, `bfd085e0e`) is from the original `CelHRTeam/cel.hrm` repo, and
`git show`/`git log` recovery commands only work in a clone of that repo, not here.
@ -581,10 +545,8 @@ Schema/proc changes are hand-authored `.sql` scripts named `<Feature>_DB_Changes
each database **manually**. They live in two places and the distinction is the whole point:
- **Repo root** — the *pending* ones. `ls *_DB_Changes.sql` shows what has not been applied yet
Write new scripts here, in the same commit as the code that needs them. The root also holds
generated DB analysis reports (`UnusedTables_<db>.txt`, `TablesWithoutPK_<db>.txt`). They are
input for clean-up decisions, not proof a table is safe to drop: they only scan `HRM.DA/DA` SQL and
DB objects, and `HangFire.*` is used by the library itself.
(at the initial import there were none). Write new scripts here, in the same commit as the code
that needs them.
- **[`db/Script/`](db/Script)** — the archive of shipped ones (`Calendar`, `MenuIcon`,
`AttendanceLeaveSummaryLM`, `TaxParameterEssDeadline`, `PMS_SquareAlign_IDP`, `EmpHistoricalData`).
Read them for precedent — they are the best worked examples of house style — but don't re-run one
@ -697,9 +659,6 @@ What the earlier 19 → 21 upgrade fixed in place, so don't undo it:
under `src/`). Always edit the `.ts`; never the generated `.js`.
- Long-running actions show the shared loading panel: `<app-loading-panel></app-loading-panel>` in the
template plus `loadingPanel.ShowLoadingPanel = true/false` around the call (~395 templates use it).
The flag must be on the injected **`loadingPanelService`** (`hrm-loding panel/loding.panel.service.ts`),
which is what `<app-loading-panel>` reads. `UntilityHandlerService` has a same-named
`ShowLoadingPanel` that nothing renders, so ~10 older components that set it never show a spinner.
Wrap every button/API action that can take a moment, and clear the flag in the error path too.
### App bootstrap and the initial route

View File

@ -1,28 +0,0 @@
/*
EmployeeNoUnique_DB_Changes.sql
Why:
dbo.EMPLOYEE.EMPLOYEENO had no uniqueness guard, so two employees could be saved with the
same Employee No (bulk upload, manual entry, ESS lookups by number all assume it is unique).
What:
Adds unique constraint UQ_EMPLOYEE_EMPLOYEENO on dbo.EMPLOYEE (EMPLOYEENO).
Stops with an error (and changes nothing) if duplicate Employee Nos already exist -
fix those first with the query printed below.
Run order:
Any time; no code depends on it. Re-runnable: does nothing when the constraint exists.
*/
IF EXISTS (SELECT 1 FROM sys.objects WHERE name = 'UQ_EMPLOYEE_EMPLOYEENO' AND parent_object_id = OBJECT_ID('dbo.EMPLOYEE'))
PRINT 'UQ_EMPLOYEE_EMPLOYEENO already exists - nothing to do.';
ELSE IF EXISTS (SELECT EMPLOYEENO FROM dbo.EMPLOYEE GROUP BY EMPLOYEENO HAVING COUNT(*) > 1)
BEGIN
RAISERROR('Duplicate EMPLOYEENO values exist. Find them with: SELECT EMPLOYEENO, COUNT(*) FROM dbo.EMPLOYEE GROUP BY EMPLOYEENO HAVING COUNT(*) > 1', 16, 1);
END
ELSE
BEGIN
ALTER TABLE dbo.EMPLOYEE ADD CONSTRAINT UQ_EMPLOYEE_EMPLOYEENO UNIQUE NONCLUSTERED (EMPLOYEENO);
PRINT 'UQ_EMPLOYEE_EMPLOYEENO added.';
END
GO

View File

@ -24,17 +24,6 @@ namespace HRM.BO
public DateTime AttemptTime { get; set; }
public string PCNumber { get; set; }
// Client of the failed login (BadLoginAttemptInfo_ClientInfo_DB_Changes.sql).
// Filled by BadLoginAttemptInfoService.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; }
// Display only, not persisted: filled by GetAuditTrail (joined from Users)
// for the System Audit Trail screen.
public string LoginID { get; set; }
public string UserName { get; set; }
//#region Service Factory IBadLoginAttemptInfoService : IBadLoginAttemptInfoService
@ -57,11 +46,9 @@ namespace HRM.BO
{
BadLoginAttemptInfo Get(int id);
List<BadLoginAttemptInfo> Get();
void Save(BadLoginAttemptInfo item);
void SaveInThread(BadLoginAttemptInfo item);
int Save(BadLoginAttemptInfo item);
List<BadLoginAttemptInfo> Get(DateTime dtFrom, DateTime dtTo);
void Delete(int id);
List<BadLoginAttemptInfo> GetAuditTrail(DateTime dtFrom, DateTime dtTo);
}
#endregion

View File

@ -28,18 +28,6 @@ namespace HRM.BO
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
@ -70,7 +58,6 @@ namespace HRM.BO
void Delete(int id);
void UpdateLogoutTime(int nLoginID);
long NoofLogin(int nUserID);
List<UserLogInInfo> GetAuditTrail(DateTime dtFrom, DateTime dtTo);
}
#endregion

View File

@ -949,13 +949,6 @@ namespace HRM.BO
DataSet GetBonusBankAdvice(int BonusID, DateTime dBonusMonth, string sEmpID);
DataSet GetBonusPaySlip(int BonusID, DateTime dBonusMonth, string sEmpID);
int Save(BonusProcess item);
BonusProcessAndSaveResult ProcessAndSave(BonusProcessAndSaveRequest request, int payrolltypeid, int userID);
BonusProcessAndSaveResult UploadAndSave(List<BonusProcess.BonusProcessDetail> uploadedRows,
BonusProcessAndSaveRequest request, int payrolltypeid, int userID);
BonusProcessRowTaxResult CalculateRowTax(BonusProcessRowTaxRequest request, int payrolltypeid);
BonusProcessGridRow SaveRow(BonusProcessRowSaveRequest request, int payrolltypeid, int userID);
List<BonusProcessGridRow> ClearTaxAndSave(int bonusProcessID, int payrolltypeid, int userID);
BonusProcessRowRemoveResult RemoveRow(int bonusProcessDetailID, int payrolltypeid);
void Delete(BonusProcess oBonusProcess);
List<BonusProcess> GetProcess(int bonusID, DateTime bonusMonth);
List<BonusProcess> GetProcess(DateTime bonusMonth);

View File

@ -1,96 +0,0 @@
using System;
using System.Collections.Generic;
namespace HRM.BO
{
/// <summary>
/// Bonus Process screen, "Process" button: calculate the bonus (and tax) of these employees and save it
/// in the same request (api/Bonus/processAndSave). Only the header and the employee IDs travel — the
/// browser no longer sends the whole calculated BonusProcess back for a separate Save.
/// </summary>
public class BonusProcessAndSaveRequest
{
public int BonusID { get; set; }
public DateTime BasicMonth { get; set; }
public DateTime PayDate { get; set; }
public DateTime CuttOfDate { get; set; }
public double CurrProcess { get; set; }
public bool IsDisburseWithSalary { get; set; }
public bool IsTaxProcess { get; set; }
public List<int> EmployeeIDs { get; set; }
}
/// <summary>One saved row of the Bonus Process grid, read back from the database.</summary>
public class BonusProcessGridRow
{
public int BonusProcessDetailID { get; set; }
public int BonusProcessID { get; set; }
public int BonusID { get; set; }
public int EmployeeID { get; set; }
public string EmployeeNo { get; set; }
public string Name { get; set; }
public DateTime? JoiningDate { get; set; }
public bool IsConfirmed { get; set; }
public double GrossSalary { get; set; }
public double BasicSalary { get; set; }
public double BonusAmount { get; set; }
public double ChangeBonusAmount { get; set; }
public double TaxAmount { get; set; }
public double ChangeTaxAmount { get; set; }
}
/// <summary>What processAndSave returns: the saved process and its rows.</summary>
public class BonusProcessAndSaveResult
{
public int BonusProcessID { get; set; }
public List<BonusProcessGridRow> Rows { get; set; } = new List<BonusProcessGridRow>();
/// <summary>Employees left out because this bonus was already processed for them this month.</summary>
public List<int> AlreadyProcessedEmployeeIDs { get; set; } = new List<int>();
}
/// <summary>
/// Modify dialog, "Calculate": the tax of one saved row for this bonus amount
/// (api/Bonus/calculateRowTax). Nothing is saved.
/// </summary>
public class BonusProcessRowTaxRequest
{
public int BonusProcessDetailID { get; set; }
public double BonusAmount { get; set; }
}
public class BonusProcessRowTaxResult
{
public int BonusProcessDetailID { get; set; }
public double BonusAmount { get; set; }
public double TaxAmount { get; set; }
}
/// <summary>
/// Modify dialog, "Save": saves one row (api/Bonus/saveRow). With CalculateTax the server works the tax
/// out again from BonusAmount (TaxAmount is ignored); without it TaxAmount is the amount typed in.
/// </summary>
public class BonusProcessRowSaveRequest
{
public int BonusProcessDetailID { get; set; }
public double BonusAmount { get; set; }
public double TaxAmount { get; set; }
public bool CalculateTax { get; set; }
/// <summary>
/// "Edited Tax Amount" (with CalculateTax): the tax the user settled on after seeing the calculated one.
/// Saved as CHANGETAXAMOUNT and on the Tax Deducted line; TAXAMOUNT keeps the calculated tax.
/// Null = use the calculated tax.
/// </summary>
public double? EditedTaxAmount { get; set; }
}
/// <summary>
/// Remove button on a saved row (api/Bonus/removeRow/{id}): what was deleted. ProcessDeleted is true when
/// that was the process's last employee, so the (now empty) BONUSPROCESS header was deleted too.
/// </summary>
public class BonusProcessRowRemoveResult
{
public int BonusProcessDetailID { get; set; }
public int BonusProcessID { get; set; }
public bool ProcessDeleted { get; set; }
}
}

View File

@ -394,20 +394,6 @@ namespace HRM.BO
routerLink = "/authentication/data-permssion",
icon = "pi pi-fw pi-database",
},
new WebMenuItem()
{
uniqueName = "WEB.01.08",
label = "Audit log",
routerLink = "/authentication/system-auditlog",
icon = "pi pi-fw pi-database",
},
new WebMenuItem()
{
uniqueName = "WEB.01.09",
label = "Cipher Engine",
routerLink = "/authentication/cipher-engine",
icon = "pi pi-fw pi-code",
},
}
},

View File

@ -1,67 +0,0 @@
using System;
using System.Collections.Generic;
using Ease.Core.Model;
namespace HRM.BO
{
#region SystemAuditHistory
/// <summary>Which change history the System Audit Log page asks for (one tab each).</summary>
public enum EnumSystemAuditHistory
{
Role = 1,
RolePermission = 2,
User = 3,
UserRole = 4,
UserAccessType = 5
}
/// <summary>
/// One row of a change history, read from the Z_ table of that page
/// (Z_ROLE, Z_ROLEPERMISSION, Z_USERS, Z_USERROLE, Z_USERACCESSTYPE - see
/// SystemAuditHistory_DB_Changes.sql). Fields a history does not have stay null.
/// </summary>
public class SystemAuditHistory : ObjectTemplate
{
#region Constructor
public SystemAuditHistory()
{
}
#endregion
#region Properties
/// <summary>What happened, e.g. "User created", "Role modified", "Access type removed".</summary>
public string AuditType { get; set; }
public DateTime? AuditDate { get; set; }
public string LoginID { get; set; }
public string Name { get; set; }
public string Code { get; set; }
public string UserType { get; set; }
public string RoleName { get; set; }
public string RoleType { get; set; }
public string MenuKey { get; set; }
public string MenuName { get; set; }
public string AccessType { get; set; }
public string Activities { get; set; }
public int? ActionBy { get; set; }
public string ActionByLoginID { get; set; }
public string ActionByName { get; set; }
#endregion
}
#endregion
#region ISystemAuditHistory Service
public interface ISystemAuditHistoryService
{
/// <summary>The change history of one page in a date range (both days inclusive), newest first.</summary>
List<SystemAuditHistory> Get(EnumSystemAuditHistory type, DateTime dtFrom, DateTime dtTo);
}
#endregion
}

View File

@ -13,8 +13,6 @@ namespace HRM.BO
PayrollTypeID = 0;
UserID = 0;
UserObj = null;
// A row nobody approved yet is never live access (see UserAccessTypeMakerChecker_DB_Changes.sql).
AccessTypeStatus = EnumAuthStatus.NewNotYetApprove;
}
#endregion
@ -25,22 +23,9 @@ namespace HRM.BO
public string Description { get; set; }
public int UserID { get; set; }
public User UserObj { get; set; }
/// <summary>
/// UserAccessType.Status: Approved (5) = live; NewNotYetApprove (2) = requested, not live yet;
/// DeletedNotYetApprove (3) = removal requested, still live until approved.
/// </summary>
public EnumAuthStatus AccessTypeStatus { get; set; }
public int? ApprovedBy { get; set; }
public DateTime? ApprovedDate { get; set; }
// Filled only by GetPending (the Pending approvals list), for display.
public string UserName { get; set; }
public string LoginID { get; set; }
/// <summary>Who requested this pending row: CreatedBy for a new access, ModifiedBy for a removal.</summary>
public int MakerID { get; set; }
public string MakerLoginID { get; set; }
/// <summary>When it was requested: CreatedDate for a new access, ModifiedDate for a removal.</summary>
public DateTime? RequestDate { get; set; }
public EnumAuthStatus accessTypeStatus;
public int? ApprovedBy;
public DateTime? ApprovedDate;
#endregion
}
@ -56,16 +41,6 @@ namespace HRM.BO
int Save(UserAccessType item);
void Save(List<UserAccessType> userAccessTypes);
void Delete(int id);
// Maker-checker (Authentication > User Access Type)
/// <summary>Maker: records the wanted payroll types of a user as pending changes. Returns how many rows changed.</summary>
int RequestChange(int userID, List<int> payrollTypeIDs, int makerID);
/// <summary>Checker: makes every pending change of the user live.</summary>
void Approve(int userID, int approverID);
/// <summary>Checker: drops every pending change of the user; access stays as it was.</summary>
void Reject(int userID, int rejecterID);
/// <summary>Every row waiting for approval, of every user, with user, payroll type and maker for display.</summary>
List<UserAccessType> GetPending();
}
#endregion

View File

@ -68,109 +68,6 @@ namespace HRM.BO
void Save(List<UserRole> userRoles, int payrolltypeid);
void Delete(int id);
// Maker-checker (Authentication > User Role Permission). See UserRoleMakerChecker_DB_Changes.sql.
/// <summary>The person's live roles of the subject's role type, and any change waiting for approval.</summary>
UserRoleState GetRoleState(UserRoleSubject subject);
/// <summary>Maker: records the wanted roles as pending requests. Returns how many requests were made.</summary>
int RequestChange(UserRoleChangeRequest request, int makerID);
/// <summary>Checker: makes the subject's pending requests live (creates the login first if needed).</summary>
void Approve(UserRoleSubject subject, int approverID);
/// <summary>Checker: drops the subject's pending requests; live roles stay as they were.</summary>
void Reject(UserRoleSubject subject, int approverID);
/// <summary>Every request waiting for approval, of everyone, with names for display.</summary>
List<UserRoleRequest> GetPending();
}
#endregion
#region User role maker-checker
/// <summary>What a UserRoleRequest asks for.</summary>
public enum EnumUserRoleRequestType
{
Add = 1,
Remove = 2,
}
/// <summary>
/// Whose roles: an Admin user (RoleType Admin, UserID) or a Self Service employee
/// (RoleType Self_Service, EmployeeID + PayrollTypeID; UserID only once the employee has a login).
/// </summary>
public class UserRoleSubject
{
public EnumRoleType RoleType { get; set; }
public int? UserID { get; set; }
public int? EmployeeID { get; set; }
public int? PayrollTypeID { get; set; }
}
/// <summary>Maker's request: the roles (of the subject's role type) the person should have.</summary>
public class UserRoleChangeRequest : UserRoleSubject
{
public UserRoleChangeRequest()
{
RoleIDs = new List<int>();
}
public List<int> RoleIDs { get; set; }
}
/// <summary>
/// One UserRole row as the maker-checker screens show it (not a table of its own). A row waiting for
/// approval is a request: UserRole.Status 2 = give the role (RequestType Add, maker = CreatedBy),
/// Status 3 = take it away (RequestType Remove, maker = ModifiedBy). ID is the UserRoleID.
/// </summary>
public class UserRoleRequest : BasicBaseObject
{
public UserRoleRequest()
{
Status = EnumAuthStatus.NewNotYetApprove;
}
public EnumUserRoleRequestType RequestType { get; set; }
public int RoleID { get; set; }
public EnumRoleType RoleType { get; set; }
public int? UserID { get; set; }
public int? EmployeeID { get; set; }
public int? PayrollTypeID { get; set; }
/// <summary>NewNotYetApprove (2) = waiting, Approved (5), Rejected (10).</summary>
public EnumAuthStatus Status { get; set; }
public int? ApprovedBy { get; set; }
public DateTime? ApprovedDate { get; set; }
// Not database properties: filled for display.
public string RoleName { get; set; }
public string LoginID { get; set; }
public string PersonName { get; set; }
public string EmployeeNo { get; set; }
public string MakerLoginID { get; set; }
}
/// <summary>A person's roles of one role type, as the User Role Permission page shows them.</summary>
public class UserRoleState
{
public UserRoleState()
{
LiveRoleIDs = new List<int>();
Pending = new List<UserRoleRequest>();
}
public EnumRoleType RoleType { get; set; }
public int? UserID { get; set; }
public int? EmployeeID { get; set; }
/// <summary>Self Service: the employee's payroll type.</summary>
public int? PayrollTypeID { get; set; }
public string LoginID { get; set; }
public string PersonName { get; set; }
/// <summary>False for a Self Service employee who has no login yet (one is made when a change is sent).</summary>
public bool HasLogin { get; set; }
/// <summary>The login was made for a change still waiting for approval (Users.Status 2): it cannot sign in yet.</summary>
public bool LoginWaiting { get; set; }
/// <summary>Roles of this role type the person has now (live).</summary>
public List<int> LiveRoleIDs { get; set; }
/// <summary>Requests waiting for approval.</summary>
public List<UserRoleRequest> Pending { get; set; }
}
#endregion

View File

@ -136,7 +136,7 @@ namespace HRM.BO
public int? EmployeeID { get; set; }
public string MobileNo { get; set; }
public string Email { get; set; } //erec
//public string EmailAddress { get; set; }
public string EmailAddress { get; set; }
public string ADloginID { get; set; }
#region Payroll Specific

View File

@ -22,15 +22,15 @@ namespace HRM.DA
{
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
tc.ExecuteNonQuery(
"INSERT INTO ADPARAMETERBASIC(ADParameterID, allowDeductID, isForConfirmOnly, flatAmount, percentOfBasic, percentOfGross, GFFlatAmount, GFPercentOfBasic, GFPercentOfGross, minAmount, maxAmount, isCurrentlyActive, TAXABLEPERCENTAGE, ISTAXABLE, ISTaxProjection, IsDependsOnAttendance, IsDependsOnOTHour,ISDEPENDSONSPECIALHOUR, IsWithException, Periodicity, ALLOWORDEDUCT, GENDER, CreatedBy, CreationDate, PAYROLLTYPEID, LASTACTIVATIONDATE,ENTITLETYPE,PercentOfEarnedBasic,IsFractionateApplicable, TaxProjection)" +
" VALUES(%n, %n, %b, %n, %n, %n, %n, %n, %n, %n, %n, %b, %n, %b, %b, %b, %b, %n, %b, %n, %n, %n, %n, %d, %n, %D, %n, %n, %n,%n)",
"INSERT INTO ADPARAMETERBASIC(ADParameterID, allowDeductID, isForConfirmOnly, flatAmount, percentOfBasic, percentOfGross, GFFlatAmount, GFPercentOfBasic, GFPercentOfGross, minAmount, maxAmount, isCurrentlyActive, TAXABLEPERCENTAGE, ISTAXABLE, ISTaxProjection, IsDependsOnAttendance, IsDependsOnOTHour,ISDEPENDSONSPECIALHOUR, IsWithException, Periodicity, ALLOWORDEDUCT, GENDER, CreatedBy, CreationDate, PAYROLLTYPEID, LASTACTIVATIONDATE,ENTITLETYPE,PercentOfEarnedBasic,IsFractionateApplicable,userid, TaxProjection)" +
" VALUES(%n, %n, %b, %n, %n, %n, %n, %n, %n, %n, %n, %b, %n, %b, %b, %b, %b, %n, %b, %n, %n, %n, %n, %d, %n, %D, %n, %n, %n,%n,%n)",
item.ID, item.AllowDeductID, item.IsForConfirmOnly, item.FlatAmount, item.PercentOfBasic,
item.PercentOfGross, item.GFFlatAmount, item.GFPercentOfBasic, item.GFPercentOfGross, item.MinAmount,
item.MaxAmount, item.IsCurrentlyActive, item.TaxablePercentage, item.IsTaxable, item.IsTaxProjection,
item.IsDependsOnAttendance, item.IsDependsOnOTHour, item.ISDEPENDSONSPECIALHOUR, item.IsWithException,
item.Periodicity, item.AllowOrDeductType, item.Gender, item.CreatedBy, item.CreatedDate,
item.PayrollTypeID, DateTime.Now, item.EntitleType, item.PercentOfEarnedBasic,
item.IsFractionateApplicable, 0);
item.IsFractionateApplicable, 1, 0);
}
internal static void Insert(TransactionContext tc, ADParameter.ADParameterGrade item)

View File

@ -19,9 +19,8 @@ namespace HRM.DA
internal static void Insert(TransactionContext tc, BadLoginAttemptInfo item)
{
tc.ExecuteNonQuery("INSERT INTO BadLoginAttemptInfo(LoginID, AttemptTime, PCNumber, IPAddress, DeviceId)" +
" VALUES(%s, %D, %s, %s, %s)",
item.LoginID, item.AttemptTime, item.PCNumber, item.IPAddress, item.DeviceId);
tc.ExecuteNonQuery("INSERT INTO BadLoginAttemptInfo(SlID, UserID, AttemptTime, PCNumber)" +
" VALUES(%n, %n, %D,%s)", item.ID, item.UserID, item.AttemptTime, item.PCNumber);
}
#endregion
@ -47,20 +46,6 @@ namespace HRM.DA
"select * from BadLoginAttemptInfo where AttemptTime between %D AND %D order by AttemptTime", dtf, dtt);
}
// System Audit Trail: every bad login attempt in the date range (both days
// inclusive), with the user's LoginID / Name, newest first.
internal static IDataReader GetAuditTrail(TransactionContext tc, DateTime dtFrom, DateTime dtTo)
{
string sql = SQLParser.MakeSQL(
@"SELECT a.*, u.LoginID, u.UserName
FROM BadLoginAttemptInfo a
LEFT JOIN Users u ON u.LoginID = a.LoginID
WHERE a.AttemptTime >= %d AND a.AttemptTime < %d
ORDER BY a.AttemptTime DESC",
dtFrom.Date, dtTo.Date.AddDays(1));
return tc.ExecuteReader(sql);
}
#endregion
}
}

View File

@ -56,11 +56,8 @@ namespace HRM.DA
internal static IDataReader GetUserPayrollType(TransactionContext tc, string loginID)
{
// Live access only: a requested access (Status 2) is not live until approved; a requested
// removal (Status 3) stays live until approved.
string sql = SQLParser.MakeSQL(@"SELECT p.* FROM PayrollType p, UserAccessType ua,Users u
where p.PayrollTypeID==ua.PayrollTypeID and u.UserID =ua.UserID and u.LoginID=%s and ua.Status<>%n",
loginID, (int)EnumAuthStatus.NewNotYetApprove);
where p.PayrollTypeID==ua.PayrollTypeID and u.UserID =ua.UserID and u.LoginID=%s", loginID);
return tc.ExecuteReader(sql);
}
@ -71,8 +68,7 @@ namespace HRM.DA
string sql = SQLParser.MakeSQL(@"SELECT * FROM PAYROLLTYPE WHERE PAYROLLTYPEID IN
(SELECT DISTINCT ua.PAYROLLTYPEID FROM USERS u
JOIN USERACCESSTYPE ua ON u.USERID = ua.UserId
WHERE u.EMPLOYEEID=%n AND u.USERTYPE=%n AND ua.Status<>%n)",
employeeId, userType, (int)EnumAuthStatus.NewNotYetApprove);
WHERE u.EMPLOYEEID=%n AND u.USERTYPE=%n)", employeeId, userType);
return tc.ExecuteReader(sql);
}

View File

@ -20,10 +20,9 @@ namespace HRM.DA
internal static void Insert(TransactionContext tc, UserLogInInfo item)
{
string sql = SQLParser.MakeSQL(
@"INSERT INTO UserLoginInfo(SLID, UserID, LoginTime, PCNumber, LogoutTime, LogoutType, IPAddress, DeviceId)
VALUES(%n, %n, %D, %s, %D, %n, %s, %s)",
item.ID, item.UserID, item.LoginTime, item.PCNumber, item.LogoutTime, item.LogoutType,
item.IPAddress, item.DeviceId);
@"INSERT INTO UserLoginInfo(SLID, UserID, LoginTime, PCNumber,LogoutTime,LogoutType)
VALUES(%n, %n, %D,%s, %D,%n)",
item.ID, item.UserID, item.LoginTime, item.PCNumber, item.LogoutTime, item.LogoutType);
tc.ExecuteNonQuery(sql);
}
@ -92,20 +91,6 @@ namespace HRM.DA
dtf, dtt);
}
// System Audit Trail: every login in the date range (both days inclusive),
// with the user's LoginID / Name, newest first.
internal static IDataReader GetAuditTrail(TransactionContext tc, DateTime dtFrom, DateTime dtTo)
{
string sql = SQLParser.MakeSQL(
@"SELECT a.*, u.LoginID, u.UserName
FROM UserLoginInfo a
LEFT JOIN Users u ON u.UserID = a.UserID
WHERE a.LoginTime >= %d AND a.LoginTime < %d
ORDER BY a.LoginTime DESC",
dtFrom.Date, dtTo.Date.AddDays(1));
return tc.ExecuteReader(sql);
}
internal static long NoofLogin(TransactionContext tc, int UserID)
{
string sql = SQLParser.MakeSQL("SELECT Count(*) FROM UserLoginInfo WHERE UserID=%n ", UserID);

View File

@ -2,7 +2,6 @@
using Ease.Core.DataAccess;
using Ease.Core.Utility;
using System;
using System.Collections.Generic;
using System.Data;
@ -33,176 +32,6 @@ namespace HRM.DA
item.UsedProcess, item.PayrollTypeID, item.IsApprove, item.wfstatus);
}
/// <summary>
/// Inserts every detail row in one SqlBulkCopy (10k+ rows), instead of one INSERT per row.
/// Same columns and values as Insert(tc, BonusProcessDetail) below; IDs must already be set.
/// Runs inside the caller's transaction.
/// </summary>
internal static void InsertBulk(TransactionContext tc, List<BonusProcess.BonusProcessDetail> items)
{
if (items == null || items.Count == 0)
return;
// money columns: round like SQL Server does when it converts a number literal to money (4 places)
Func<double, decimal> money = v => Math.Round((decimal)v, 4, MidpointRounding.AwayFromZero);
// column names exactly as in the BONUSPROCESSDETAIL table (bulk copy mapping is case-sensitive)
DataTable table = new DataTable("BONUSPROCESSDETAIL");
table.Columns.Add("BONUSPROCESSDETAILID", typeof(int));
table.Columns.Add("BONUSPROCESSID", typeof(int));
table.Columns.Add("BONUSID", typeof(int));
table.Columns.Add("EMPLOYEEID", typeof(int));
table.Columns.Add("DISBURSEDATE", typeof(DateTime));
table.Columns.Add("BONUSAMOUNT", typeof(decimal));
table.Columns.Add("GROSSSALARY", typeof(decimal));
table.Columns.Add("BASICSALARY", typeof(decimal));
table.Columns.Add("CHANGEBONUSAMOUNT", typeof(decimal));
table.Columns.Add("CHANGETAXAMOUNT", typeof(decimal));
table.Columns.Add("CHANGEADJUSTAMOUNT", typeof(decimal));
table.Columns.Add("CHANGESALARYITEMAMOUNT", typeof(decimal));
table.Columns.Add("CALCULATEDADJUSTAMOUNT", typeof(decimal));
table.Columns.Add("CALCULATEDSALARYITEMAMOUNT", typeof(decimal));
table.Columns.Add("TAXAMOUNT", typeof(decimal));
foreach (BonusProcess.BonusProcessDetail item in items)
{
table.Rows.Add(item.ID, item.BonusProcessID, item.BonusID, item.EmployeeID,
item.BonusMonth.Date, // Insert writes it with %d (date only)
money(item.BonusAmount), money(item.GrossSalary), money(item.BasicSalary),
money(item.ChangeBonusAmount), money(item.ChangeTaxAmount), money(item.ChangeAdjustAmount),
money(item.ChangeSalaryItemAmount), money(item.CalculatedAdjustAmount),
money(item.CalculatedSalaryItemAmount), money(item.TaxAmount));
}
using (Microsoft.Data.SqlClient.SqlBulkCopy bulkCopy = new Microsoft.Data.SqlClient.SqlBulkCopy(
(Microsoft.Data.SqlClient.SqlConnection)tc.Connection, Microsoft.Data.SqlClient.SqlBulkCopyOptions.Default,
(Microsoft.Data.SqlClient.SqlTransaction)tc.Transaction))
{
bulkCopy.BulkCopyTimeout = 6000; // in seconds, as SaveBonusEmpCostCenter
bulkCopy.DestinationTableName = "BONUSPROCESSDETAIL";
foreach (DataColumn column in table.Columns)
bulkCopy.ColumnMappings.Add(column.ColumnName, column.ColumnName);
bulkCopy.WriteToServer(table);
}
}
/// <summary>The saved rows of one bonus process, with the employee columns the Bonus Process grid shows.</summary>
internal static IDataReader GetGridRows(TransactionContext tc, int bonusProcessID)
{
return tc.ExecuteReader(@"SELECT bd.BONUSPROCESSDETAILID, bd.BONUSPROCESSID, bd.BONUSID, bd.EMPLOYEEID,
e.EMPLOYEENO, e.NAME, e.JOININGDATE, e.ISCONFIRMED,
bd.GROSSSALARY, bd.BASICSALARY, bd.BONUSAMOUNT, bd.CHANGEBONUSAMOUNT, bd.TAXAMOUNT, bd.CHANGETAXAMOUNT
FROM BONUSPROCESSDETAIL bd
INNER JOIN EMPLOYEE e ON e.EMPLOYEEID = bd.EMPLOYEEID
WHERE bd.BONUSPROCESSID = %n
ORDER BY e.EMPLOYEENO", bonusProcessID);
}
/// <summary>One saved row (Modify dialog), with the employee columns the grid shows.</summary>
internal static IDataReader GetGridRow(TransactionContext tc, int bonusProcessDetailID)
{
return tc.ExecuteReader(@"SELECT bd.BONUSPROCESSDETAILID, bd.BONUSPROCESSID, bd.BONUSID, bd.EMPLOYEEID,
e.EMPLOYEENO, e.NAME, e.JOININGDATE, e.ISCONFIRMED,
bd.GROSSSALARY, bd.BASICSALARY, bd.BONUSAMOUNT, bd.CHANGEBONUSAMOUNT, bd.TAXAMOUNT, bd.CHANGETAXAMOUNT
FROM BONUSPROCESSDETAIL bd
INNER JOIN EMPLOYEE e ON e.EMPLOYEEID = bd.EMPLOYEEID
WHERE bd.BONUSPROCESSDETAILID = %n", bonusProcessDetailID);
}
/// <summary>One saved row and the header fields the Modify dialog needs (bonus, month, payroll type).</summary>
internal static IDataReader GetRowWithHeader(TransactionContext tc, int bonusProcessDetailID)
{
return tc.ExecuteReader(@"SELECT bd.BONUSPROCESSDETAILID, bd.BONUSPROCESSID, bd.BONUSID, bd.EMPLOYEEID,
bd.CHANGEBONUSAMOUNT, bd.CHANGETAXAMOUNT, bd.TAXAMOUNT,
b.BONUSMONTH, b.PAYROLLTYPEID, b.ISTAXPROCESS
FROM BONUSPROCESSDETAIL bd
INNER JOIN BONUSPROCESS b ON b.BONUSPROCESSID = bd.BONUSPROCESSID
WHERE bd.BONUSPROCESSDETAILID = %n", bonusProcessDetailID);
}
/// <summary>Modify dialog, Save: the amounts of one row.</summary>
internal static void UpdateRowAmounts(TransactionContext tc, int bonusProcessDetailID, double changeBonusAmount,
double changeTaxAmount, double taxAmount, int modifiedBy, DateTime modifiedDate)
{
tc.ExecuteNonQuery(@"UPDATE BONUSPROCESSDETAIL SET CHANGEBONUSAMOUNT = %n, CHANGETAXAMOUNT = %n, TAXAMOUNT = %n,
MODIFIEDBY = %n, MODIFIEDDATE = %D
WHERE BONUSPROCESSDETAILID = %n",
changeBonusAmount, changeTaxAmount, taxAmount, modifiedBy, modifiedDate, bonusProcessDetailID);
}
/// <summary>Clear Tax: the header fields of one bonus process (bonus, month, payroll type, options).</summary>
internal static IDataReader GetProcessHeaderForClearTax(TransactionContext tc, int bonusProcessID)
{
return tc.ExecuteReader(@"SELECT BONUSPROCESSID, BONUSID, BONUSMONTH, PAYROLLTYPEID, ISTAXPROCESS, ISDISBURSEWITHSALARY
FROM BONUSPROCESS
WHERE BONUSPROCESSID = %n", bonusProcessID);
}
/// <summary>
/// Clear Tax: the tax of every row of one bonus process becomes 0 — what the old Clear Tax + Save wrote
/// to BONUSPROCESSDETAIL (only CHANGETAXAMOUNT; TAXAMOUNT, the calculated tax, is kept).
/// </summary>
internal static void ClearTaxOfProcess(TransactionContext tc, int bonusProcessID, int modifiedBy, DateTime modifiedDate)
{
tc.ExecuteNonQuery(@"UPDATE BONUSPROCESSDETAIL SET CHANGETAXAMOUNT = 0, MODIFIEDBY = %n, MODIFIEDDATE = %D
WHERE BONUSPROCESSID = %n",
modifiedBy, modifiedDate, bonusProcessID);
}
/// <summary>
/// Clear Tax: the Tax Deducted line (ITEMCODE = Tax_Deducted, -212) of the bonus tax data (BONUSTEMPIT) of
/// every employee of one bonus process gets THISMONTHAMOUNT = 0 — the old save() merge with a cleared tax.
/// The other lines and columns are not touched.
/// </summary>
internal static void ClearBonusTempTaxOfProcess(TransactionContext tc, int bonusProcessID, int taxDeductedItemCode)
{
tc.ExecuteNonQuery(@"UPDATE BONUSTEMPIT SET THISMONTHAMOUNT = 0
WHERE ITEMCODE = %n
AND EMPLOYEEID IN (SELECT EMPLOYEEID FROM BONUSPROCESSDETAIL WHERE BONUSPROCESSID = %n)",
taxDeductedItemCode, bonusProcessID);
}
/// <summary>
/// Remove (saved row): this employee's bonus tax data (BONUSTEMPIT), only when the process was saved
/// with Calculate Tax — a process without tax wrote no BONUSTEMPIT rows for it.
/// </summary>
internal static void DeleteRowBonusTempTax(TransactionContext tc, int bonusProcessID, int employeeID)
{
tc.ExecuteNonQuery(@"DELETE FROM BONUSTEMPIT
WHERE EMPLOYEEID = %n
AND EXISTS (SELECT 1 FROM BONUSPROCESS WHERE BONUSPROCESSID = %n AND ISTAXPROCESS = 1)",
employeeID, bonusProcessID);
}
/// <summary>Remove (saved row): this employee's cost-center split in this process.</summary>
internal static void DeleteRowCostCenter(TransactionContext tc, int bonusProcessID, int employeeID)
{
tc.ExecuteNonQuery("DELETE FROM BonusEmpCostCenter WHERE BonusProcessID = %n AND EmployeeID = %n",
bonusProcessID, employeeID);
}
/// <summary>Remove (saved row): the row itself.</summary>
internal static void DeleteRow(TransactionContext tc, int bonusProcessDetailID)
{
tc.ExecuteNonQuery("DELETE FROM BONUSPROCESSDETAIL WHERE BONUSPROCESSDETAILID = %n", bonusProcessDetailID);
}
/// <summary>Remove (saved row): how many rows the process still has.</summary>
internal static int CountRows(TransactionContext tc, int bonusProcessID)
{
object count = tc.ExecuteScalar("SELECT COUNT(*) FROM BONUSPROCESSDETAIL WHERE BONUSPROCESSID = %n", bonusProcessID);
return count == null || count == DBNull.Value ? 0 : Convert.ToInt32(count);
}
/// <summary>Remove (saved row): the header of a process that has no rows left, and anything still hanging on it.</summary>
internal static void DeleteEmptyProcess(TransactionContext tc, int bonusProcessID)
{
tc.ExecuteNonQuery("DELETE FROM BonusEmpCostCenter WHERE BonusProcessID = %n", bonusProcessID);
tc.ExecuteNonQuery(@"DELETE FROM BONUSPROCESS WHERE BONUSPROCESSID = %n
AND NOT EXISTS (SELECT 1 FROM BONUSPROCESSDETAIL WHERE BONUSPROCESSID = %n)",
bonusProcessID, bonusProcessID);
}
internal static void Insert(TransactionContext tc, BonusProcess.BonusProcessDetail item)
{
string sql = SQLParser.MakeSQL(
@ -658,19 +487,6 @@ AND BP.PayrollTypeID=%n", emps, FromDate, ToDate, payrollTypeID);
return approved;
}
/// <summary>
/// Bonus Process screen: how many BONUSPROCESS headers this bonus already has in this month (whole month)
/// for this payroll type. Used to stop the same bonus type being processed twice in one month.
/// </summary>
internal static int CountProcessInMonth(TransactionContext tc, int payrolltypeid, int bonusid, DateTime bonusMonth)
{
object count = tc.ExecuteScalar(
"SELECT COUNT(*) FROM BONUSPROCESS WHERE PAYROLLTYPEID = %n AND BONUSID = %n AND BONUSMONTH BETWEEN %d AND %d",
payrolltypeid, bonusid, PayrollGlobalFunctions.PayrollFirstDateOfMonth(bonusMonth),
PayrollGlobalFunctions.PayrollLastDateOfMonth(bonusMonth));
return (count == null || count == DBNull.Value) ? 0 : Convert.ToInt32(count);
}
#endregion
internal static DataSet GetMontlyProdBonus(TransactionContext tc, DateTime dBonusMonth)

View File

@ -785,32 +785,6 @@ namespace HRM.DA
tc.ExecuteNonQuery("UPDATE EMPCONTACT SET presentPOInBangla = %s, presentAddressInBangla = %s, parmanentPOInBangla = %s, permanentAddressInBangla =%s WHERE EMPLOYEEID = %s", employeBanglaInfo[1], employeBanglaInfo[2], employeBanglaInfo[3], employeBanglaInfo[4], employeBanglaInfo[0]);
}
/// <summary>
/// The full Employee rows of the given employees of one payroll type, for any number of employees
/// (10k+). Same result as GetByEmpIDs(tc, empIDs, payrollTypeID), but the IDs go in as ONE
/// varchar(max) parameter and a temp table with a primary key instead of an "IN (1,2,3,...)" list in
/// the SQL text. Needs SQL Server 2016+ (STRING_SPLIT).
/// </summary>
internal static IDataReader GetByEmpIDList(TransactionContext tc, List<int> empIDs, int payrollTypeID)
{
string sql = SQLParser.MakeSQL(@"SET NOCOUNT ON;
IF OBJECT_ID('tempdb..#empListIds') IS NOT NULL DROP TABLE #empListIds;
CREATE TABLE #empListIds (ID int NOT NULL PRIMARY KEY);
INSERT INTO #empListIds (ID) SELECT DISTINCT CONVERT(int, value) FROM STRING_SPLIT(@empIds, ',') WHERE value <> '';
SELECT e.* FROM Employee e
INNER JOIN #empListIds t ON t.ID = e.EMPLOYEEID
WHERE e.PAYROLLTYPEID = %n
ORDER BY e.EmployeeNo;
DROP TABLE #empListIds;", payrollTypeID);
// must be a SqlParameter[]: Ease.Core casts the array to SqlParameter[]
SqlParameter[] parameters =
{
SqlHelperExtension.CreateInParam("@empIds", SqlDbType.VarChar, string.Join(",", empIDs), -1) // varchar(max)
};
return tc.ExecuteReader(CommandType.Text, sql, parameters);
}
internal static IDataReader GetByEmpIDs(TransactionContext tc, string empIDs)
{
string sTableName;

View File

@ -160,19 +160,6 @@ namespace HRM.DA
else return true;
}
/// <summary>
/// Like hasTaxDataInSalaryTemp(tc, employeeId), but only SALARYTEMPIT (a salary processed and not yet
/// finalized) — BONUSTEMPIT is not looked at. Used by the Bonus Process Modify dialog: there the
/// employee's BONUSTEMPIT rows are that same bonus's own tax data, saved by Process.
/// </summary>
internal static bool hasTaxDataInSalaryTempOnly(TransactionContext tc, int employeeId)
{
object isprocessed = tc.ExecuteScalar(@"select count(*) cnt from SALARYTEMPIT WHERE EmployeeID =%n", employeeId);
if (isprocessed == null || isprocessed == DBNull.Value)
return false;
return Convert.ToInt32(isprocessed) > 0;
}
internal static EnumIncomeTaxDataFrom TaxDataFrom(TransactionContext tc, int employeeId)
{
object isprocessed = tc.ExecuteScalar(@"if exists(select * from SALARYTEMPIT where EmployeeID =%n ) select 3

View File

@ -73,8 +73,8 @@ namespace HRM.DA
//" WHERE RoleID = %n", item.Code, item.Name, item.ModifiedBy, item.ModifiedDate, item.Sequence, (int)item.RoleStatus, item.ApproveBy, item.ApproveDate, (int)item.RoleStatus, item.Description, item.ID);
tc.ExecuteNonQuery(
"UPDATE Role SET Code=%s, name = %s, Description = %s, ROLETYPE = %n, Sequence = %n, ApproveBy = %n,ApproveDate=%D,Status=%n , AUTHORIZEDBY=%n, AUTHORIZEDDATE=%D" +
" WHERE RoleID = %n", item.Code, item.Name, item.Description, (int)item.RoleType, item.Sequence, item.ApproveBy, item.ApproveDate,
"UPDATE Role SET Code=%s, name = %s, Sequence = %n, ApproveBy = %n,ApproveDate=%D,Status=%n , AUTHORIZEDBY=%n, AUTHORIZEDDATE=%D" +
" WHERE RoleID = %n", item.Code, item.Name, item.Sequence, item.ApproveBy, item.ApproveDate,
(int)item.RoleStatus, item.ModifiedBy, item.ModifiedDate, item.ID);
}
@ -137,10 +137,8 @@ namespace HRM.DA
//" WHERE r.RoleID= u.roleid and u.userid=%n order by PermissionCode",
//useridID);
// u.Status<>2: a role given but not approved yet is not live (UserRoleMakerChecker_DB_Changes.sql).
return tc.ExecuteReader(@"SELECT distinct r.*, CAST(REPLACE(r.PermissionCode, '.', '') AS int) pcode FROM RolePermission r, UserRole u
WHERE r.RoleID = u.roleid and u.userid = %n and u.Status <> %n order by pcode",
useridID, (int)EnumAuthStatus.NewNotYetApprove);
WHERE r.RoleID = u.roleid and u.userid = %n order by pcode",useridID);
}
internal static IDataReader GetRolePermissionByUserID(TransactionContext tc, int userID, int employeeID)
@ -159,8 +157,7 @@ namespace HRM.DA
//useridID);
return tc.ExecuteReader(@"SELECT distinct r.*, CAST(REPLACE(r.PermissionCode, '.', '') AS int) pcode FROM RolePermission r, UserRole u
WHERE (r.RoleID = u.roleid or r.ROLEID = 12) and u.userid = %n and u.Status <> %n order by pcode",
useridID, (int)EnumAuthStatus.NewNotYetApprove);
WHERE (r.RoleID = u.roleid or r.ROLEID = 12) and u.userid = %n order by pcode", useridID);
}
internal static IDataReader GetRoleActionPermissionByRoleID(TransactionContext tc, int roleID)

View File

@ -131,9 +131,8 @@ namespace HRM.DA
return tc.ExecuteDataSet(
@"select distinct rp.PERMISSIONCODE MenuKey, rp.roleid RoleID from RolePermission rp
inner join UserRole ur on rp.roleID = ur.RoleID
where ur.UserID=%n and rp.STATUS=%n and ur.Status<>%n",
userID, (int)EnumAuthStatus.Approved, (int)EnumAuthStatus.NewNotYetApprove);
// ur.Status<>2: a role given but not approved yet is not live (UserRoleMakerChecker_DB_Changes.sql).
where ur.UserID=%n and rp.STATUS=%n",
userID, (int)EnumAuthStatus.Approved);
}
}
}

View File

@ -1,121 +0,0 @@
using System;
using System.Data;
using Ease.Core.DataAccess;
using HRM.BO;
namespace HRM.DA
{
// Change history of the Authentication pages, read from their Z_ tables
// (SystemAuditHistory_DB_Changes.sql). Every query returns the same columns, so one
// MapObject reads them all: AuditType, AuditDate, LoginID, Name, Code, UserType, RoleName,
// RoleType, MenuKey, MenuName, AccessType, Status, Activities, ActionBy, ActionByLoginID,
// ActionByName. Date range: both days inclusive, newest first.
internal class SystemAuditHistoryDA
{
#region Constructor
private SystemAuditHistoryDA()
{
}
#endregion
#region Get Function
// Z_ROLE keeps a copy of the row. "Update (before)" rows are left out (the "after" row
// shows the change). Who did it: the approver on an approval, else the editor, else the creator.
internal static IDataReader GetRole(TransactionContext tc, DateTime dtFrom, DateTime dtTo)
{
string sql = SQLParser.MakeSQL(
@"SELECT CASE z.AUDITTYPE WHEN 'Inserted' THEN 'Role created'
WHEN 'Deleted' THEN 'Role deleted'
ELSE 'Role modified' END AuditType,
z.AUDITDATE AuditDate, NULL LoginID, z.NAME Name, z.CODE Code, NULL UserType,
NULL RoleName, z.ROLETYPE RoleType, NULL MenuKey, NULL MenuName, NULL AccessType,
z.STATUS Status, NULL Activities, a.ActionBy, u.LoginID ActionByLoginID, u.UserName ActionByName
FROM Z_ROLE z
CROSS APPLY (SELECT CASE WHEN z.AUDITTYPE = 'Deleted' THEN NULL
WHEN z.AUDITTYPE = 'Inserted' THEN z.CREATEDBY
WHEN z.STATUS = %n AND z.APPROVEBY IS NOT NULL THEN z.APPROVEBY
ELSE COALESCE(z.AUTHORIZEDBY, z.CREATEDBY) END ActionBy) a
LEFT JOIN Users u ON u.UserID = a.ActionBy
WHERE z.AUDITTYPE <> 'Update (before)'
AND z.AUDITDATE >= %d AND z.AUDITDATE < %d
ORDER BY z.AUDITDATE DESC",
(int)EnumAuthStatus.Approved, dtFrom.Date, dtTo.Date.AddDays(1));
return tc.ExecuteReader(sql);
}
// Z_ROLEPERMISSION (trigger trRolePermission). Menu name from the uploaded menu
// (ConfigurationAttribute), the same lookup RolePermissionDA.GetRolePerAudit uses.
internal static IDataReader GetRolePermission(TransactionContext tc, DateTime dtFrom, DateTime dtTo)
{
string sql = SQLParser.MakeSQL(
@"SELECT z.audittype AuditType, z.auditdate AuditDate, NULL LoginID, NULL Name, r.Code Code, NULL UserType,
r.Name RoleName, r.RoleType RoleType, z.menukey MenuKey,
(SELECT TOP 1 ca.Value FROM ConfigurationAttribute ca
WHERE ca.AttributeName = 'name'
AND ca.ParentID = (SELECT MAX(ck.ParentID) FROM ConfigurationAttribute ck
WHERE ck.Value = z.menukey AND ck.AttributeName = 'key')) MenuName,
NULL AccessType, z.status Status, z.activities Activities,
z.actionby ActionBy, u.LoginID ActionByLoginID, u.UserName ActionByName
FROM Z_ROLEPERMISSION z
LEFT JOIN Role r ON r.RoleID = z.roleid
LEFT JOIN Users u ON u.UserID = z.actionby
WHERE z.auditdate >= %d AND z.auditdate < %d
ORDER BY z.auditdate DESC",
dtFrom.Date, dtTo.Date.AddDays(1));
return tc.ExecuteReader(sql);
}
// Z_USERS (trigger trUsers).
internal static IDataReader GetUser(TransactionContext tc, DateTime dtFrom, DateTime dtTo)
{
string sql = SQLParser.MakeSQL(
@"SELECT z.audittype AuditType, z.auditdate AuditDate, z.loginid LoginID, z.name Name, NULL Code,
z.usertype UserType, NULL RoleName, NULL RoleType, NULL MenuKey, NULL MenuName, NULL AccessType,
NULL Status, z.activities Activities,
z.actionby ActionBy, u.LoginID ActionByLoginID, u.UserName ActionByName
FROM Z_USERS z
LEFT JOIN Users u ON u.UserID = z.actionby
WHERE z.auditdate >= %d AND z.auditdate < %d
ORDER BY z.auditdate DESC",
dtFrom.Date, dtTo.Date.AddDays(1));
return tc.ExecuteReader(sql);
}
// Z_USERROLE (trigger truserrole): Code / name are the role's.
internal static IDataReader GetUserRole(TransactionContext tc, DateTime dtFrom, DateTime dtTo)
{
string sql = SQLParser.MakeSQL(
@"SELECT z.audittype AuditType, z.auditdate AuditDate, NULL LoginID, NULL Name, z.Code Code, NULL UserType,
z.name RoleName, NULL RoleType, NULL MenuKey, NULL MenuName, NULL AccessType,
NULL Status, z.activities Activities,
z.actionby ActionBy, u.LoginID ActionByLoginID, u.UserName ActionByName
FROM Z_USERROLE z
LEFT JOIN Users u ON u.UserID = z.actionby
WHERE z.auditdate >= %d AND z.auditdate < %d
ORDER BY z.auditdate DESC",
dtFrom.Date, dtTo.Date.AddDays(1));
return tc.ExecuteReader(sql);
}
// Z_USERACCESSTYPE (trigger trUserAccessType).
internal static IDataReader GetUserAccessType(TransactionContext tc, DateTime dtFrom, DateTime dtTo)
{
string sql = SQLParser.MakeSQL(
@"SELECT z.audittype AuditType, z.auditdate AuditDate, z.loginid LoginID, z.name Name, NULL Code,
NULL UserType, NULL RoleName, NULL RoleType, NULL MenuKey, NULL MenuName, z.payrolltype AccessType,
NULL Status, z.activities Activities,
z.actionby ActionBy, u.LoginID ActionByLoginID, u.UserName ActionByName
FROM Z_USERACCESSTYPE z
LEFT JOIN Users u ON u.UserID = z.actionby
WHERE z.auditdate >= %d AND z.auditdate < %d
ORDER BY z.auditdate DESC",
dtFrom.Date, dtTo.Date.AddDays(1));
return tc.ExecuteReader(sql);
}
#endregion
}
}

View File

@ -18,14 +18,8 @@ namespace HRM.DA
internal static void Insert(TransactionContext tc, UserAccessType item)
{
tc.ExecuteNonQuery("INSERT INTO UserAccessType(UserAccessTypeID, PayrollTypeID, UserID, Status," +
" CreatedBy, CreatedDate, ApprovedBy, ApprovedDate)" +
" VALUES(%n, %n, %n, %n, %n, %D, %n, %D)",
item.ID, item.PayrollTypeID, item.UserID, (int)item.AccessTypeStatus,
item.CreatedBy == 0 ? null : item.CreatedBy,
item.CreatedDate == System.DateTime.MinValue ? null : item.CreatedDate,
item.ApprovedBy == 0 ? null : item.ApprovedBy,
item.ApprovedDate == System.DateTime.MinValue ? null : item.ApprovedDate);
tc.ExecuteNonQuery("INSERT INTO UserAccessType(UserAccessTypeID, PayrollTypeID, UserID)" +
" VALUES(%n, %n, %n)", item.ID, item.PayrollTypeID, item.UserID);
}
#endregion
@ -38,43 +32,6 @@ namespace HRM.DA
" WHERE UserAccessTypeID=%n", item.PayrollTypeID, item.UserID, item.ID);
}
// Maker asks to take a live access away: it stays live (Status 3) until approved.
internal static void RequestRemoval(TransactionContext tc, int userAccessTypeID, int makerID, System.DateTime requestDate)
{
tc.ExecuteNonQuery("UPDATE UserAccessType SET Status=%n, ModifiedBy=%n, ModifiedDate=%D" +
" WHERE UserAccessTypeID=%n",
(int)EnumAuthStatus.DeletedNotYetApprove, makerID, requestDate, userAccessTypeID);
}
// Checker approves: requested removals go, requested accesses become live.
internal static void Approve(TransactionContext tc, int userID, int approverID, System.DateTime approveDate)
{
tc.ExecuteNonQuery("DELETE FROM UserAccessType WHERE UserID=%n AND Status=%n",
userID, (int)EnumAuthStatus.DeletedNotYetApprove);
tc.ExecuteNonQuery("UPDATE UserAccessType SET Status=%n, ApprovedBy=%n, ApprovedDate=%D" +
" WHERE UserID=%n AND Status=%n",
(int)EnumAuthStatus.Approved, approverID, approveDate, userID, (int)EnumAuthStatus.NewNotYetApprove);
}
// Tells trigger trUserAccessType who is making the change (SystemAuditHistory_DB_Changes.sql),
// for the rows it cannot tell from the row itself (a reject, a deleted row). Lasts for this
// connection only; a pooled connection is reset before it is used again. Skipped on a
// SQL Server older than 2016, which has no session context.
internal static void SetAuditUser(TransactionContext tc, int userID)
{
tc.ExecuteNonQuery("IF OBJECT_ID('sys.sp_set_session_context') IS NOT NULL" +
" EXEC sp_set_session_context @key = N'AuditUserID', @value = %n", userID);
}
// Checker rejects: requested accesses go, requested removals stay live as before.
internal static void Reject(TransactionContext tc, int userID)
{
tc.ExecuteNonQuery("DELETE FROM UserAccessType WHERE UserID=%n AND Status=%n",
userID, (int)EnumAuthStatus.NewNotYetApprove);
tc.ExecuteNonQuery("UPDATE UserAccessType SET Status=%n WHERE UserID=%n AND Status=%n",
(int)EnumAuthStatus.Approved, userID, (int)EnumAuthStatus.DeletedNotYetApprove);
}
#endregion
#region Get Function
@ -96,29 +53,7 @@ namespace HRM.DA
return tc.ExecuteReader("SELECT * FROM UserAccessType WHERE UserID=%n", UserID);
}
// Every row waiting for approval, of every user (Pending approvals list).
internal static IDataReader GetPending(TransactionContext tc)
{
return tc.ExecuteReader(@"SELECT ua.*, p.Description PayrollTypeName, u.LoginID UserLoginID, u.UserName UserFullName,
mk.LoginID MakerLoginID
FROM UserAccessType ua
JOIN PayrollType p ON p.PayrollTypeID = ua.PayrollTypeID
JOIN Users u ON u.UserID = ua.UserID
LEFT JOIN Users mk ON mk.UserID = CASE WHEN ua.Status=%n THEN ua.ModifiedBy ELSE ua.CreatedBy END
WHERE ua.Status IN (%n, %n)
ORDER BY u.UserName, p.Description",
(int)EnumAuthStatus.DeletedNotYetApprove,
(int)EnumAuthStatus.NewNotYetApprove, (int)EnumAuthStatus.DeletedNotYetApprove);
}
// Names of the payroll types a pending approval of this user will newly give access to.
internal static IDataReader GetPendingNewDescriptions(TransactionContext tc, int userID)
{
return tc.ExecuteReader(@"SELECT p.Description FROM UserAccessType ua
JOIN PayrollType p ON p.PayrollTypeID = ua.PayrollTypeID
WHERE ua.UserID=%n AND ua.Status=%n",
userID, (int)EnumAuthStatus.NewNotYetApprove);
}
#endregion

View File

@ -25,16 +25,16 @@ namespace HRM.DA
string sql = SQLParser.MakeSQL(@"INSERT INTO Users(USERID, COMPUTERNAME, APPROVEDCOMPUTERNAME, USERTYPE, STATUS," +
" LOCKEDWORKSTATION,PASSWORDHINT,LOGINID,USERNAME,PASSWORD, ApprovedBy," +
" ApprovedDate, EMPLOYEEID,ChangePasswordAtNextLogon,NeverExpire,MacAddress,IPAddress," +
" ExpireDate,CreatedDate,OwnerID, reason, authorizedBy, authorizedDate , Email)" +
" ExpireDate,CreatedDate,OwnerID, reason, authorizedBy, authorizedDate, EmailAddress, Email)" +
" VALUES(%n, %s, %s, %n, %n, " +
"%s, %s, %s, %s, %s, %n, " +
" %d, %n, %n, %n, %s, %s, " +
" %D, %D, %n, %s, %n, %D , %s)" ,
" %D, %D, %n, %s, %n, %D, %u, %s)" ,
item.ID, item.ComputerName, item.ApprovedComputerName, item.UserType, item.UserStatus,
item.LockedWorkStation, item.PasswordHints, item.LoginID, item.UserName, item.Password, item.ApprovedBy,
item.ApprovedDate, item.EmployeeID, item.ChangePasswordAtNextLogon, item.NeverExpire, item.MacAddress, item.IPAddress,
item.ExpireDate, item.CreatedDate,item.ParentID, item.Reason, item.AuthorizedBy, item.AuthorizedDate,
string.IsNullOrWhiteSpace(item.EmailAddress) ? null : item.EmailAddress.Trim(),
string.IsNullOrWhiteSpace(item.Email) ? null : item.Email.Trim());
tc.ExecuteNonQuery(sql);
@ -49,12 +49,12 @@ namespace HRM.DA
string sql = SQLParser.MakeSQL(@"UPDATE Users SET COMPUTERNAME=%s, APPROVEDCOMPUTERNAME=%s, USERTYPE=%n, LOCKEDWORKSTATION=%s, " +
" LOGINID=%s, USERNAME=%s,PASSWORD=%s, PASSWORDHINT=%s, ApprovedBy=%n, ApprovedDate=%D, EMPLOYEEID=%n, " +
" ChangePasswordAtNextLogon=%n, NeverExpire=%n, MacAddress = %s, IPAddress = %s , " +
" ExpireDate = %D, Status = %n, reason = %s, authorizedBy = %n, authorizedDate = %D, Email = %s " +
" ExpireDate = %D, Status = %n, reason = %s, authorizedBy = %n, authorizedDate = %D, EmailAddress = %u " +
" WHERE UserID=%n", item.ComputerName, item.ApprovedComputerName, item.UserType, item.LockedWorkStation,
item.LoginID, item.UserName, item.Password, item.PasswordHints, item.ApprovedBy, DataReader.GetNullValue(item.ApprovedDate), item.EmployeeID,
item.ChangePasswordAtNextLogon, item.NeverExpire, item.MacAddress, item.IPAddress,
DataReader.GetNullValue(item.ExpireDate), item.UserStatus, item.Reason, item.AuthorizedBy, DataReader.GetNullValue(item.AuthorizedDate), item.Email,
item.ID);
DataReader.GetNullValue(item.ExpireDate), item.UserStatus, item.Reason, item.AuthorizedBy, DataReader.GetNullValue(item.AuthorizedDate),
string.IsNullOrWhiteSpace(item.EmailAddress) ? null : item.EmailAddress.Trim(), item.ID);
tc.ExecuteNonQuery(sql);
}
@ -95,18 +95,11 @@ namespace HRM.DA
item.ParentID, item.UserStatus, item.ApprovedBy, item.ApprovedDate, item.ComputerName,
item.ApprovedComputerName, DataReader.GetNullValue(item.ExpireDate),item.UserStatus, item.ID);
}
// User Role Permission maker-checker: switches a waiting employee login on (or records its status).
internal static void UpdateStatus(TransactionContext tc, int userID, EnumAuthStatus status, int approvedBy, DateTime approvedDate)
{
tc.ExecuteNonQuery("UPDATE Users SET Status = %n, ApprovedBy=%n, ApprovedDate=%D WHERE UserID = %n",
(int)status, approvedBy, approvedDate, userID);
}
internal static void Approve(TransactionContext tc, User item)
{
tc.ExecuteNonQuery("UPDATE Users SET Status = %n, ApprovedBy=%n, ApprovedDate=%D,ComputerName=%s,ApprovedComputerName=%s," +
" ExpireDate=%D WHERE UserID = %n",
item.UserStatus, item.ApprovedBy, item.ApprovedDate, item.ComputerName,
EnumAuthStatus.Approved, item.ApprovedBy, item.ApprovedDate, item.ComputerName,
item.ApprovedComputerName, DataReader.GetNullValue(item.ExpireDate), item.ID);
}
#endregion
@ -250,8 +243,8 @@ namespace HRM.DA
{
return tc.ExecuteReader(@"SELECT u.* FROM Users u
WHERE u.UserType=%n AND u.UserID IN
(SELECT ua.UserID FROM UserAccessType ua WHERE ua.PayrollTypeID=%n AND ua.Status<>%n)",
type, payrollTypeID, (int)EnumAuthStatus.NewNotYetApprove);
(SELECT ua.UserID FROM UserAccessType ua WHERE ua.PayrollTypeID=%n)",
type, payrollTypeID);
}
internal static IDataReader GetAll(TransactionContext tc)

View File

@ -72,9 +72,7 @@ namespace HRM.DA
}
return tc.ExecuteReader(
@"SELECT ur.*, u.LOGINID LoginID, u.USERNAME UserName,R.Name RoleName, u.EmployeeID employeeID,
(SELECT e.PayrollTypeID FROM Employee e WHERE e.EmployeeID = u.EmployeeID) EmpPayrollTypeID
FROM UserRole ur,[Users] u, Role R
@"SELECT ur.*, u.LOGINID LoginID, u.USERNAME UserName,R.Name RoleName FROM UserRole ur,[Users] u, Role R
WHERE ur.RoleID=r.RoleID and u.UserID =ur.UserID %q order by u.LoginID,R.Name", sqlClause);
}
@ -146,111 +144,6 @@ namespace HRM.DA
tc.ExecuteNonQuery("DELETE FROM UserRole WHERE UserID=%n", nUserID);
}
#region Maker-checker (Authentication > User Role Permission, UserRoleMakerChecker_DB_Changes.sql)
// UserRole.Status: Approved (5) = live; NewNotYetApprove (2) = given, not live until approved;
// DeletedNotYetApprove (3) = being taken away, still live until approved.
// Maker gives a role: it waits for approval (Status 2). CreatedBy is the maker.
internal static void InsertPending(TransactionContext tc, int userRoleID, int roleID, int userID,
int makerID, DateTime requestDate)
{
tc.ExecuteNonQuery(
"INSERT INTO UserRole(UserRoleID, RoleID, UserID, EventDate, CreatedBy, Status, ComputerName, ApprovedComputerName)" +
" VALUES(%n, %n, %n, %D, %n, %n, %s, %s)",
userRoleID, roleID, userID, requestDate, makerID, (int)EnumAuthStatus.NewNotYetApprove, "", "");
}
// Every change below touches ONE UserRole row (by UserRoleID): the audit trigger dbo.truserrole
// handles a single row only, and a multi-row UPDATE fails inside it (Msg 512).
// Maker takes a live role away: it stays live (Status 3) until approved. ModifiedBy is the maker.
internal static void RequestRemoval(TransactionContext tc, int userRoleID, int makerID, DateTime requestDate)
{
tc.ExecuteNonQuery(
"UPDATE UserRole SET Status=%n, ModifiedBy=%n, ModifiedDate=%D WHERE UserRoleID=%n",
(int)EnumAuthStatus.DeletedNotYetApprove, makerID, requestDate, userRoleID);
}
// Checker approves a given role: it becomes live. AuthorizedBy / AuthorizedDate are the checker.
internal static void ApproveRow(TransactionContext tc, int userRoleID, int approverID, DateTime approveDate)
{
tc.ExecuteNonQuery(
"UPDATE UserRole SET Status=%n, AuthorizedBy=%n, AuthorizedDate=%D WHERE UserRoleID=%n",
(int)EnumAuthStatus.Approved, approverID, approveDate, userRoleID);
}
// Checker rejects a removal: the role stays live as before.
internal static void RestoreRow(TransactionContext tc, int userRoleID)
{
tc.ExecuteNonQuery("UPDATE UserRole SET Status=%n WHERE UserRoleID=%n",
(int)EnumAuthStatus.Approved, userRoleID);
}
// Checker approves a removal, or rejects a given role: the row goes.
internal static void DeleteRow(TransactionContext tc, int userRoleID)
{
tc.ExecuteNonQuery("DELETE FROM UserRole WHERE UserRoleID=%n", userRoleID);
}
// Inside the maker's write transaction: counts the user's changes of one role type waiting for approval
// and keeps that range locked until commit, so a second maker sending at the same moment waits here
// and then sees the first change (instead of making a second pending change).
internal static int CountPendingLocked(TransactionContext tc, int userID, EnumRoleType roleType)
{
object o = tc.ExecuteScalar(
"SELECT COUNT(*) FROM UserRole WITH (UPDLOCK, HOLDLOCK)" +
" WHERE UserID=%n AND Status IN (%n, %n) AND RoleID IN (SELECT RoleID FROM Role WHERE RoleType=%n)",
userID, (int)EnumAuthStatus.NewNotYetApprove, (int)EnumAuthStatus.DeletedNotYetApprove, (int)roleType);
return o == null || o == DBNull.Value ? 0 : Convert.ToInt32(o);
}
// Same idea for a Self Service employee with no login yet: counts the employee's logins and keeps them
// locked, so two makers cannot both create a login for the same employee.
internal static int CountEmployeeLoginsLocked(TransactionContext tc, int employeeID)
{
object o = tc.ExecuteScalar(
"SELECT COUNT(*) FROM Users WITH (UPDLOCK, HOLDLOCK) WHERE EmployeeID=%n AND UserType=%n",
employeeID, (int)EnumUserType.Employee);
return o == null || o == DBNull.Value ? 0 : Convert.ToInt32(o);
}
internal static int CountByUser(TransactionContext tc, int userID)
{
object o = tc.ExecuteScalar("SELECT COUNT(*) FROM UserRole WHERE UserID=%n", userID);
return o == null || o == DBNull.Value ? 0 : Convert.ToInt32(o);
}
// UserRole rows with role, person and maker for the maker-checker screens. pendingOnly: only rows
// waiting for approval (Status 2 / 3). userID / roleType narrow it to one person's roles of one type.
internal static IDataReader GetForMakerChecker(TransactionContext tc, bool pendingOnly, int? userID, EnumRoleType? roleType)
{
string clause = "";
if (pendingOnly)
clause += SQLParser.MakeSQL(" AND ur.Status IN (%n, %n)",
(int)EnumAuthStatus.NewNotYetApprove, (int)EnumAuthStatus.DeletedNotYetApprove);
if (userID.HasValue)
clause += SQLParser.MakeSQL(" AND ur.UserID=%n", userID.Value);
if (roleType.HasValue)
clause += SQLParser.MakeSQL(" AND r.RoleType=%n", (int)roleType.Value);
return tc.ExecuteReader(
@"SELECT ur.UserRoleID, ur.RoleID, ur.UserID, ur.Status, ur.CreatedBy, ur.EventDate,
ur.ModifiedBy, ur.ModifiedDate, r.Name RoleName, r.RoleType,
u.LoginID, COALESCE(e.Name, u.UserName) PersonName, u.EmployeeID,
e.EmployeeNo, e.PayrollTypeID, mk.LoginID MakerLoginID
FROM UserRole ur
JOIN Role r ON r.RoleID = ur.RoleID
JOIN Users u ON u.UserID = ur.UserID
LEFT JOIN Employee e ON e.EmployeeID = u.EmployeeID
LEFT JOIN Users mk ON mk.UserID = CASE WHEN ur.Status = %n THEN ur.ModifiedBy ELSE ur.CreatedBy END
WHERE 1 = 1 %q
ORDER BY PersonName, r.Name",
(int)EnumAuthStatus.DeletedNotYetApprove, clause);
}
#endregion
internal static void Update(TransactionContext tc, int id, EnumStatus status)
{
tc.ExecuteNonQuery("UPDATE UserRole SET Status = %n,AuthorizedBy=%n,AuthorizedDate=%D WHERE UserID = %n",

View File

@ -16,11 +16,9 @@ namespace HRM.DA
private void MapObject(BadLoginAttemptInfo oBadLoginAttemptInfo, DataReader oReader)
{
base.SetObjectID(oBadLoginAttemptInfo, oReader.GetInt32("SlID").Value);
oBadLoginAttemptInfo.LoginID = oReader.GetString("LoginID");
oBadLoginAttemptInfo.UserID = oReader.GetInt32("UserID", 0);
oBadLoginAttemptInfo.AttemptTime = oReader.GetDateTime("AttemptTime").Value;
oBadLoginAttemptInfo.PCNumber = oReader.GetString("PCNumber");
oBadLoginAttemptInfo.IPAddress = oReader.GetString("IPAddress");
oBadLoginAttemptInfo.DeviceId = oReader.GetString("DeviceId");
}
protected override T CreateObject<T>(DataReader oReader)
@ -127,58 +125,19 @@ namespace HRM.DA
return BadLoginAttemptInfos;
}
public List<BadLoginAttemptInfo> GetAuditTrail(DateTime dtFrom, DateTime dtTo)
{
List<BadLoginAttemptInfo> items = new List<BadLoginAttemptInfo>();
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataReader dr = new DataReader(BadLoginAttemptInfoDA.GetAuditTrail(tc, dtFrom, dtTo));
while (dr.Read())
{
BadLoginAttemptInfo item = this.CreateObject<BadLoginAttemptInfo>(dr);
item.LoginID = dr.GetString("LoginID");
item.UserName = dr.GetString("UserName");
items.Add(item);
}
dr.Close();
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return items;
}
public void Save(BadLoginAttemptInfo oBadLoginAttemptInfo)
public int Save(BadLoginAttemptInfo oBadLoginAttemptInfo)
{
TransactionContext tc = null;
try
{
// IP / device id come from the request (only reachable here when Save runs on
// the request thread; SaveInThread captures them before it leaves it). The
// computer name is a reverse-DNS lookup of that IP, done here because it can
// take a moment and SaveInThread runs this off the request thread.
CaptureRequestInfo(oBadLoginAttemptInfo);
if (string.IsNullOrWhiteSpace(oBadLoginAttemptInfo.PCNumber))
oBadLoginAttemptInfo.PCNumber = ClientRequestInfo.ResolveComputerName(oBadLoginAttemptInfo.IPAddress);
tc = TransactionContext.Begin(true);
int id = tc.GenerateID("BadLoginAttemptInfo", "SlID");
base.SetObjectID(oBadLoginAttemptInfo, id);
BadLoginAttemptInfoDA.Insert(tc, oBadLoginAttemptInfo);
tc.End();
return oBadLoginAttemptInfo.ID;
}
catch (Exception e)
{
@ -193,30 +152,6 @@ namespace HRM.DA
}
}
public void SaveInThread(BadLoginAttemptInfo oBadLoginAttemptInfo)
{
// Read the request NOW: by the time the thread runs, the request may be over.
CaptureRequestInfo(oBadLoginAttemptInfo);
System.Threading.Thread saveThread = new System.Threading.Thread(() => Save(oBadLoginAttemptInfo))
{
IsBackground = true
};
saveThread.Start();
}
/// <summary>
/// Fills IPAddress and DeviceId from the current request, keeping whatever the caller
/// already set (e.g. the mobile login knows the DeviceID from its request body).
/// </summary>
private static void CaptureRequestInfo(BadLoginAttemptInfo oBadLoginAttemptInfo)
{
if (string.IsNullOrWhiteSpace(oBadLoginAttemptInfo.IPAddress))
oBadLoginAttemptInfo.IPAddress = ClientRequestInfo.GetIPAddress();
if (string.IsNullOrWhiteSpace(oBadLoginAttemptInfo.DeviceId))
oBadLoginAttemptInfo.DeviceId = ClientRequestInfo.GetDeviceId();
}
public void Delete(int id)
{

View File

@ -343,11 +343,13 @@ namespace HRM.DA
if (oBank.Code ==string.Empty)
oBank.Code = GlobalFunctionService.GetMaxCode(tc, "banks", "Code");
oBank.CreatedBy = 1;
oBank.CreatedDate = DateTime.Now;
BankDA.Insert(tc, oBank);
}
else
{
oBank.ModifiedBy = 1;
oBank.ModifiedDate = DateTime.Now;
BankDA.Update(tc, oBank);
}

View File

@ -1,111 +0,0 @@
using System;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
namespace HRM.DA
{
/// <summary>
/// Who is on the other end of the current HTTP request: IP address, device id
/// (mobile / tab) and computer name.
///
/// Services in HRM.DA are created with <c>new</c>, not through DI, so they read the
/// request through the one <see cref="IHttpContextAccessor"/> that Startup hands to
/// <see cref="Configure"/>. Read it on the request thread only: once the request
/// has finished (e.g. inside a background save thread) there is no context left.
///
/// Note <c>Environment.MachineName</c> / <c>Dns.GetHostName()</c> are the name of
/// the web SERVER, never the user's computer.
/// </summary>
public static class ClientRequestInfo
{
/// <summary>Headers a mobile / tab app may send its device id in (first one found wins).</summary>
private static readonly string[] DeviceIdHeaders = { "X-Device-Id", "DeviceId", "DeviceID", "Device-Id" };
/// <summary>A reverse-DNS lookup that has no answer can hang for seconds; never wait longer than this.</summary>
private static readonly TimeSpan HostLookupTimeout = TimeSpan.FromSeconds(2);
private static IHttpContextAccessor _accessor;
/// <summary>Called once from Startup.Configure.</summary>
public static void Configure(IHttpContextAccessor accessor)
{
_accessor = accessor;
}
/// <summary>The current request, or null outside a request (background thread, console job).</summary>
private static HttpContext Current => _accessor?.HttpContext;
/// <summary>
/// The client's IP: the first X-Forwarded-For entry when behind a proxy / load balancer
/// (the same rule as the login rate limiter in Startup), else the socket's remote address.
/// </summary>
public static string GetIPAddress()
{
HttpContext context = Current;
if (context == null)
return null;
string forwarded = context.Request.Headers["X-Forwarded-For"].FirstOrDefault();
if (!string.IsNullOrWhiteSpace(forwarded))
{
string first = forwarded.Split(',')[0].Trim();
if (first != string.Empty)
return first;
}
IPAddress remote = context.Connection.RemoteIpAddress;
if (remote == null)
return null;
if (remote.IsIPv4MappedToIPv6)
remote = remote.MapToIPv4();
return remote.Equals(IPAddress.IPv6Loopback)
? IPAddress.Loopback.ToString() // "::1" -> "127.0.0.1"
: remote.ToString();
}
/// <summary>The device id a mobile / tab app sent as a request header, or null (browser).</summary>
public static string GetDeviceId()
{
HttpContext context = Current;
if (context == null)
return null;
foreach (string header in DeviceIdHeaders)
{
string value = context.Request.Headers[header].FirstOrDefault();
if (!string.IsNullOrWhiteSpace(value))
return value.Trim();
}
return null;
}
/// <summary>
/// The client's computer name by reverse DNS of its IP. Works on a company network
/// whose DNS registers workstations; otherwise (internet, mobile data) there is no
/// name and the IP itself is returned. Blocks for at most <see cref="HostLookupTimeout"/>,
/// so call it off the request thread where possible.
/// </summary>
public static string ResolveComputerName(string ipAddress)
{
if (string.IsNullOrWhiteSpace(ipAddress) || !IPAddress.TryParse(ipAddress, out IPAddress ip))
return ipAddress;
if (IPAddress.IsLoopback(ip))
return Environment.MachineName; // the user is on the server itself
try
{
Task<IPHostEntry> lookup = Dns.GetHostEntryAsync(ip);
if (lookup.Wait(HostLookupTimeout) && !string.IsNullOrWhiteSpace(lookup.Result?.HostName))
return lookup.Result.HostName;
}
catch (Exception)
{
// No PTR record / DNS unreachable: fall back to the IP.
}
return ipAddress;
}
}
}

View File

@ -19,8 +19,6 @@ namespace HRM.DA
oUserLogInInfo.UserID = oReader.GetInt32("UserID", 0);
oUserLogInInfo.LoginTime = oReader.GetDateTime("LoginTime").Value;
oUserLogInInfo.PCNumber = oReader.GetString("PCNumber");
oUserLogInInfo.IPAddress = oReader.GetString("IPAddress");
oUserLogInInfo.DeviceId = oReader.GetString("DeviceId");
if (oReader.GetDateTime("LogoutTime") != null)
oUserLogInInfo.LogoutTime = Convert.ToDateTime(oReader.GetString("LogoutTime"));
oUserLogInInfo.LogoutType = oReader.GetString("LogoutType") == null
@ -219,39 +217,6 @@ namespace HRM.DA
return UserLogInInfos;
}
public List<UserLogInInfo> GetAuditTrail(DateTime dtFrom, DateTime dtTo)
{
List<UserLogInInfo> items = new List<UserLogInInfo>();
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataReader dr = new DataReader(UserLogInInfoDA.GetAuditTrail(tc, dtFrom, dtTo));
while (dr.Read())
{
UserLogInInfo item = this.CreateObject<UserLogInInfo>(dr);
item.LoginID = dr.GetString("LoginID");
item.UserName = dr.GetString("UserName");
items.Add(item);
}
dr.Close();
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return items;
}
public long NoofLogin(int nUserID)
{
long nCount = 0;
@ -282,10 +247,6 @@ namespace HRM.DA
TransactionContext tc = null;
try
{
// Before the transaction: the computer-name lookup can take a moment.
if (oUserLogInInfo.IsNew)
FillClientInfo(oUserLogInInfo);
tc = TransactionContext.Begin(true);
if (oUserLogInInfo.IsNew)
{
@ -319,7 +280,6 @@ namespace HRM.DA
{
if (oUserLogInInfo.IsNew)
{
FillClientInfo(oUserLogInInfo);
UserLogInInfoDA.Insert(tc, oUserLogInInfo);
}
else UserLogInInfoDA.Update(tc, oUserLogInInfo);
@ -340,31 +300,6 @@ namespace HRM.DA
/// <summary>
/// Fills IPAddress and DeviceId from the current HTTP request, keeping whatever the
/// caller already set (e.g. the mobile login knows the DeviceID from its request body).
/// Call it on the request thread BEFORE handing the login to a background thread
/// (UserService.SaveLoginfo): once the request is over there is nothing left to read.
/// </summary>
public static void CaptureRequestInfo(UserLogInInfo oUserLogInInfo)
{
if (string.IsNullOrWhiteSpace(oUserLogInInfo.IPAddress))
oUserLogInInfo.IPAddress = ClientRequestInfo.GetIPAddress();
if (string.IsNullOrWhiteSpace(oUserLogInInfo.DeviceId))
oUserLogInInfo.DeviceId = ClientRequestInfo.GetDeviceId();
}
/// <summary>
/// IP / device id from the request (when still reachable), then the computer name:
/// reverse DNS of that IP, or the IP itself when the network has no name for it.
/// </summary>
private static void FillClientInfo(UserLogInInfo oUserLogInInfo)
{
CaptureRequestInfo(oUserLogInInfo);
if (string.IsNullOrWhiteSpace(oUserLogInInfo.PCNumber))
oUserLogInInfo.PCNumber = ClientRequestInfo.ResolveComputerName(oUserLogInInfo.IPAddress);
}
public void Delete(int id)
{
//Not Needed

View File

@ -495,60 +495,6 @@ namespace HRM.DA
}
}
/// <summary>
/// A copy of CalculateTax for the Bonus Process Modify dialog (one employee, after Process has already
/// saved). The only difference: the "salary processed and not yet finalized" check looks at SALARYTEMPIT
/// only, not at BONUSTEMPIT — after Process the employee's BONUSTEMPIT rows are this same bonus's own
/// tax data, so CalculateTax would always refuse. A salary in the middle of its process still stops it.
/// CalculateTax itself is unchanged and still used by Process, Upload and CalculateBonusTax.
/// </summary>
public void CalculateTaxForModify(List<BonusProcess.BonusProcessDetail> bprocesdetails, List<Employee> oEmployees, Bonus oBonus, int payrolltypeid)
{
if (_payrolltype == null)
_payrolltype = new PayrollTypeService().Get(payrolltypeid);
if (_parameters == null)
_parameters = new BonusParameterService().Get(EnumStatus.Regardless, payrolltypeid);
if (_payrolltype.TaxParamID == null) throw new ServiceException("Current year Tax paramter setup not found.");
TaxParameter oparamter = new TaxParameterService().Get((int)_payrolltype.TaxParamID);
List<ADParameter> oParams = new ADParameterService().Get(EnumStatus.Regardless, EnumAllowOrDeduct.Allowance, _payrolltype.ID);
List<IncomeTax> oTaxes = new IncomeTaxService().Get(EnumIncomeTaxDataFrom.ProcessTempData, _payrolltype.ID);
double nTaxAmount = 0;
int nCount = 0;
// salary only (SALARYTEMPIT); the employee's own bonus tax rows (BONUSTEMPIT) do not stop a Modify
IncomeTaxService taxService = new IncomeTaxService();
bool salaryProcessed = oEmployees.Any(e => e != null && taxService.hasTaxDataInSalaryTempOnly(e.ID));
if (salaryProcessed == true)
{
throw new ServiceException("Current month salary is processed and not yet finalized. Tax calculation "
+ " is not allowed middle of this process. You have to Undo or finalize the salary to calculate tax.");
}
TaxCalculator oCalculator = new TaxCalculator((int)_payrolltype.TaxParamID, _payrolltype.ID);
oCalculator.TaxParameter = oparamter;
oCalculator.payrolltype = _payrolltype;
foreach (BonusProcess.BonusProcessDetail item in bprocesdetails)
{
nCount++;
oCalculator.Employee = oEmployees.FirstOrDefault(x => x.ID == item.EmployeeID);
if (item.BonusParam == null)
{
item.BonusParam = new BonusParameterService().GetApplicableParameter(item.Employee, (int)item.Employee.GradeID, _parameters, oBonus.ID);
}
if (item.ChangeBonusAmount > 0)
{
List<TaxRawItem> oTaxRowItems = new List<TaxRawItem>();
oTaxRowItems.Add(TaxRawItem.Create(oBonus.Name, item.ChangeBonusAmount, enumIncomeTaxItemType.Bonus, item.BonusID));
nTaxAmount = 0;
item.IncomeTaxcoll = oCalculator.CalculateBonus(oTaxRowItems, item.BonusParam, ref nTaxAmount, oParams, oTaxes);
item.TaxAmount = nTaxAmount;
item.ChangeTaxAmount = nTaxAmount;
}
}
}
public void UndoTax(BonusProcess oProcessedItems, List<Employee> oEmployees, Bonus oBonus)
{
if (_payrolltype.TaxParamID == null) throw new ServiceException("Current year Tax paramter setup not found.");

View File

@ -903,694 +903,6 @@ namespace HRM.DA
}
}
/// <summary>
/// Bonus Process screen, "Process" button: calculate the bonus (and tax) of the given employees and
/// save it in the same call — there is no separate Save step any more. Does on the server what the
/// screen used to do in three requests (BonusProcess, the tax-merge step of save(), saveBonusProcess):
/// 1. checks: bonus not approved, inputs present; employees this bonus was already processed for this
/// month are left out (the screen already leaves them out and lists them);
/// 2. CalculateBonus — the same BonusCalculator.CalCulate the old Process button called;
/// 3. tax merge — the same rule save() applied in the browser, now for every row;
/// 4. save — the same rows Save(BonusProcess) writes, in ONE transaction (all or nothing), with the
/// detail rows inserted by one bulk copy instead of one INSERT each;
/// 5. returns the saved rows, read back from the database.
/// </summary>
public BonusProcessAndSaveResult ProcessAndSave(BonusProcessAndSaveRequest request, int payrolltypeid, int userID)
{
if (request == null)
throw new ServiceException("Nothing to process.");
if (request.BonusID <= 0)
throw new ServiceException("Please select a bonus.");
if (request.EmployeeIDs == null || request.EmployeeIDs.Count == 0)
throw new ServiceException("Please select employee for the proces");
if (request.CurrProcess <= 0)
throw new ServiceException("Currently Process For Basic must be greater than zero.");
PayrollType payrollType = new PayrollTypeService().Get(payrolltypeid);
if (payrollType == null)
throw new ServiceException("Payroll type not found.");
DateTime bonusMonth = payrollType.NextPayProcessDate;
// 1. checks
if (this.IsApproved(request.BonusID, bonusMonth, payrolltypeid))
throw new ServiceException("selected Bonus is already process and Approved");
this.CheckAlreadyProcessedInMonth(request.BonusID, bonusMonth, payrolltypeid);
BonusProcessAndSaveResult result = new BonusProcessAndSaveResult();
HashSet<int> alreadyProcessed = new HashSet<int>(
(this.GetBonusDetails(payrolltypeid, request.BonusID, bonusMonth) ?? new List<BonusProcess.BonusProcessDetail>())
.Select(x => x.EmployeeID));
List<int> empIDs = new List<int>();
foreach (int id in request.EmployeeIDs.Distinct())
{
if (alreadyProcessed.Contains(id)) result.AlreadyProcessedEmployeeIDs.Add(id);
else empIDs.Add(id);
}
if (empIDs.Count == 0)
throw new ServiceException("The selected bonus is already processed for all the selected employees.");
List<Employee> employees = new EmployeeService().GetByEmpIDList(empIDs, payrolltypeid);
if (employees.Count == 0)
throw new ServiceException("Selected employees not found in the current payroll type.");
// 2. calculate (bonus, and tax when IsTaxProcess and not disbursed with salary)
BonusProcess oProcess = this.CalculateBonus(payrolltypeid, employees, request.BonusID, request.BasicMonth,
request.PayDate, request.CuttOfDate, request.CurrProcess, request.IsDisburseWithSalary, request.IsTaxProcess);
if (oProcess == null || oProcess.BonusProcessDetails == null || oProcess.BonusProcessDetails.Count == 0)
throw new ServiceException("There are no data to save");
// 3. tax merge: the bonus head's tax line carries the bonus amount, the Tax Deducted line the tax
if (request.IsTaxProcess)
ApplyTaxMerge(oProcess, employees, payrollType, request.BonusID);
// 4. save — header as saveBonusProcess set it, then the same rows Save(BonusProcess) writes
oProcess.PayrollTypeID = payrolltypeid;
oProcess.DisburseDate = request.PayDate;
oProcess.IsTaxProcess = request.IsTaxProcess;
oProcess.IsDisburseWithSalary = request.IsDisburseWithSalary;
oProcess.CreatedBy = userID;
oProcess.CreatedDate = DateTime.Today;
SaveNewProcess(oProcess);
// 5. what was saved
result.BonusProcessID = oProcess.ID;
result.Rows = this.GetGridRows(oProcess.ID);
return result;
}
/// <summary>
/// Bonus Process screen, "Upload Data": the rows read from the bonus Excel file (employee + amount,
/// RegularDataUploadService.GetBonusData) are saved in the same request — what used to be upload →
/// (Tax Re-calculate) → Save, now on the server in one go:
/// 1. checks: bonus selected, pay date, not approved; every employee in the current payroll type and
/// only once in the file; employees this bonus was already processed for this month are left out;
/// 2. with IsTaxProcess, the tax of every row (the same CalculateTax "Tax Re-calculate" ran) and the
/// save() tax merge; without it the amounts are saved as they are in the file;
/// 3. the same save as the Process button (one transaction, all or nothing);
/// 4. returns the saved rows, read back from the database.
/// The header is filled the way the screen filled it after an upload (bonus month and basic month =
/// the next pay process month, disburse date = pay date).
/// </summary>
public BonusProcessAndSaveResult UploadAndSave(List<BonusProcess.BonusProcessDetail> uploadedRows,
BonusProcessAndSaveRequest request, int payrolltypeid, int userID)
{
if (request == null || request.BonusID <= 0)
throw new ServiceException("Please select a bonus.");
if (request.PayDate == DateTime.MinValue)
throw new ServiceException("Please select the pay date.");
if (uploadedRows == null || uploadedRows.Count == 0)
throw new ServiceException("No employee found in the uploaded file.");
PayrollType payrollType = new PayrollTypeService().Get(payrolltypeid);
if (payrollType == null)
throw new ServiceException("Payroll type not found.");
DateTime bonusMonth = payrollType.NextPayProcessDate;
// 1. checks
if (this.IsApproved(request.BonusID, bonusMonth, payrolltypeid))
throw new ServiceException("selected Bonus is already process and Approved");
this.CheckAlreadyProcessedInMonth(request.BonusID, bonusMonth, payrolltypeid);
List<string> problems = new List<string>();
var otherPayroll = uploadedRows.Where(x => x.Employee != null && x.Employee.PayrollTypeID != payrolltypeid)
.Select(x => x.Employee.EmployeeNo).Distinct().ToList();
if (otherPayroll.Count > 0)
problems.Add("Not in the current payroll type: " + string.Join(", ", otherPayroll));
var duplicates = uploadedRows.GroupBy(x => x.EmployeeID).Where(g => g.Count() > 1)
.Select(g => g.First().Employee?.EmployeeNo ?? g.Key.ToString()).ToList();
if (duplicates.Count > 0)
problems.Add("More than once in the file: " + string.Join(", ", duplicates));
var negative = uploadedRows.Where(x => x.BonusAmount < 0).Select(x => x.Employee?.EmployeeNo ?? x.EmployeeID.ToString()).ToList();
if (negative.Count > 0)
problems.Add("Negative amount: " + string.Join(", ", negative));
if (problems.Count > 0)
throw new ServiceException("Nothing was saved. " + string.Join(" | ", problems));
BonusProcessAndSaveResult result = new BonusProcessAndSaveResult();
HashSet<int> alreadyProcessed = new HashSet<int>(
(this.GetBonusDetails(payrolltypeid, request.BonusID, bonusMonth) ?? new List<BonusProcess.BonusProcessDetail>())
.Select(x => x.EmployeeID));
BonusProcess oProcess = new BonusProcess();
oProcess.BonusProcessDetails = new List<BonusProcess.BonusProcessDetail>();
oProcess.BonusID = request.BonusID;
oProcess.BonusMonth = bonusMonth;
oProcess.BasicOnMonth = bonusMonth;
oProcess.DisburseDate = request.PayDate;
oProcess.IsTaxProcess = request.IsTaxProcess;
oProcess.IsDisburseWithSalary = request.IsDisburseWithSalary;
oProcess.PayrollTypeID = payrolltypeid;
oProcess.CreatedBy = userID;
oProcess.CreatedDate = DateTime.Today;
List<Employee> employees = new List<Employee>();
foreach (BonusProcess.BonusProcessDetail row in uploadedRows)
{
if (alreadyProcessed.Contains(row.EmployeeID))
{
result.AlreadyProcessedEmployeeIDs.Add(row.EmployeeID);
continue;
}
row.BonusID = request.BonusID;
row.BonusMonth = bonusMonth;
oProcess.BonusProcessDetails.Add(row);
if (row.Employee != null) employees.Add(row.Employee);
}
if (oProcess.BonusProcessDetails.Count == 0)
throw new ServiceException("The selected bonus is already processed for all the employees in the file.");
// 2. tax (as "Tax Re-calculate" did) and the save() merge
if (request.IsTaxProcess)
{
Bonus obonus = new BonusService().Get(request.BonusID);
new BonusCalculator().CalculateTax(oProcess.BonusProcessDetails, employees, obonus, payrolltypeid);
ApplyTaxMerge(oProcess, employees, payrollType, request.BonusID);
}
// 3. save
SaveNewProcess(oProcess);
// 4. what was saved
result.BonusProcessID = oProcess.ID;
result.Rows = this.GetGridRows(oProcess.ID);
return result;
}
/// <summary>
/// The tax-merge rule the screen's save() applied: on every row the bonus head's tax line
/// (TaxMergeMaster of this bonus) carries the bonus amount and the Tax Deducted line the tax.
/// </summary>
private void ApplyTaxMerge(BonusProcess oProcess, List<Employee> employees, PayrollType payrollType, int bonusID)
{
// a row with no bonus gets no tax lines (CalculateTax skips it), so only rows with a bonus need them
if (oProcess.BonusProcessDetails.Any(x => x.ChangeBonusAmount > 0 && (x.IncomeTaxcoll == null || x.IncomeTaxcoll.Count == 0)))
throw new ServiceException("Tax Calculation not yet done");
if (payrollType.TaxParamID == null)
throw new ServiceException("Current year Tax paramter setup not found.");
TaxMergeMaster mitem = new TaxMergeMasterService().Get(payrollType.ID, (int)payrollType.TaxParamID,
EnumTaxMergeType.Bonus, bonusID);
if (mitem == null)
throw new ServiceException("Bonus head not found in the income tax Grouping");
Dictionary<int, Employee> empByID = employees.GroupBy(x => x.ID).ToDictionary(g => g.Key, g => g.First());
foreach (BonusProcess.BonusProcessDetail detail in oProcess.BonusProcessDetails)
{
if (detail.IncomeTaxcoll == null || detail.IncomeTaxcoll.Count == 0)
continue; // no bonus, no tax lines
IncomeTax bonusLine = detail.IncomeTaxcoll.Find(y => y.ItemGroup == mitem.ItemGroup && y.ItemID == mitem.ItemID);
if (bonusLine == null)
{
Employee emp;
empByID.TryGetValue(detail.EmployeeID, out emp);
throw new ServiceException("Income tax amount not found in the collection"
+ (emp != null ? " (" + emp.EmployeeNo + " " + emp.Name + ")" : ""));
}
bonusLine.ThisMonthAmount = detail.ChangeBonusAmount;
IncomeTax taxLine = detail.IncomeTaxcoll.Find(y => y.ItemGroup == EnumIncomeTaxItemGroup.Tax_Deducted);
if (taxLine != null)
taxLine.ThisMonthAmount = detail.ChangeTaxAmount;
}
}
/// <summary>
/// Saves a new bonus process in ONE transaction: the header, every detail row (one bulk copy), the
/// bonus tax data (BonusITTempData) and the employee cost-center split — the rows Save(BonusProcess)
/// writes for a new process. Sets the IDs on oProcess and its details.
/// </summary>
private void SaveNewProcess(BonusProcess oProcess)
{
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin(true);
int processID = tc.GenerateID("BONUSPROCESS", "BONUSPROCESSID");
base.SetObjectID(oProcess, processID);
BonusProcessDA.Insert(tc, oProcess);
int detailID = tc.GenerateID("BONUSPROCESSDETAIL", "BonusProcessDetailID");
List<IncomeTax> incometaxes = new List<IncomeTax>();
foreach (BonusProcess.BonusProcessDetail detail in oProcess.BonusProcessDetails)
{
base.SetObjectID(detail, detailID++);
detail.BonusProcessID = oProcess.ID;
// IncomeTaxcoll null means tax process not required
if (detail.IncomeTaxcoll != null && detail.IncomeTaxcoll.Count > 0)
incometaxes.AddRange(detail.IncomeTaxcoll);
}
BonusProcessDA.InsertBulk(tc, oProcess.BonusProcessDetails);
if (incometaxes.Count > 0)
new IncomeTaxService().SaveBulk(tc, incometaxes, EnumIncomeTaxDataFrom.BonusITTempData);
SaveBonusEmpCostCenter(tc, oProcess);
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
}
/// <summary>The saved rows of one bonus process, as the Bonus Process grid shows them.</summary>
public List<BonusProcessGridRow> GetGridRows(int bonusProcessID)
{
List<BonusProcessGridRow> rows = new List<BonusProcessGridRow>();
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataReader dr = new DataReader(BonusProcessDA.GetGridRows(tc, bonusProcessID));
while (dr.Read())
rows.Add(MapGridRow(dr));
dr.Close();
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return rows;
}
private static BonusProcessGridRow MapGridRow(DataReader dr)
{
return new BonusProcessGridRow
{
BonusProcessDetailID = dr.GetInt32("BONUSPROCESSDETAILID", 0),
BonusProcessID = dr.GetInt32("BONUSPROCESSID", 0),
BonusID = dr.GetInt32("BONUSID", 0),
EmployeeID = dr.GetInt32("EMPLOYEEID", 0),
EmployeeNo = dr.GetString("EMPLOYEENO", string.Empty),
Name = dr.GetString("NAME", string.Empty),
JoiningDate = dr.GetDateTime("JOININGDATE"),
IsConfirmed = dr.GetBoolean("ISCONFIRMED", false),
GrossSalary = dr.GetDouble("GROSSSALARY", 0),
BasicSalary = dr.GetDouble("BASICSALARY", 0),
BonusAmount = dr.GetDouble("BONUSAMOUNT", 0),
ChangeBonusAmount = dr.GetDouble("CHANGEBONUSAMOUNT", 0),
TaxAmount = dr.GetDouble("TAXAMOUNT", 0),
ChangeTaxAmount = dr.GetDouble("CHANGETAXAMOUNT", 0),
};
}
/// <summary>One saved row of the Bonus Process grid (after a Modify-dialog save).</summary>
public BonusProcessGridRow GetGridRow(int bonusProcessDetailID)
{
BonusProcessGridRow row = null;
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataReader dr = new DataReader(BonusProcessDA.GetGridRow(tc, bonusProcessDetailID));
if (dr.Read())
row = MapGridRow(dr);
dr.Close();
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return row;
}
#region Modify dialog (one row at a time)
/// <summary>A saved bonus row and the header fields the Modify dialog needs.</summary>
private class ModifyRow
{
public int BonusProcessDetailID;
public int BonusProcessID;
public int BonusID;
public int EmployeeID;
public double TaxAmount;
public DateTime BonusMonth;
public int PayrollTypeID;
}
/// <summary>
/// Loads a saved row for the Modify dialog and refuses it when it is not the current payroll type's
/// or the bonus is already approved (the same rule as the Process button).
/// </summary>
private ModifyRow GetRowForModify(int bonusProcessDetailID, int payrolltypeid)
{
ModifyRow row = null;
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataReader dr = new DataReader(BonusProcessDA.GetRowWithHeader(tc, bonusProcessDetailID));
if (dr.Read())
{
row = new ModifyRow
{
BonusProcessDetailID = dr.GetInt32("BONUSPROCESSDETAILID", 0),
BonusProcessID = dr.GetInt32("BONUSPROCESSID", 0),
BonusID = dr.GetInt32("BONUSID", 0),
EmployeeID = dr.GetInt32("EMPLOYEEID", 0),
TaxAmount = dr.GetDouble("TAXAMOUNT", 0),
BonusMonth = dr.GetDateTime("BONUSMONTH", DateTime.MinValue),
PayrollTypeID = dr.GetInt32("PAYROLLTYPEID", 0),
};
}
dr.Close();
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
if (row == null)
throw new ServiceException("Bonus row not found. Please process the bonus again.");
if (row.PayrollTypeID != payrolltypeid)
throw new ServiceException("This bonus row does not belong to the current payroll type.");
if (this.IsApproved(row.BonusID, row.BonusMonth, payrolltypeid))
throw new ServiceException("selected Bonus is already process and Approved");
return row;
}
/// <summary>
/// The tax of one row for this bonus amount — the same BonusCalculator.CalculateTax that
/// "Tax Re-calculate" (CalculateBonusTax) runs, for one employee. Returns the detail with TaxAmount,
/// ChangeTaxAmount and IncomeTaxcoll filled in.
/// </summary>
private BonusProcess.BonusProcessDetail CalculateTaxFor(ModifyRow row, double bonusAmount, int payrolltypeid)
{
Employee emp = new EmployeeService().Get(row.EmployeeID);
if (emp == null)
throw new ServiceException("Employee not found.");
BonusProcess.BonusProcessDetail detail = new BonusProcess.BonusProcessDetail();
detail.BonusID = row.BonusID;
detail.EmployeeID = row.EmployeeID;
detail.BonusMonth = row.BonusMonth;
detail.ChangeBonusAmount = bonusAmount;
detail.Employee = emp;
Bonus obonus = new BonusService().Get(row.BonusID);
// CalculateTaxForModify: CalculateTax, except that this employee's own (already saved) bonus tax rows
// do not block it — only an unfinalized salary does
new BonusCalculator().CalculateTaxForModify(new List<BonusProcess.BonusProcessDetail> { detail },
new List<Employee> { emp }, obonus, payrolltypeid);
return detail;
}
/// <summary>Modify dialog, "Calculate": the tax for this bonus amount. Nothing is saved.</summary>
public BonusProcessRowTaxResult CalculateRowTax(BonusProcessRowTaxRequest request, int payrolltypeid)
{
if (request == null || request.BonusProcessDetailID <= 0)
throw new ServiceException("Please select a bonus row.");
if (request.BonusAmount < 0)
throw new ServiceException("Bonus amount can not be negative.");
ModifyRow row = GetRowForModify(request.BonusProcessDetailID, payrolltypeid);
BonusProcess.BonusProcessDetail detail = CalculateTaxFor(row, request.BonusAmount, payrolltypeid);
return new BonusProcessRowTaxResult
{
BonusProcessDetailID = row.BonusProcessDetailID,
BonusAmount = request.BonusAmount,
TaxAmount = detail.ChangeTaxAmount,
};
}
/// <summary>
/// Modify dialog, "Save": saves ONE row — what Save(BonusProcess) did for every row after
/// "Tax Re-calculate", now for one employee, in one transaction:
/// - BONUSPROCESSDETAIL: ChangeBonusAmount, ChangeTaxAmount (and TaxAmount when the tax is calculated);
/// - this employee's BonusITTempData (BONUSTEMPIT) rows: deleted and written again, with the bonus
/// head's line carrying the bonus amount and the Tax Deducted line the tax (the save() merge rule).
/// With CalculateTax the tax is worked out again here (the amount the browser sent is not trusted);
/// without it the typed tax is used and the employee's existing tax rows are updated, as the old
/// screen did when a tax was typed into the grid and saved without recalculating.
/// </summary>
public BonusProcessGridRow SaveRow(BonusProcessRowSaveRequest request, int payrolltypeid, int userID)
{
if (request == null || request.BonusProcessDetailID <= 0)
throw new ServiceException("Please select a bonus row.");
if (request.BonusAmount < 0)
throw new ServiceException("Bonus amount can not be negative.");
if (!request.CalculateTax && request.TaxAmount < 0)
throw new ServiceException("Tax amount can not be negative.");
if (request.CalculateTax && request.EditedTaxAmount.HasValue && request.EditedTaxAmount.Value < 0)
throw new ServiceException("Edited tax amount can not be negative.");
ModifyRow row = GetRowForModify(request.BonusProcessDetailID, payrolltypeid);
double bonusAmount = request.BonusAmount;
double changeTaxAmount;
double taxAmount = row.TaxAmount; // the calculated tax; kept when a tax is typed in
List<IncomeTax> taxLines = null;
if (request.CalculateTax)
{
BonusProcess.BonusProcessDetail detail = CalculateTaxFor(row, bonusAmount, payrolltypeid);
// the user's "Edited Tax Amount" wins over the calculated one; TAXAMOUNT keeps the calculated tax
changeTaxAmount = request.EditedTaxAmount.HasValue ? request.EditedTaxAmount.Value : detail.ChangeTaxAmount;
taxAmount = detail.TaxAmount;
taxLines = detail.IncomeTaxcoll;
}
else
{
changeTaxAmount = request.TaxAmount;
List<IncomeTax> existing = new IncomeTaxService().Get(row.EmployeeID, EnumIncomeTaxDataFrom.BonusITTempData);
if (existing != null && existing.Count > 0)
taxLines = existing;
}
if (taxLines != null && taxLines.Count > 0)
{
PayrollType payrollType = new PayrollTypeService().Get(payrolltypeid);
if (payrollType == null || payrollType.TaxParamID == null)
throw new ServiceException("Current year Tax paramter setup not found.");
TaxMergeMaster mitem = new TaxMergeMasterService().Get(payrolltypeid, (int)payrollType.TaxParamID,
EnumTaxMergeType.Bonus, row.BonusID);
if (mitem == null)
throw new ServiceException("Bonus head not found in the income tax Grouping");
IncomeTax bonusLine = taxLines.Find(y => y.ItemGroup == mitem.ItemGroup && y.ItemID == mitem.ItemID);
if (bonusLine == null)
throw new ServiceException("Income tax amount not found in the collection");
bonusLine.ThisMonthAmount = bonusAmount;
IncomeTax taxLine = taxLines.Find(y => y.ItemGroup == EnumIncomeTaxItemGroup.Tax_Deducted);
if (taxLine != null)
taxLine.ThisMonthAmount = changeTaxAmount;
}
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin(true);
BonusProcessDA.UpdateRowAmounts(tc, row.BonusProcessDetailID, bonusAmount, changeTaxAmount, taxAmount,
userID, DateTime.Now);
if (taxLines != null && taxLines.Count > 0)
{
IncomeTaxService taxService = new IncomeTaxService();
taxService.Delete(tc, row.EmployeeID.ToString(), EnumIncomeTaxDataFrom.BonusITTempData);
taxService.SaveBulk(tc, taxLines, EnumIncomeTaxDataFrom.BonusITTempData);
}
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return this.GetGridRow(row.BonusProcessDetailID);
}
#endregion
#region Remove (one saved row, deleted straight away)
/// <summary>
/// Remove button on a saved row: what the old Remove + Save left in the database (the employee simply
/// not saved), now deleted at once since Process already saved it — in one transaction:
/// - BONUSTEMPIT: this employee's rows (only when the process was saved with Calculate Tax);
/// - BonusEmpCostCenter: this employee's rows in this process;
/// - BONUSPROCESSDETAIL: the row;
/// - BONUSPROCESS: the header too, when that was the process's last employee.
/// Refused when the row is not found, not the current payroll type's, or the bonus is already approved
/// (the same checks as the Modify dialog). Rows not saved yet are removed in the browser only, as before.
/// </summary>
public BonusProcessRowRemoveResult RemoveRow(int bonusProcessDetailID, int payrolltypeid)
{
if (bonusProcessDetailID <= 0)
throw new ServiceException("Please select a bonus row.");
ModifyRow row = GetRowForModify(bonusProcessDetailID, payrolltypeid);
BonusProcessRowRemoveResult result = new BonusProcessRowRemoveResult
{
BonusProcessDetailID = row.BonusProcessDetailID,
BonusProcessID = row.BonusProcessID,
};
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin(true);
BonusProcessDA.DeleteRowBonusTempTax(tc, row.BonusProcessID, row.EmployeeID);
BonusProcessDA.DeleteRowCostCenter(tc, row.BonusProcessID, row.EmployeeID);
BonusProcessDA.DeleteRow(tc, row.BonusProcessDetailID);
if (BonusProcessDA.CountRows(tc, row.BonusProcessID) == 0)
{
BonusProcessDA.DeleteEmptyProcess(tc, row.BonusProcessID);
result.ProcessDeleted = true;
}
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return result;
}
#endregion
#region Clear Tax (whole process, saved straight away)
/// <summary>
/// Bonus Process screen, "Clear Tax": what the old Clear Tax + Save did, now saved at once (there is no
/// Save button any more), for every employee of the process on the screen, in one transaction:
/// - BONUSPROCESSDETAIL: CHANGETAXAMOUNT = 0 (TAXAMOUNT, the calculated tax, is kept);
/// - BONUSTEMPIT: THISMONTHAMOUNT = 0 on the Tax Deducted line (-212) of those employees.
/// Refused when the process is not the current payroll type's or the bonus is already approved.
/// The old clearTax() (browser only) is kept as it was.
/// </summary>
public List<BonusProcessGridRow> ClearTaxAndSave(int bonusProcessID, int payrolltypeid, int userID)
{
if (bonusProcessID <= 0)
throw new ServiceException("Please process the bonus first.");
int bonusID = 0;
int processPayrollTypeID = 0;
DateTime bonusMonth = DateTime.MinValue;
bool found = false;
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataReader dr = new DataReader(BonusProcessDA.GetProcessHeaderForClearTax(tc, bonusProcessID));
if (dr.Read())
{
found = true;
bonusID = dr.GetInt32("BONUSID", 0);
bonusMonth = dr.GetDateTime("BONUSMONTH", DateTime.MinValue);
processPayrollTypeID = dr.GetInt32("PAYROLLTYPEID", 0);
}
dr.Close();
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
if (!found)
throw new ServiceException("Bonus process not found. Please process the bonus again.");
if (processPayrollTypeID != payrolltypeid)
throw new ServiceException("This bonus process does not belong to the current payroll type.");
if (this.IsApproved(bonusID, bonusMonth, payrolltypeid))
throw new ServiceException("selected Bonus is already process and Approved");
tc = null;
try
{
tc = TransactionContext.Begin(true);
BonusProcessDA.ClearTaxOfProcess(tc, bonusProcessID, userID, DateTime.Now);
BonusProcessDA.ClearBonusTempTaxOfProcess(tc, bonusProcessID, (int)EnumIncomeTaxItemGroup.Tax_Deducted);
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return this.GetGridRows(bonusProcessID);
}
#endregion
/// <summary>
/// Builds the employee cost-center split for every employee in the bonus process and
/// bulk-inserts it into BonusEmpCostCenter (mirrors the SalaryEmpCostCenter handling in
@ -1844,36 +1156,6 @@ namespace HRM.DA
return isApproved;
}
/// <summary>
/// Bonus Process screen (Process and Upload): the same bonus type may be processed only once in a month.
/// Throws when this bonus already has a process in this month for this payroll type.
/// </summary>
public void CheckAlreadyProcessedInMonth(int bonusID, DateTime bonusMonth, int payrolltypeid)
{
TransactionContext tc = null;
int count = 0;
try
{
tc = TransactionContext.Begin();
count = BonusProcessDA.CountProcessInMonth(tc, payrolltypeid, bonusID, bonusMonth);
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
if (count > 0)
throw new ServiceException("This bonus type is already processed for " + bonusMonth.ToString("MMMM yyyy") +
". The same bonus type cannot be processed twice in the same month.");
}
public DataTable GetUnApprovedBonuses(DateTime dMonthDate, int payrollTypeID)
{

View File

@ -4759,32 +4759,6 @@ namespace HRM.DA
//}
// Stamps the uploading user on every object of an upload list before its SaveForUpload:
// CreatedBy/CreatedDate on new rows, ModifiedBy/ModifiedDate on every row.
private void SetAuditInfo<T>(List<T> items, int userID) where T : AuditTrailBase
{
if (items == null)
return;
DateTime now = DateTime.Now;
foreach (T item in items)
{
if (item == null)
continue;
if (item.IsNew || item.CreatedBy <= 0)
{
item.CreatedBy = userID;
item.CreatedDate = now;
}
else
{
item.ModifiedBy = userID;
item.ModifiedDate = now;
}
}
}
public void Save(List<Category> categorys, List<Grade> grades, List<Department> departments,
List<Location> locations,
List<Religion> religions, List<Designation> designations, List<Bank> banks,

View File

@ -1860,43 +1860,6 @@ namespace HRM.DA
return employees;
}
/// <summary>
/// Same as GetByEmpIDs(string, int), for any number of employees (10k+): the IDs reach SQL Server as
/// one parameter and a temp table, not as an IN list in the SQL text.
/// </summary>
public List<Employee> GetByEmpIDList(List<int> empIDs, int payrollTypeID)
{
List<Employee> employees = new List<Employee>();
if (empIDs == null || empIDs.Count == 0)
return employees;
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataReader dr = new DataReader(EmployeeDA.GetByEmpIDList(tc, empIDs.Distinct().ToList(), payrollTypeID));
employees = this.CreateObjects<Employee>(dr);
dr.Close();
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return employees;
}
public List<Employee> GetByEmpIDs(string empIDs)
{
List<Employee> employees = new List<Employee>();

View File

@ -109,7 +109,6 @@ namespace HRM.DA
_employees = employees;
_processMonth = processMonth;
_euroRate = euroRate;
UpdateprocessStatus("Collecting Employee basic information....");
this.Initialize();
this.AddEmployeeToProcess();

View File

@ -316,36 +316,6 @@ namespace HRM.DA
return DataExist;
}
/// <summary>
/// Only SALARYTEMPIT (salary processed, not yet finalized) — unlike hasTaxDataInSalaryTemp, the
/// employee's BONUSTEMPIT rows are not counted. For the Bonus Process Modify dialog.
/// </summary>
public bool hasTaxDataInSalaryTempOnly(int employeeID)
{
bool DataExist = false;
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataExist = IncomeTaxDA.hasTaxDataInSalaryTempOnly(tc, employeeID);
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return DataExist;
}
public EnumIncomeTaxDataFrom currentYeardataSource(int employeeID)
{

View File

@ -469,19 +469,16 @@ return oTaxParameter;
{
PayrollType ptype = new PayrollTypeService().Get(payrollTypeID);
TransactionContext tc = null;
List<TaxParameter> allTaxParameter = GetbyPayrolltype(payrollTypeID);
try
{
tc = TransactionContext.Begin(true);
if (oTaxParameter.IsNew)
{
if (allTaxParameter != null && allTaxParameter.Count > 0)
{
if (ptype.TaxParamID != null) throw new Exception("Not allowed to create new tax-year until current year-end.");
}
int MaxID = TaxParameterDA.GetMaxID(tc, payrollTypeID);
int id = tc.GenerateID("TaxParameter", "TaxParamID");
base.SetObjectID(oTaxParameter, (id));
TaxParameterDA.InsertWithSignature(tc, oTaxParameter);

View File

@ -329,12 +329,11 @@ namespace HRM.DA
public int Save(Role oRole)
{
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin(true);
// Audit of the permission rows, by PermissionCode, read before they are deleted and
// re-inserted below, so each kept menu keeps who/when it was created and approved.
Dictionary<string, Role.RolePermission> existingPermissions = new Dictionary<string, Role.RolePermission>();
if (oRole.IsNew)
{
int id = tc.GenerateID("Role", "RoleID");
@ -345,22 +344,14 @@ namespace HRM.DA
}
else
{
DataReader existingReader = new DataReader(RoleDA.GetRolePermissionByRoleID(tc, oRole.ID));
while (existingReader.Read())
{
Role.RolePermission existingPermission = this.CreateRolePermissionObject(existingReader);
if (existingPermission.PermissionCode != null && !existingPermissions.ContainsKey(existingPermission.PermissionCode))
existingPermissions.Add(existingPermission.PermissionCode, existingPermission);
}
existingReader.Close();
RoleDA.Update(tc, oRole);
#region Delete Children
RoleDA.Delete(tc, "RolePermission", "RoleID", oRole.ID);
//RoleDA.Delete(tc, "Role.RoleActionPermission", "RoleID", oRole.ID);
//RoleDA.Delete(tc, "RoleDesignation", "RoleID", oRole.ID);
// RoleDA.Delete(tc, "Role.RoleActionPermission", "RoleID", oRole.ID);
// RoleDA.Delete(tc, "RoleDesignation", "RoleID", oRole.ID);
#endregion
}
if (oRole.RolePermissions != null & oRole.RolePermissions.Count > 0)
{
int maxID = oRole.RolePermissions.Max(x => x.ID);
@ -381,31 +372,11 @@ namespace HRM.DA
newid = newid + 1;
}
// Whoever made this change: the editor, or the creator for a new role. On approval
// the controller keeps the maker in ModifiedBy, so this is still the maker.
int makerID = (oRole.ModifiedBy ?? 0) > 0 ? oRole.ModifiedBy.Value : oRole.CreatedBy;
foreach (Role.RolePermission rolePermission in oRole.RolePermissions)
{
rolePermission.RoleID = oRole.ID;
Role.RolePermission existingPermission = null;
if (rolePermission.PermissionCode != null)
existingPermissions.TryGetValue(rolePermission.PermissionCode, out existingPermission);
if (existingPermission != null)
{
// Menu the role already had: keep its original audit.
rolePermission.CreatedBy = existingPermission.CreatedBy;
rolePermission.CreatedDate = existingPermission.CreatedDate;
rolePermission.ApproveBy = existingPermission.ApproveBy;
rolePermission.ApproveDate = existingPermission.ApproveDate;
}
else
{
// Menu added by this change.
rolePermission.CreatedBy = makerID;
rolePermission.CreatedDate = DateTime.Now;
rolePermission.ApproveBy = null;
rolePermission.ApproveDate = null;
}
rolePermission.CreatedBy = oRole.CreatedBy;
rolePermission.CreatedDate = oRole.CreatedDate;
//if (oRole.RoleStatus == EnumAuthStatus.Approved )
//{
// if (rolePermission.Status == EnumAuthStatus.DeletedNotYetApprove)
@ -420,17 +391,6 @@ namespace HRM.DA
rolePermission.Status = EnumAuthStatus.Approved;
else
rolePermission.Status = EnumAuthStatus.None;
// A menu approved by this approval (new, or still pending before it) gets this
// approver; a menu that was already approved keeps its earlier approver.
bool approvedNow = existingPermission == null
|| existingPermission.Status == EnumAuthStatus.NewNotYetApprove
|| existingPermission.Status == EnumAuthStatus.EditedNotYetApprove;
if (rolePermission.Status == EnumAuthStatus.Approved && approvedNow)
{
rolePermission.ApproveBy = oRole.ApproveBy;
rolePermission.ApproveDate = oRole.ApproveDate;
}
}
else
{

View File

@ -1,147 +0,0 @@
using Ease.Core.DataAccess;
using Ease.Core.Model;
using Ease.Core.Utility;
using System;
using System.Collections.Generic;
using System.Data;
using HRM.BO;
namespace HRM.DA
{
public class SystemAuditHistoryService : ServiceTemplate, ISystemAuditHistoryService
{
public SystemAuditHistoryService()
{
}
private void MapObject(SystemAuditHistory oItem, DataReader oReader)
{
oItem.AuditType = oReader.GetString("AuditType");
oItem.AuditDate = oReader.GetDateTime("AuditDate");
oItem.LoginID = oReader.GetString("LoginID");
oItem.Name = oReader.GetString("Name");
oItem.Code = oReader.GetString("Code");
oItem.UserType = UserTypeText(oReader.GetString("UserType"));
oItem.RoleName = oReader.GetString("RoleName");
oItem.RoleType = RoleTypeText(oReader.GetInt32("RoleType"));
oItem.MenuKey = oReader.GetString("MenuKey");
oItem.MenuName = oReader.GetString("MenuName");
oItem.AccessType = oReader.GetString("AccessType");
oItem.Activities = oReader.GetString("Activities");
oItem.ActionBy = oReader.GetInt32("ActionBy");
oItem.ActionByLoginID = oReader.GetString("ActionByLoginID");
oItem.ActionByName = oReader.GetString("ActionByName");
// Z_ROLE has no activities column: show the role's status, as the other triggers write it.
int? status = oReader.GetInt32("Status");
if (string.IsNullOrWhiteSpace(oItem.Activities) && status.HasValue)
oItem.Activities = StatusText(status.Value);
}
protected override T CreateObject<T>(DataReader oReader)
{
SystemAuditHistory oItem = new SystemAuditHistory();
MapObject(oItem, oReader);
return oItem as T;
}
// Same words the Z_ triggers write into "activities".
private static string StatusText(int status)
{
switch (status)
{
case 1: return "Active";
case 2: return "New Not Yet Approve";
case 3: return "Deleted Not Yet Approve";
case 4: return "Edited Not Yet Approve";
case 5: return "Approved";
case 6: return "Locked";
case 7: return "Archived";
case 8: return "Inactive";
case 9: return "Inactive Not Yet Approve";
case 10: return "Rejected";
default: return "None";
}
}
private static string RoleTypeText(int? roleType)
{
if (!roleType.HasValue)
return null;
switch ((EnumRoleType)roleType.Value)
{
case EnumRoleType.Admin: return "Admin";
case EnumRoleType.Self_Service: return "Self Service";
case EnumRoleType.Mobile: return "Mobile";
default: return roleType.Value.ToString();
}
}
// Z_USERS.usertype is the Users.UserType number as text.
private static string UserTypeText(string userType)
{
int value;
if (string.IsNullOrWhiteSpace(userType) || !int.TryParse(userType.Trim(), out value))
return userType;
switch ((EnumUserType)value)
{
case EnumUserType.SuperUser: return "Super User";
case EnumUserType.User: return "User";
case EnumUserType.Employee: return "Employee";
default: return userType;
}
}
#region Service implementation
public List<SystemAuditHistory> Get(EnumSystemAuditHistory type, DateTime dtFrom, DateTime dtTo)
{
List<SystemAuditHistory> items = new List<SystemAuditHistory>();
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
IDataReader reader;
switch (type)
{
case EnumSystemAuditHistory.Role:
reader = SystemAuditHistoryDA.GetRole(tc, dtFrom, dtTo);
break;
case EnumSystemAuditHistory.RolePermission:
reader = SystemAuditHistoryDA.GetRolePermission(tc, dtFrom, dtTo);
break;
case EnumSystemAuditHistory.User:
reader = SystemAuditHistoryDA.GetUser(tc, dtFrom, dtTo);
break;
case EnumSystemAuditHistory.UserRole:
reader = SystemAuditHistoryDA.GetUserRole(tc, dtFrom, dtTo);
break;
case EnumSystemAuditHistory.UserAccessType:
reader = SystemAuditHistoryDA.GetUserAccessType(tc, dtFrom, dtTo);
break;
default:
throw new ArgumentException("Unknown audit history.");
}
DataReader dr = new DataReader(reader);
items = this.CreateObjects<SystemAuditHistory>(dr);
dr.Close();
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return items;
}
#endregion
}
}

View File

@ -19,13 +19,6 @@ namespace HRM.DA
base.SetObjectID(oUserAccessType, oReader.GetInt32("UserAccessTypeID").Value);
oUserAccessType.PayrollTypeID = oReader.GetInt32("PayrollTypeID").Value;
oUserAccessType.UserID = oReader.GetInt32("UserID", 0);
oUserAccessType.AccessTypeStatus = (EnumAuthStatus)oReader.GetInt32("Status", (int)EnumAuthStatus.Approved);
oUserAccessType.CreatedBy = oReader.GetInt32("CreatedBy", 0);
oUserAccessType.CreatedDate = oReader.GetDateTime("CreatedDate", DateTime.MinValue);
oUserAccessType.ModifiedBy = oReader.GetInt32("ModifiedBy");
oUserAccessType.ModifiedDate = oReader.GetDateTime("ModifiedDate");
oUserAccessType.ApprovedBy = oReader.GetInt32("ApprovedBy");
oUserAccessType.ApprovedDate = oReader.GetDateTime("ApprovedDate");
this.SetObjectState(oUserAccessType, Ease.Core.ObjectState.Saved);
}
@ -219,178 +212,6 @@ namespace HRM.DA
}
}
#region Maker-checker
public int RequestChange(int userID, List<int> payrollTypeIDs, int makerID)
{
TransactionContext tc = null;
int changed = 0;
try
{
tc = TransactionContext.Begin(true);
DataReader dr = new DataReader(UserAccessTypeDA.GetByUserID(tc, userID));
List<UserAccessType> current = this.CreateObjects<UserAccessType>(dr);
dr.Close();
if (current.Any(x => x.AccessTypeStatus == EnumAuthStatus.NewNotYetApprove
|| x.AccessTypeStatus == EnumAuthStatus.DeletedNotYetApprove))
{
throw new InvalidOperationException("This user already has an access change waiting for approval.");
}
DateTime now = DateTime.Now;
List<int> wanted = (payrollTypeIDs ?? new List<int>()).Distinct().ToList();
UserAccessTypeDA.SetAuditUser(tc, makerID);
// Newly ticked payroll type: requested, not live until approved.
foreach (int payrollTypeID in wanted.Where(p => !current.Any(c => c.PayrollTypeID == p)))
{
UserAccessType item = new UserAccessType();
item.UserID = userID;
item.PayrollTypeID = payrollTypeID;
item.AccessTypeStatus = EnumAuthStatus.NewNotYetApprove;
item.CreatedBy = makerID;
item.CreatedDate = now;
item.ApprovedBy = null;
item.ApprovedDate = null;
this.Save(tc, item);
changed++;
}
// Unticked live access: removal requested, still live until approved.
foreach (UserAccessType item in current.Where(c => !wanted.Contains(c.PayrollTypeID)))
{
UserAccessTypeDA.RequestRemoval(tc, item.ID, makerID, now);
changed++;
}
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return changed;
}
public void Approve(int userID, int approverID)
{
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin(true);
User oUser = new UserService().Get(tc, userID);
// Read before approving: the payroll types this approval newly gives access to.
List<string> newAccessNames = new List<string>();
DataReader dr = new DataReader(UserAccessTypeDA.GetPendingNewDescriptions(tc, userID));
while (dr.Read())
{
string name = dr.GetString("Description");
if (!string.IsNullOrWhiteSpace(name) && !newAccessNames.Contains(name))
newAccessNames.Add(name);
}
dr.Close();
UserAccessTypeDA.SetAuditUser(tc, approverID);
UserAccessTypeDA.Approve(tc, userID, approverID, DateTime.Now);
// The "access granted" notification now goes out when the access is really live.
if (oUser != null && oUser.EmployeeID.HasValue && newAccessNames.Any())
{
var notification = new EmployeeNotification
{
EmployeeID = oUser.EmployeeID.Value,
Header = "New Access Permission Granted",
Description = $"You have been granted access to: {string.Join(", ", newAccessNames)}.",
Link = "",
CreatedDate = DateTime.Now,
CreatedBy = approverID,
ReferenceID = oUser.ID,
IsRead = 0,
ReadDate = null,
ReadBy = null
};
new EmployeeNotificationService().Insert(tc, notification);
}
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
}
public List<UserAccessType> GetPending()
{
List<UserAccessType> items = new List<UserAccessType>();
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataReader dr = new DataReader(UserAccessTypeDA.GetPending(tc));
while (dr.Read())
{
UserAccessType item = this.CreateObject<UserAccessType>(dr);
item.Description = dr.GetString("PayrollTypeName");
item.LoginID = dr.GetString("UserLoginID");
item.UserName = dr.GetString("UserFullName");
item.MakerLoginID = dr.GetString("MakerLoginID");
bool isRemoval = item.AccessTypeStatus == EnumAuthStatus.DeletedNotYetApprove;
item.MakerID = isRemoval ? (item.ModifiedBy ?? 0) : item.CreatedBy;
item.RequestDate = isRemoval
? item.ModifiedDate
: (item.CreatedDate == DateTime.MinValue ? (DateTime?)null : item.CreatedDate);
items.Add(item);
}
dr.Close();
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return items;
}
public void Reject(int userID, int rejecterID)
{
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin(true);
UserAccessTypeDA.SetAuditUser(tc, rejecterID);
UserAccessTypeDA.Reject(tc, userID);
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
}
#endregion
internal int Save(TransactionContext tc, UserAccessType oUserAccessType)
{
try

View File

@ -31,9 +31,6 @@ namespace HRM.DA
oUserRole.ApprovedComputerName = oReader.GetString("ApprovedComputerName");
oUserRole.UserRoleStatus = (EnumAuthStatus)oReader.GetInt32("Status").Value;
oUserRole.employeeID = oReader.GetInt32("employeeID",true, 0) ==0? null: oReader.GetInt32("employeeID");
// Only the list query (UserRoleDA.Get by role type) carries EmpPayrollTypeID: the employee's payroll type.
int empPayrollTypeID = oReader.GetInt32("EmpPayrollTypeID", true, 0);
oUserRole.payrollTypeID = empPayrollTypeID == 0 ? null : empPayrollTypeID;
oUserRole.loginIDView = oReader.GetString("LoginID", true, string.Empty);
oUserRole.userNameView = oReader.GetString("userName", true, string.Empty);
oUserRole.roleNameView = oReader.GetString("roleName", true, string.Empty);
@ -341,7 +338,7 @@ namespace HRM.DA
userObject.EmployeeID = emp.ID;
// the employee's e-mail becomes the user's (both e-mail columns); no e-mail on the employee leaves them empty
userObject.Email = string.IsNullOrWhiteSpace(emp.EmailAddress) ? null : emp.EmailAddress.Trim();
// userObject.EmailAddress = userObject.Email;
userObject.EmailAddress = userObject.Email;
userObject.UserStatus = EnumAuthStatus.Approved;
userObject.ChangePasswordAtNextLogon = true;
userObject.SISU = false;
@ -440,467 +437,6 @@ namespace HRM.DA
// #endregion
// }
//}
#region Maker-checker (Authentication > User Role Permission)
// UserRole.Status (UserRoleMakerChecker_DB_Changes.sql): Approved (5) = live; NewNotYetApprove (2) =
// given, not live until approved; DeletedNotYetApprove (3) = being taken away, still live until approved.
private static bool IsSelfService(UserRoleSubject subject)
{
return subject.RoleType == EnumRoleType.Self_Service;
}
private static bool IsPendingStatus(EnumAuthStatus status)
{
return status == EnumAuthStatus.NewNotYetApprove || status == EnumAuthStatus.DeletedNotYetApprove;
}
// The Self Service employee's login, if there is one: by EmployeeID first, then by
// LoginID = EmployeeNo (how older employee logins were made).
private User FindEmployeeLogin(int employeeID, string employeeNo)
{
UserService userService = new UserService();
User user = userService.Get(employeeID, EnumUserType.Employee);
if (user == null && !string.IsNullOrWhiteSpace(employeeNo))
{
User byLogin = userService.Get(employeeNo);
if (byLogin != null && byLogin.UserType == EnumUserType.Employee)
user = byLogin;
}
return user;
}
// UserRole rows as the maker-checker screens show them. A row waiting for approval becomes a request:
// Status 2 = give the role (maker CreatedBy, asked on EventDate), Status 3 = take it away (maker
// ModifiedBy, asked on ModifiedDate).
private List<UserRoleRequest> ReadRows(TransactionContext tc, bool pendingOnly, int? userID, EnumRoleType? roleType)
{
List<UserRoleRequest> items = new List<UserRoleRequest>();
DataReader dr = new DataReader(UserRoleDA.GetForMakerChecker(tc, pendingOnly, userID, roleType));
while (dr.Read())
{
UserRoleRequest item = new UserRoleRequest();
base.SetObjectID(item, dr.GetInt32("UserRoleID", 0));
item.Status = (EnumAuthStatus)dr.GetInt32("Status", (int)EnumAuthStatus.Approved);
bool isRemoval = item.Status == EnumAuthStatus.DeletedNotYetApprove;
item.RequestType = isRemoval ? EnumUserRoleRequestType.Remove : EnumUserRoleRequestType.Add;
item.RoleID = dr.GetInt32("RoleID", 0);
item.RoleType = (EnumRoleType)dr.GetInt32("RoleType", 0);
item.UserID = dr.GetInt32("UserID");
item.EmployeeID = dr.GetInt32("EmployeeID");
item.PayrollTypeID = dr.GetInt32("PayrollTypeID");
item.CreatedBy = isRemoval ? dr.GetInt32("ModifiedBy", 0) : dr.GetInt32("CreatedBy", 0);
item.CreatedDate = isRemoval
? dr.GetDateTime("ModifiedDate", DateTime.MinValue)
: dr.GetDateTime("EventDate", DateTime.MinValue);
item.RoleName = dr.GetString("RoleName");
item.LoginID = dr.GetString("LoginID");
item.PersonName = dr.GetString("PersonName");
item.EmployeeNo = dr.GetString("EmployeeNo");
item.MakerLoginID = dr.GetString("MakerLoginID");
this.SetObjectState(item, Ease.Core.ObjectState.Saved);
items.Add(item);
}
dr.Close();
return items;
}
public UserRoleState GetRoleState(UserRoleSubject subject)
{
UserRoleState state = new UserRoleState();
state.RoleType = subject.RoleType;
try
{
User login = null;
if (IsSelfService(subject))
{
int employeeID = subject.EmployeeID ?? 0;
Employee emp = null;
if (employeeID <= 0 && (subject.UserID ?? 0) > 0)
{
// Opened from the list by the employee's login: older logins have no EmployeeID and
// are tied to the employee only by LoginID = EmployeeNo.
User subjectLogin = new UserService().Get(subject.UserID.Value);
employeeID = subjectLogin?.EmployeeID ?? 0;
if (employeeID <= 0 && !string.IsNullOrWhiteSpace(subjectLogin?.LoginID))
emp = new EmployeeService().GetByEmployeeNo(subjectLogin.LoginID);
}
if (emp == null || emp.ID <= 0)
emp = new EmployeeService().Get(employeeID);
if (emp == null || emp.ID <= 0)
throw new InvalidOperationException("Employee not found.");
state.EmployeeID = emp.ID;
state.PayrollTypeID = emp.PayrollTypeID;
state.PersonName = emp.Name;
state.LoginID = emp.EmployeeNo;
login = FindEmployeeLogin(emp.ID, emp.EmployeeNo);
}
else
{
login = new UserService().Get(subject.UserID ?? 0);
if (login == null)
throw new InvalidOperationException("User not found.");
state.PersonName = login.UserName;
}
if (login != null)
{
state.UserID = login.ID;
state.LoginID = login.LoginID;
state.HasLogin = true;
state.LoginWaiting = login.UserStatus == EnumAuthStatus.NewNotYetApprove;
}
if (state.HasLogin)
{
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
List<UserRoleRequest> rows = ReadRows(tc, false, state.UserID, subject.RoleType);
tc.End();
state.LiveRoleIDs = rows.Where(r => r.Status != EnumAuthStatus.NewNotYetApprove)
.Select(r => r.RoleID).Distinct().ToList();
state.Pending = rows.Where(r => IsPendingStatus(r.Status)).ToList();
}
catch
{
if (tc != null)
tc.HandleError();
throw;
}
}
}
catch (Exception e)
{
#region Handle Exception
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return state;
}
public int RequestChange(UserRoleChangeRequest request, int makerID)
{
TransactionContext tc = null;
int changed = 0;
try
{
UserRoleState state = this.GetRoleState(request);
if (state.Pending.Count > 0)
throw new InvalidOperationException("This person already has a role change waiting for approval.");
List<int> live = state.LiveRoleIDs;
List<int> wanted = (request.RoleIDs ?? new List<int>()).Distinct().ToList();
List<int> adds = wanted.Where(r => !live.Contains(r)).ToList();
List<int> removes = live.Where(r => !wanted.Contains(r)).ToList();
if (adds.Count == 0 && removes.Count == 0)
return 0;
// A Self Service employee with no login gets one now, switched off (Status 2) until approved.
User newLogin = null;
if (IsSelfService(request) && !state.HasLogin)
{
Employee emp = new EmployeeService()
.GetByEmpIDs(state.EmployeeID.ToString(), request.PayrollTypeID ?? 0).FirstOrDefault();
if (emp == null)
throw new InvalidOperationException("Employee not found in the selected payroll type.");
newLogin = this.NewEmployeeLogin(emp, makerID);
}
DateTime now = DateTime.Now;
tc = TransactionContext.Begin(true);
// Checked again inside the transaction, with a lock: another maker may be sending a change for
// the same person at this very moment.
if (newLogin != null)
{
if (UserRoleDA.CountEmployeeLoginsLocked(tc, state.EmployeeID ?? 0) > 0)
throw new InvalidOperationException("Someone else has just sent a role change for this employee. Open the employee again to see it.");
}
else if (UserRoleDA.CountPendingLocked(tc, state.UserID ?? 0, request.RoleType) > 0)
{
throw new InvalidOperationException("This person already has a role change waiting for approval.");
}
int userID = state.UserID ?? 0;
if (newLogin != null)
userID = new UserService().Save(tc, newLogin);
foreach (int roleID in adds)
{
UserRoleDA.InsertPending(tc, tc.GenerateID("UserRole", "UserRoleID"), roleID, userID, makerID, now);
changed++;
}
if (removes.Count > 0)
{
// One row at a time (see UserRoleDA): every live row of each role being taken away.
foreach (UserRoleRequest row in ReadRows(tc, false, userID, request.RoleType)
.Where(r => r.Status != EnumAuthStatus.NewNotYetApprove && removes.Contains(r.RoleID)))
{
UserRoleDA.RequestRemoval(tc, row.ID, makerID, now);
}
changed += removes.Count;
}
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return changed;
}
public void Approve(UserRoleSubject subject, int approverID)
{
TransactionContext tc = null;
User loginToMail = null;
try
{
UserRoleState state = this.GetRoleState(subject);
if (state.Pending.Count == 0)
throw new InvalidOperationException("No role change is waiting for approval.");
int userID = state.UserID.Value;
// A login made by the maker for a Self Service employee is switched on now, and mailed as before.
if (IsSelfService(subject) && state.LoginWaiting)
{
loginToMail = new UserService().Get(userID);
}
int? notifyEmployeeID = IsSelfService(subject) ? state.EmployeeID : new UserService().Get(userID)?.EmployeeID;
DateTime now = DateTime.Now;
tc = TransactionContext.Begin(true);
// One row at a time (see UserRoleDA): removals go, given roles become live.
foreach (UserRoleRequest row in state.Pending)
{
if (row.RequestType == EnumUserRoleRequestType.Remove)
UserRoleDA.DeleteRow(tc, row.ID);
else
UserRoleDA.ApproveRow(tc, row.ID, approverID, now);
}
if (loginToMail != null)
UserDA.UpdateStatus(tc, userID, EnumAuthStatus.Approved, approverID, now);
foreach (UserRoleRequest req in state.Pending.Where(p => p.RequestType == EnumUserRoleRequestType.Add))
this.NotifyRoleGranted(tc, subject.RoleType, notifyEmployeeID, req.RoleName, req.ID, approverID);
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
if (loginToMail != null)
this.MailNewEmployeeLogin(loginToMail);
}
public void Reject(UserRoleSubject subject, int approverID)
{
TransactionContext tc = null;
try
{
UserRoleState state = this.GetRoleState(subject);
if (state.Pending.Count == 0)
throw new InvalidOperationException("No role change is waiting for approval.");
int userID = state.UserID.Value;
tc = TransactionContext.Begin(true);
// One row at a time (see UserRoleDA): given roles go, removals stay live.
foreach (UserRoleRequest row in state.Pending)
{
if (row.RequestType == EnumUserRoleRequestType.Remove)
UserRoleDA.RestoreRow(tc, row.ID);
else
UserRoleDA.DeleteRow(tc, row.ID);
}
// A login the maker made for this change, never switched on and now without any role, goes too.
if (IsSelfService(subject) && state.LoginWaiting && UserRoleDA.CountByUser(tc, userID) == 0)
UserDA.Delete(tc, userID);
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
}
/// <summary>
/// User page rejected a new login (Status 2): its role changes waiting for approval are rejected too,
/// in the caller's transaction, exactly as User Role Permission's Reject does them (given roles go,
/// removals stay live), one row at a time (see UserRoleDA). Returns how many rows were decided.
/// </summary>
internal int RejectPendingRolesOfLogin(TransactionContext tc, int userID)
{
List<UserRoleRequest> pending = ReadRows(tc, true, userID, null);
foreach (UserRoleRequest row in pending)
{
if (row.RequestType == EnumUserRoleRequestType.Remove)
UserRoleDA.RestoreRow(tc, row.ID);
else
UserRoleDA.DeleteRow(tc, row.ID);
}
return pending.Count;
}
public List<UserRoleRequest> GetPending()
{
List<UserRoleRequest> items = new List<UserRoleRequest>();
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
items = ReadRows(tc, true, null, null);
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return items;
}
// The employee login the old Save created (same values), but switched off (Status 2) until the
// role change is approved.
private User NewEmployeeLogin(Employee emp, int parentUserID)
{
User userObject = new User();
userObject.LoginID = emp.EmployeeNo;
userObject.UserName = emp.Name;
userObject.Password = MakePassWord(emp.BirthDate);
userObject.ParentID = parentUserID;
userObject.PasswordHints = MakePassWord(emp.BirthDate);
userObject.EmployeeID = emp.ID;
userObject.Email = string.IsNullOrWhiteSpace(emp.EmailAddress) ? null : emp.EmailAddress.Trim();
userObject.UserStatus = EnumAuthStatus.NewNotYetApprove;
userObject.ChangePasswordAtNextLogon = true;
userObject.SISU = false;
userObject.CreatedDate = DateTime.Now;
userObject.UserType = EnumUserType.Employee;
return userObject;
}
// The "role assigned" notification the old Save sent, now sent when the role is really live.
private void NotifyRoleGranted(TransactionContext tc, EnumRoleType roleType, int? employeeID, string roleName,
int userRoleID, int approverID)
{
if (!employeeID.HasValue || (roleType != EnumRoleType.Self_Service && roleType != EnumRoleType.Admin))
return;
bool hasRoleName = !string.IsNullOrWhiteSpace(roleName);
string description = roleType == EnumRoleType.Admin
? (hasRoleName ? $"You have been granted Admin access with the role: {roleName}." : "You have been granted a new Admin role.")
: (hasRoleName ? $"You have been assigned to the Self Service role: {roleName}." : "You have been assigned a new Self Service role.");
// The menu is loaded at sign-in, so the new role shows from the next sign-in.
description += " Sign out and sign in again to see it in your menu.";
var notification = new EmployeeNotification
{
EmployeeID = employeeID.Value,
Header = roleType == EnumRoleType.Admin ? "New Admin Role Assigned" : "New Self Service Role Assigned",
Description = description,
Link = "",
CreatedDate = DateTime.Now,
CreatedBy = approverID,
ReferenceID = userRoleID,
IsRead = 0,
ReadDate = null,
ReadBy = null
};
new EmployeeNotificationService().Insert(tc, notification);
}
/// <summary>
/// Sends the existing employee login e-mail (MailNewLogin: Login ID + the birth-date password) when a
/// new Self Service employee login is switched on, from either page that can do it: User Role
/// Permission approval or User page approval. Sent only while the login still has that first
/// birth-date password, i.e. it was made by User Role Permission; any other login is left alone,
/// so a wrong password is never mailed. Never throws.
/// </summary>
internal void MailNewEmployeeLogin(User login)
{
try
{
if (login == null || login.UserType != EnumUserType.Employee)
return;
Employee emp = null;
if ((login.EmployeeID ?? 0) > 0)
emp = new EmployeeService().Get(login.EmployeeID.Value);
if ((emp == null || emp.ID <= 0) && !string.IsNullOrWhiteSpace(login.LoginID))
emp = new EmployeeService().GetByEmployeeNo(login.LoginID);
if (emp == null || emp.ID <= 0)
return;
string firstPassword = Ease.Core.Utility.Global.CipherFunctions.Encrypt("CeLiMiTeD.AdMIn", MakePassWord(emp.BirthDate));
if (login.Password != firstPassword)
return;
this.MailNewLogin(new List<Employee> { emp });
}
catch (Exception e)
{
ExceptionLog.Write(e);
}
}
// The login e-mail the old Save sent to newly created employee logins (now sent on approval).
private void MailNewLogin(List<Employee> oemps)
{
try
{
EmailSettings st = new EmailSettings();
var builder = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json");
IConfiguration Configuration = builder.Build();
Configuration.GetSection("EmailSettings").Bind(st);
foreach (Employee emp in oemps)
{
if (!string.IsNullOrWhiteSpace(emp.EmailAddress))
{
string password = MakePassWord(emp.BirthDate);
MailSender mailSender = new MailSender();
mailSender.AddTo(emp.EmailAddress);
mailSender.Subject = "Your HR software Login information";
mailSender.Body = @"Your HR software Login information are following.
<p> <b>Log-in ID : </b> " + emp.EmployeeNo + "</p>";
mailSender.Body += "<p> <b>Password : </b> " + password.Trim() + "</p>";
mailSender.ThreadSendMail(st);
}
}
}
catch (Exception e)
{
// The roles are already approved; a mail failure must not undo that.
ExceptionLog.Write(e);
}
}
#endregion
internal int Save(TransactionContext tc, UserRole oUserRole, int userRoleID)
{
try

View File

@ -53,7 +53,7 @@ namespace HRM.DA
oUser.ChangePasswordAtNextLogon = oReader.GetBoolean("ChangePasswordAtNextLogon", false);
oUser.EmployeeID = oReader.GetInt32("EmployeeID");
oUser.Email = oReader.GetString("Email", true, string.Empty);
// oUser.EmailAddress = oReader.GetString("EmailAddress", true, null);
oUser.EmailAddress = oReader.GetString("EmailAddress", true, null);
// oUser.LogInPayrollTypeID = oReader.GetInt32("PAYROLLTYPEID", 0);
// oUser.ChangePasswordAtNextLogon = oReader.GetBoolean("ChangePasswordAtNextLogon").Value;
//oUser.NeverExpire = oReader.GetBoolean("NeverExpire").Value;
@ -437,7 +437,9 @@ namespace HRM.DA
UserLogInInfo login = new UserLogInInfo();
login.UserID = userID;
login.LoginTime = DateTime.Now;
UserLogInInfoService.CaptureRequestInfo(login); // on the request thread, before the save thread
login.PCNumber = Environment.MachineName + " ," +
System.Net.Dns.GetHostName() + " ," +
Environment.GetEnvironmentVariable("COMPUTERNAME");
Thread myNewThread = new Thread(() => SaveLoginfo(login));
myNewThread.Start();
}
@ -494,7 +496,6 @@ namespace HRM.DA
login.UserID = oUser.ID;
login.LoginTime = DateTime.Now;
UserLogInInfoService.CaptureRequestInfo(login); // on the request thread, before the save thread
Thread myNewThread = new Thread(() => SaveLoginfo(login));
myNewThread.Start();
@ -551,7 +552,6 @@ namespace HRM.DA
login.UserID = oUser.ID;
login.LoginTime = DateTime.Now;
UserLogInInfoService.CaptureRequestInfo(login); // on the request thread, before the save thread
Thread myNewThread = new Thread(() => SaveLoginfo(login));
myNewThread.Start();
}
@ -589,7 +589,6 @@ namespace HRM.DA
login.UserID = oUser.ID;
login.LoginTime = DateTime.Now;
login.PCNumber = hostName;
UserLogInInfoService.CaptureRequestInfo(login); // on the request thread, before the save thread
Thread myNewThread = new Thread(() => SaveLoginfo(login));
myNewThread.Start();
}
@ -641,10 +640,9 @@ namespace HRM.DA
public void SaveLoginfo(UserLogInInfo oTran)
{
// PCNumber used to be Environment.MachineName / Dns.GetHostName() - the web
// SERVER's name, the same for every login. UserLogInInfoService.Save now fills it
// with the client's computer name (reverse DNS of its IP) unless the caller set it
// (GetByLoginIDAndPasswordAndHostName passes the host name it was given).
oTran.PCNumber = Environment.MachineName + " ," +
System.Net.Dns.GetHostName() + " ," +
Environment.GetEnvironmentVariable("COMPUTERNAME");
new UserLogInInfoService().Save(oTran);
//if(GlobalFunctions.defaultConfigVal == null)
//{
@ -809,27 +807,15 @@ namespace HRM.DA
TransactionContext tc = null;
try
{
// The login as it is before this change: rejecting a new Employee login (Status 2) also rejects
// its role changes waiting in User Role Permission (below), so the two never disagree.
User before = this.Get(oUser.ID);
tc = TransactionContext.Begin(true);
UserDA.DoActiveAndIntacive(tc, oUser);
if (before != null && before.UserType == EnumUserType.Employee
&& before.UserStatus == EnumAuthStatus.NewNotYetApprove
&& oUser.UserStatus == EnumAuthStatus.Rejected)
{
new UserRoleService().RejectPendingRolesOfLogin(tc, oUser.ID);
}
tc.End();
}
catch (Exception ex)
{
if (tc != null)
tc.HandleError();
throw new Exception(ex.Message);
}
@ -997,16 +983,7 @@ namespace HRM.DA
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
// Unique index Unique_EmpNo on dbo.USERS: this employee already has a user.
for (Exception inner = e; inner != null; inner = inner.InnerException)
{
if (inner.Message.IndexOf("Cannot insert duplicate key row", StringComparison.OrdinalIgnoreCase) >= 0
&& inner.Message.IndexOf("Unique_EmpNo", StringComparison.OrdinalIgnoreCase) >= 0)
throw new ServiceException("User already exist in the system", e);
}
throw new ServiceException("Failed to Create/Update user.", e);
throw new ServiceException(e.Message, e);
#endregion
}
}
@ -1058,13 +1035,8 @@ namespace HRM.DA
public void Approve(User oUser)
{
TransactionContext tc = null;
User before = null;
try
{
// The login as it is before this approval: a new login (Status 2) being switched on may need
// its login e-mail (below).
before = this.Get(oUser.ID);
tc = TransactionContext.Begin(true);
UserDA.Approve(tc, oUser);
tc.End();
@ -1078,14 +1050,6 @@ namespace HRM.DA
throw new ServiceException(e.Message, e);
#endregion
}
// A new Self Service employee login (made by User Role Permission) approved here gets the same
// login e-mail it gets when its roles are approved first; MailNewEmployeeLogin decides and never throws.
if (before != null && before.UserStatus == EnumAuthStatus.NewNotYetApprove
&& oUser.UserStatus == EnumAuthStatus.Approved)
{
new UserRoleService().MailNewEmployeeLogin(before);
}
}
@ -1180,7 +1144,6 @@ namespace HRM.DA
login.UserID = oUser.ID;
login.LoginTime = DateTime.Now;
UserLogInInfoService.CaptureRequestInfo(login); // on the request thread, before the save thread
Thread myNewThread = new Thread(() => SaveLoginfo(login));
myNewThread.Start();
}

View File

@ -64,14 +64,13 @@
"date-fns": "^4.4.0",
"exceljs": "^4.4.0",
"file-saver": "^2.0.5",
"fix": "^0.0.3",
"hammerjs": "^2.0.8",
"ng2-pdf-viewer": "^10.4.0",
"ngx-extended-pdf-viewer": "^31.0.1",
"primeflex": "^4.0.0",
"primeicons": "^7.0.0",
"prismjs": "^1.30.0",
"quill": "^2.0.2",
"quill": "^2.0.3",
"rxjs": "^7.8.2",
"sweetalert2": "^11.26.25",
"tslib": "^2.9.1",
@ -80,8 +79,8 @@
},
"devDependencies": {
"@angular-eslint/builder": "^22.6.0",
"@angular-eslint/eslint-plugin": "^17.1.1",
"@angular-eslint/eslint-plugin-template": "^17.1.1",
"@angular-eslint/eslint-plugin": "^22.6.0",
"@angular-eslint/eslint-plugin-template": "^22.6.0",
"@angular-eslint/template-parser": "^22.6.0",
"@angular/build": "^22.2.5",
"@angular/cli": "^22.2.5",
@ -202,163 +201,42 @@
"license": "MIT"
},
"node_modules/@angular-eslint/eslint-plugin": {
"version": "17.1.1",
"resolved": "https://registry.npmjs.org/@angular-eslint/eslint-plugin/-/eslint-plugin-17.1.1.tgz",
"integrity": "sha512-fFOBlCOVObVu3gjLj+0BypqO1ZR/0bfJnDElqMdYwJG7zRaFT8NNQbrOo/q/GQoqOFoNna6mw3teTGsd5JnL2A==",
"version": "22.6.0",
"resolved": "https://registry.npmjs.org/@angular-eslint/eslint-plugin/-/eslint-plugin-22.6.0.tgz",
"integrity": "sha512-zLQSfwNiOaWYp1IRQh4TlgBbUmaGm0OWNEO98E2U9DstHJTPTghRwG4wZX4Ly/YOYsb3WU06pD1/cCRUYHRgmw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@angular-eslint/utils": "17.1.1",
"@typescript-eslint/utils": "6.13.1"
"@angular-eslint/bundled-angular-compiler": "22.6.0",
"@angular-eslint/utils": "22.6.0",
"ts-api-utils": "^2.1.0"
},
"peerDependencies": {
"eslint": "^7.20.0 || ^8.0.0",
"@typescript-eslint/utils": "^8.0.0",
"eslint": "^9.0.0 || ^10.0.0",
"typescript": "*"
}
},
"node_modules/@angular-eslint/eslint-plugin-template": {
"version": "17.1.1",
"resolved": "https://registry.npmjs.org/@angular-eslint/eslint-plugin-template/-/eslint-plugin-template-17.1.1.tgz",
"integrity": "sha512-unZ6QNwtxuB8Eni7UPdw7uK6iZipZUXIsH+ZuLMOxwFgGMqeRnpv8SW0212rto3d/Ec0jESzVHKcwZ9pT+jxgw==",
"version": "22.6.0",
"resolved": "https://registry.npmjs.org/@angular-eslint/eslint-plugin-template/-/eslint-plugin-template-22.6.0.tgz",
"integrity": "sha512-e3ueYzr1ARovQtoBaiAeYtLR3MLIeJNKA46LBwKbRhVl1S8L1FiwYsWJvx0lRvcgdFWFt+WrSXeTxuc0ITW9eA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@angular-eslint/bundled-angular-compiler": "17.1.1",
"@angular-eslint/utils": "17.1.1",
"@typescript-eslint/type-utils": "6.13.1",
"@typescript-eslint/utils": "6.13.1",
"aria-query": "5.3.0",
"axobject-query": "4.0.0"
"@angular-eslint/bundled-angular-compiler": "22.6.0",
"@angular-eslint/utils": "22.6.0",
"aria-query": "5.3.2",
"axobject-query": "4.1.0"
},
"peerDependencies": {
"eslint": "^7.20.0 || ^8.0.0",
"@angular-eslint/template-parser": "22.6.0",
"@typescript-eslint/types": "^8.0.0",
"@typescript-eslint/utils": "^8.0.0",
"eslint": "^9.0.0 || ^10.0.0",
"typescript": "*"
}
},
"node_modules/@angular-eslint/eslint-plugin-template/node_modules/@angular-eslint/bundled-angular-compiler": {
"version": "17.1.1",
"resolved": "https://registry.npmjs.org/@angular-eslint/bundled-angular-compiler/-/bundled-angular-compiler-17.1.1.tgz",
"integrity": "sha512-xRlSh9qjdUdUKAy/0UQsxX7wf1tHApAsHsfismebPriqfmVAPyEg4HBrM8ImWaZxiqaTGC1AyHsUBQD5FK8o6w==",
"dev": true,
"license": "MIT"
},
"node_modules/@angular-eslint/eslint-plugin-template/node_modules/@angular-eslint/utils": {
"version": "17.1.1",
"resolved": "https://registry.npmjs.org/@angular-eslint/utils/-/utils-17.1.1.tgz",
"integrity": "sha512-CTNPOb05S/DII/Fm8JYUvKo+B4u/ctHjGJ0X1YXUR0q31oaGqTE3KePGq76+Y6swRDf9NjUIcfcnZp3u3j4CBQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@angular-eslint/bundled-angular-compiler": "17.1.1",
"@typescript-eslint/utils": "6.13.1"
},
"peerDependencies": {
"eslint": "^7.20.0 || ^8.0.0",
"typescript": "*"
}
},
"node_modules/@angular-eslint/eslint-plugin-template/node_modules/@typescript-eslint/type-utils": {
"version": "6.13.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.13.1.tgz",
"integrity": "sha512-A2qPlgpxx2v//3meMqQyB1qqTg1h1dJvzca7TugM3Yc2USDY+fsRBiojAEo92HO7f5hW5mjAUF6qobOPzlBCBQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/typescript-estree": "6.13.1",
"@typescript-eslint/utils": "6.13.1",
"debug": "^4.3.4",
"ts-api-utils": "^1.0.1"
},
"engines": {
"node": "^16.0.0 || >=18.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"eslint": "^7.0.0 || ^8.0.0"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
}
}
},
"node_modules/@angular-eslint/eslint-plugin-template/node_modules/@typescript-eslint/utils": {
"version": "6.13.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.13.1.tgz",
"integrity": "sha512-ouPn/zVoan92JgAegesTXDB/oUp6BP1v8WpfYcqh649ejNc9Qv+B4FF2Ff626kO1xg0wWwwG48lAJ4JuesgdOw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
"@types/json-schema": "^7.0.12",
"@types/semver": "^7.5.0",
"@typescript-eslint/scope-manager": "6.13.1",
"@typescript-eslint/types": "6.13.1",
"@typescript-eslint/typescript-estree": "6.13.1",
"semver": "^7.5.4"
},
"engines": {
"node": "^16.0.0 || >=18.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"eslint": "^7.0.0 || ^8.0.0"
}
},
"node_modules/@angular-eslint/eslint-plugin/node_modules/@angular-eslint/bundled-angular-compiler": {
"version": "17.1.1",
"resolved": "https://registry.npmjs.org/@angular-eslint/bundled-angular-compiler/-/bundled-angular-compiler-17.1.1.tgz",
"integrity": "sha512-xRlSh9qjdUdUKAy/0UQsxX7wf1tHApAsHsfismebPriqfmVAPyEg4HBrM8ImWaZxiqaTGC1AyHsUBQD5FK8o6w==",
"dev": true,
"license": "MIT"
},
"node_modules/@angular-eslint/eslint-plugin/node_modules/@angular-eslint/utils": {
"version": "17.1.1",
"resolved": "https://registry.npmjs.org/@angular-eslint/utils/-/utils-17.1.1.tgz",
"integrity": "sha512-CTNPOb05S/DII/Fm8JYUvKo+B4u/ctHjGJ0X1YXUR0q31oaGqTE3KePGq76+Y6swRDf9NjUIcfcnZp3u3j4CBQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@angular-eslint/bundled-angular-compiler": "17.1.1",
"@typescript-eslint/utils": "6.13.1"
},
"peerDependencies": {
"eslint": "^7.20.0 || ^8.0.0",
"typescript": "*"
}
},
"node_modules/@angular-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": {
"version": "6.13.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.13.1.tgz",
"integrity": "sha512-ouPn/zVoan92JgAegesTXDB/oUp6BP1v8WpfYcqh649ejNc9Qv+B4FF2Ff626kO1xg0wWwwG48lAJ4JuesgdOw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
"@types/json-schema": "^7.0.12",
"@types/semver": "^7.5.0",
"@typescript-eslint/scope-manager": "6.13.1",
"@typescript-eslint/types": "6.13.1",
"@typescript-eslint/typescript-estree": "6.13.1",
"semver": "^7.5.4"
},
"engines": {
"node": "^16.0.0 || >=18.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"eslint": "^7.0.0 || ^8.0.0"
}
},
"node_modules/@angular-eslint/template-parser": {
"version": "22.6.0",
"resolved": "https://registry.npmjs.org/@angular-eslint/template-parser/-/template-parser-22.6.0.tgz",
@ -374,6 +252,21 @@
"typescript": "*"
}
},
"node_modules/@angular-eslint/utils": {
"version": "22.6.0",
"resolved": "https://registry.npmjs.org/@angular-eslint/utils/-/utils-22.6.0.tgz",
"integrity": "sha512-Nd5pZGgkBTvcCNMBt88iG6r/Tzk1XTWHpQQccwYUWYhz4PMim0yyXAEvqAabxag8S9iLPUEufpaOw20OOxNJ3w==",
"dev": true,
"license": "MIT",
"dependencies": {
"@angular-eslint/bundled-angular-compiler": "22.6.0"
},
"peerDependencies": {
"@typescript-eslint/utils": "^8.0.0",
"eslint": "^9.0.0 || ^10.0.0",
"typescript": "*"
}
},
"node_modules/@angular/animations": {
"version": "22.2.4",
"resolved": "https://registry.npmjs.org/@angular/animations/-/animations-22.2.4.tgz",
@ -3847,44 +3740,6 @@
"@emnapi/runtime": "^1.7.1 || 2.0.0-beta.2"
}
},
"node_modules/@nodelib/fs.scandir": {
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
"integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
"dev": true,
"license": "MIT",
"dependencies": {
"@nodelib/fs.stat": "2.0.5",
"run-parallel": "^1.1.9"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/@nodelib/fs.stat": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
"integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 8"
}
},
"node_modules/@nodelib/fs.walk": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
"integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@nodelib/fs.scandir": "2.1.5",
"fastq": "^1.6.0"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/@oxc-parser/binding-android-arm-eabi": {
"version": "0.150.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-android-arm-eabi/-/binding-android-arm-eabi-0.150.0.tgz",
@ -6182,32 +6037,75 @@
"@types/node": "*"
}
},
"node_modules/@typescript-eslint/scope-manager": {
"version": "6.13.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.13.1.tgz",
"integrity": "sha512-BW0kJ7ceiKi56GbT2KKzZzN+nDxzQK2DS6x0PiSMPjciPgd/JRQGMibyaN2cPt2cAvuoH0oNvn2fwonHI+4QUQ==",
"node_modules/@typescript-eslint/project-service": {
"version": "8.72.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.72.1.tgz",
"integrity": "sha512-fAuVMkwdO/huI8nyo/WKnNKf6Gag93S56Rh3Ts5mGcavwSdaN8tRg1gCeIGX8PF+nzp1BjGfO4gHhGzW1J6jTg==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@typescript-eslint/types": "6.13.1",
"@typescript-eslint/visitor-keys": "6.13.1"
"@typescript-eslint/tsconfig-utils": "^8.72.1",
"@typescript-eslint/types": "^8.72.1",
"debug": "^4.4.3"
},
"engines": {
"node": "^16.0.0 || >=18.0.0"
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/@typescript-eslint/scope-manager": {
"version": "8.72.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.72.1.tgz",
"integrity": "sha512-lC/t6eMCZZQAAKZEYGL6RDVSuFehpdmMT6h+nJIjIa6oylN/PwDgDVtEIbB7O9xFfZYtZAYLoLlDNWKJhtF+uQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@typescript-eslint/types": "8.72.1",
"@typescript-eslint/visitor-keys": "8.72.1"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
}
},
"node_modules/@typescript-eslint/types": {
"version": "6.13.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.13.1.tgz",
"integrity": "sha512-gjeEskSmiEKKFIbnhDXUyiqVma1gRCQNbVZ1C8q7Zjcxh3WZMbzWVfGE9rHfWd1msQtPS0BVD9Jz9jded44eKg==",
"node_modules/@typescript-eslint/tsconfig-utils": {
"version": "8.72.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.72.1.tgz",
"integrity": "sha512-e4D5R5vpeAEPBxT2BAzsFQL3sbwyeeeo5+aczgNSRK1V734jE7pTqaGFU+fXapWEQwnZbpFaTn32+Z8DwS6OTg==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": "^16.0.0 || >=18.0.0"
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/@typescript-eslint/types": {
"version": "8.72.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.72.1.tgz",
"integrity": "sha512-LmE5IhQet1BWOWEXqBrVtBPsMAOQ6Nzk35d+WLh3mk4EUF33sqlfxjio1MdYeSvKSG5skactKKuixBIKXhL4Rw==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
@ -6215,51 +6113,92 @@
}
},
"node_modules/@typescript-eslint/typescript-estree": {
"version": "6.13.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.13.1.tgz",
"integrity": "sha512-sBLQsvOC0Q7LGcUHO5qpG1HxRgePbT6wwqOiGLpR8uOJvPJbfs0mW3jPA3ujsDvfiVwVlWUDESNXv44KtINkUQ==",
"version": "8.72.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.72.1.tgz",
"integrity": "sha512-DAlUoUV93hIvrtIQLwCbmZQYVZwOMhiHJrOVUUIWicFZaIYjTRqlY3I/NZevfkLmSqkNHRu2qYDcq9lrn16oOQ==",
"dev": true,
"license": "BSD-2-Clause",
"license": "MIT",
"peer": true,
"dependencies": {
"@typescript-eslint/types": "6.13.1",
"@typescript-eslint/visitor-keys": "6.13.1",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",
"semver": "^7.5.4",
"ts-api-utils": "^1.0.1"
"@typescript-eslint/project-service": "8.72.1",
"@typescript-eslint/tsconfig-utils": "8.72.1",
"@typescript-eslint/types": "8.72.1",
"@typescript-eslint/visitor-keys": "8.72.1",
"debug": "^4.4.3",
"minimatch": "^10.2.2",
"semver": "^7.7.3",
"tinyglobby": "^0.2.15",
"ts-api-utils": "^2.5.0"
},
"engines": {
"node": "^16.0.0 || >=18.0.0"
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
"peerDependencies": {
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/@typescript-eslint/utils": {
"version": "8.72.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.72.1.tgz",
"integrity": "sha512-5v5liypurJBFHCBNqh/RjsymAD+VWcE0djuGY/BUqp5fC3Qn+luWDEksjuTtWjPn6i5zQlUtkZCRG/CYG0yCkA==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.9.1",
"@typescript-eslint/scope-manager": "8.72.1",
"@typescript-eslint/types": "8.72.1",
"@typescript-eslint/typescript-estree": "8.72.1"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/@typescript-eslint/visitor-keys": {
"version": "6.13.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.13.1.tgz",
"integrity": "sha512-NDhQUy2tg6XGNBGDRm1XybOHSia8mcXmlbKWoQP+nm1BIIMxa55shyJfZkHpEBN62KNPLrocSM2PdPcaLgDKMQ==",
"version": "8.72.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.72.1.tgz",
"integrity": "sha512-SB8xqipSzZHUePCCLNeYxqnxq83X61/qzNhjQGbTfjxGZIeOEP7tBgWYX05Tcd6CgE02WdTJnh5b8kMZJ/+bnQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@typescript-eslint/types": "6.13.1",
"eslint-visitor-keys": "^3.4.1"
"@typescript-eslint/types": "8.72.1",
"eslint-visitor-keys": "^5.0.0"
},
"engines": {
"node": "^16.0.0 || >=18.0.0"
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
}
},
"node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz",
"integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==",
"dev": true,
"license": "Apache-2.0",
"peer": true,
"engines": {
"node": "^20.19.0 || ^22.13.0 || >=24"
},
"funding": {
"url": "https://opencollective.com/eslint"
}
},
"node_modules/@vitejs/plugin-basic-ssl": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/@vitejs/plugin-basic-ssl/-/plugin-basic-ssl-2.3.0.tgz",
@ -6541,13 +6480,13 @@
"license": "Python-2.0"
},
"node_modules/aria-query": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz",
"integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==",
"version": "5.3.2",
"resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz",
"integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"dequal": "^2.0.3"
"engines": {
"node": ">= 0.4"
}
},
"node_modules/array-buffer-byte-length": {
@ -6589,16 +6528,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/array-union": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz",
"integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/array.prototype.findlastindex": {
"version": "1.2.6",
"resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.6.tgz",
@ -6711,13 +6640,13 @@
}
},
"node_modules/axobject-query": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.0.0.tgz",
"integrity": "sha512-+60uv1hiVFhHZeO+Lz0RYzsVHy5Wr1ayX0mwda9KPDVLNJgZ1T9Ny7VmFbLDzxsH0D87I86vgj3gFrjTJUYznw==",
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz",
"integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"dequal": "^2.0.3"
"engines": {
"node": ">= 0.4"
}
},
"node_modules/balanced-match": {
@ -7703,16 +7632,6 @@
"node": ">= 0.8"
}
},
"node_modules/dequal": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
"integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/destroy": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz",
@ -7741,19 +7660,6 @@
"dev": true,
"license": "MIT"
},
"node_modules/dir-glob": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
"integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==",
"dev": true,
"license": "MIT",
"dependencies": {
"path-type": "^4.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/doctrine": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz",
@ -8771,36 +8677,6 @@
"integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==",
"license": "Apache-2.0"
},
"node_modules/fast-glob": {
"version": "3.3.3",
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz",
"integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@nodelib/fs.stat": "^2.0.2",
"@nodelib/fs.walk": "^1.2.3",
"glob-parent": "^5.1.2",
"merge2": "^1.3.0",
"micromatch": "^4.0.8"
},
"engines": {
"node": ">=8.6.0"
}
},
"node_modules/fast-glob/node_modules/glob-parent": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
"dev": true,
"license": "ISC",
"dependencies": {
"is-glob": "^4.0.1"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/fast-json-stable-stringify": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
@ -8858,16 +8734,6 @@
"fast-string-width": "^3.0.2"
}
},
"node_modules/fastq": {
"version": "1.20.3",
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.3.tgz",
"integrity": "sha512-XKv5nnLs6nLF71NgiKJLIZFLkPyIEuOselLG7ujZnGrRfQK8HpvY+WqKhAJUAdLomwVHErVS4LfxFlPq0/FTAw==",
"dev": true,
"license": "ISC",
"dependencies": {
"reusify": "^1.0.4"
}
},
"node_modules/fdir": {
"version": "6.5.0",
"resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
@ -8935,17 +8801,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/fix": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/fix/-/fix-0.0.3.tgz",
"integrity": "sha512-nDbGTpfpPiWYuJ2qwrF2Qxqga8ANe3BV31vFA943FmEvX9iUROH3YmCOM4aq3DPZWF2WsKHoH9+Gw3qLdXfcSA==",
"dependencies": {
"pipe": "0.0.1"
},
"engines": {
"node": "0.2.5"
}
},
"node_modules/flat-cache": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz",
@ -9350,27 +9205,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/globby": {
"version": "11.1.0",
"resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz",
"integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==",
"dev": true,
"license": "MIT",
"dependencies": {
"array-union": "^2.1.0",
"dir-glob": "^3.0.1",
"fast-glob": "^3.2.9",
"ignore": "^5.2.0",
"merge2": "^1.4.1",
"slash": "^3.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/gopd": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
@ -11688,43 +11522,6 @@
"node": ">= 0.4"
}
},
"node_modules/merge2": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
"integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 8"
}
},
"node_modules/micromatch": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
"integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
"dev": true,
"license": "MIT",
"dependencies": {
"braces": "^3.0.3",
"picomatch": "^2.3.1"
},
"engines": {
"node": ">=8.6"
}
},
"node_modules/micromatch/node_modules/picomatch": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz",
"integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=8.6"
},
"funding": {
"url": "https://github.com/sponsors/jonschlinkert"
}
},
"node_modules/mime": {
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz",
@ -11763,6 +11560,23 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/minimatch": {
"version": "10.2.6",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz",
"integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==",
"dev": true,
"license": "BlueOak-1.0.0",
"peer": true,
"dependencies": {
"brace-expansion": "^5.0.8"
},
"engines": {
"node": "18 || 20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/minimist": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
@ -12490,16 +12304,6 @@
"node": "20 || >=22"
}
},
"node_modules/path-type": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/path2d": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/path2d/-/path2d-0.2.2.tgz",
@ -12542,14 +12346,6 @@
"url": "https://github.com/sponsors/jonschlinkert"
}
},
"node_modules/pipe": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/pipe/-/pipe-0.0.1.tgz",
"integrity": "sha512-8tESQnbeUKIuET8aTNt3HL0EG7RuPT7C8gDrZ2lK2AjEUi7TOu6NPaJvk2Voe+tc7NkBqe4HRdftDA6w+caAvg==",
"engines": {
"node": "0.2.5"
}
},
"node_modules/piscina": {
"version": "5.3.2",
"resolved": "https://registry.npmjs.org/piscina/-/piscina-5.3.2.tgz",
@ -12756,31 +12552,10 @@
"node": ">=0.9"
}
},
"node_modules/queue-microtask": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
"integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"license": "MIT"
},
"node_modules/quill": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/quill/-/quill-2.0.2.tgz",
"integrity": "sha512-QfazNrhMakEdRG57IoYFwffUIr04LWJxbS/ZkidRFXYCQt63c1gK6Z7IHUXMx/Vh25WgPBU42oBaNzQ0K1R/xw==",
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/quill/-/quill-2.0.3.tgz",
"integrity": "sha512-xEYQBqfYx/sfb33VJiKnSJp8ehloavImQ2A6564GAbqG55PGw1dAWUn1MUbQB62t0azawUS2CZZhWCjO8gRvTw==",
"license": "BSD-3-Clause",
"dependencies": {
"eventemitter3": "^5.0.1",
@ -13047,17 +12822,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/reusify": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz",
"integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==",
"dev": true,
"license": "MIT",
"engines": {
"iojs": ">=1.0.0",
"node": ">=0.10.0"
}
},
"node_modules/rfdc": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz",
@ -13179,30 +12943,6 @@
"url": "https://github.com/sponsors/oxc-project"
}
},
"node_modules/run-parallel": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
"integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"license": "MIT",
"dependencies": {
"queue-microtask": "^1.2.2"
}
},
"node_modules/rxjs": {
"version": "7.8.2",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz",
@ -13921,16 +13661,6 @@
"simple-concat": "^1.0.0"
}
},
"node_modules/slash": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
"integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/slice-ansi": {
"version": "10.0.0",
"resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-10.0.0.tgz",
@ -14425,16 +14155,16 @@
}
},
"node_modules/ts-api-utils": {
"version": "1.4.3",
"resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz",
"integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==",
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz",
"integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=16"
"node": ">=18.12"
},
"peerDependencies": {
"typescript": ">=4.2.0"
"typescript": ">=4.8.4"
}
},
"node_modules/tsconfig-paths": {

View File

@ -66,14 +66,13 @@
"date-fns": "^4.4.0",
"exceljs": "^4.4.0",
"file-saver": "^2.0.5",
"fix": "^0.0.3",
"hammerjs": "^2.0.8",
"ng2-pdf-viewer": "^10.4.0",
"ngx-extended-pdf-viewer": "^31.0.1",
"primeflex": "^4.0.0",
"primeicons": "^7.0.0",
"prismjs": "^1.30.0",
"quill": "^2.0.2",
"quill": "^2.0.3",
"rxjs": "^7.8.2",
"sweetalert2": "^11.26.25",
"tslib": "^2.9.1",
@ -82,8 +81,8 @@
},
"devDependencies": {
"@angular-eslint/builder": "^22.6.0",
"@angular-eslint/eslint-plugin": "^17.1.1",
"@angular-eslint/eslint-plugin-template": "^17.1.1",
"@angular-eslint/eslint-plugin": "^22.6.0",
"@angular-eslint/eslint-plugin-template": "^22.6.0",
"@angular-eslint/template-parser": "^22.6.0",
"@angular/build": "^22.2.5",
"@angular/cli": "^22.2.5",
@ -113,10 +112,6 @@
},
"allowScripts": {
"@progress/kendo-licensing@1.12.0": true,
"esbuild@0.28.2": true,
"canvas@3.2.3": true,
"@parcel/watcher@2.6.0": true,
"lmdb@3.5.6": true,
"msgpackr-extract@3.0.6": true
"esbuild@0.28.2": true
}
}

View File

@ -1,174 +1,25 @@
import { Injectable, EventEmitter } from '@angular/core';
import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, Router, RouterStateSnapshot, UrlTree } from '@angular/router';
import { Observable, of } from 'rxjs';
import { catchError, map, shareReplay } from 'rxjs/operators';
import { CanActivate, Router } from '@angular/router';
import { AuthService } from '../_services/auth/auth.service';
import { HRMNotificationService } from '../app.notification.service';
@Injectable({
providedIn: 'root'
})
export class AuthGuard implements CanActivate, CanActivateChild {
export class AuthGuard implements CanActivate {
public menuEvent: EventEmitter<boolean>;
/**
* Pages every logged-in user may open even when they are not in the user's role menu:
* the home pages that login / the dashboard redirect to, and the forced change-password
* screen (shown before the menu is loaded). Keep these normalized (lower case, no slashes).
*/
private static readonly ALWAYS_ALLOWED: string[] = [
'',
'landing-page',
'ess/ess-dashboard',
'ess/landing-page',
'authentication/change-password',
];
/** Every link that exists in the master menu (all roles), cached per login token. */
private allMenuLinks$: Observable<string[] | null> = null;
private allMenuLinksToken: string = null;
constructor(private authService: AuthService, private router: Router,
private notificationService: HRMNotificationService) {
constructor(private authService: AuthService, private router: Router) {
this.menuEvent = new EventEmitter();
this.authService.logout$.subscribe(() => this.onLogout());
}
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | boolean | UrlTree {
if (!this.authService.loggedIn()) {
canActivate(): boolean {
if (this.authService.loggedIn()) {
return true;
}
// this.alertify.error('You shall not pass!!!');
this.router.navigate(['/login']);
// this.router.navigate(['']);
return false;
}
return this.checkMenuPermission(state.url);
}
canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | boolean | UrlTree {
return this.canActivate(route, state);
}
private checkMenuPermission(url: string): Observable<boolean | UrlTree> | boolean | UrlTree {
debugger;
const target = AuthGuard.normalize(url);
if (AuthGuard.ALWAYS_ALLOWED.indexOf(target) >= 0) {
return true;
}
const userLinks = this.collectLinks(this.getMenuList());
if (userLinks.some(l => AuthGuard.covers(l, target))) {
return true;
}
// The app uses HashLocationStrategy (#/...): editing / pasting a URL in the address bar
// does NOT reload the page, it fires a 'hashchange'/'popstate' navigation. So a direct hit
// is the very first navigation OR any navigation not started by the app's own code.
const trigger = this.router.getCurrentNavigation()?.trigger;
const isDirectHit = !this.router.navigated || trigger !== 'imperative';
if (isDirectHit) {
return this.isVisitedInApp(target) ? true : this.deny();
}
return this.getAllMenuLinks().pipe(
map(allLinks => {
debugger;
if (allLinks !== null && allLinks.some(l => AuthGuard.covers(l, target))) {
return this.deny();
}
// Not a menu screen (or master menu unavailable): allow and remember it.
this.rememberVisitedInApp(target);
return true;
})
);
}
private deny(): UrlTree {
this.notificationService.showError('You do not have permission to access this page.');
return this.router.createUrlTree(['/']);
}
/** Non-menu pages this user reached through in-app navigation, per browser tab. */
private static readonly VISITED_KEY = 'menuGuardVisited';
private getVisited(): { token: string, urls: string[] } {
const token = localStorage.getItem('token');
try {
const data = JSON.parse(sessionStorage.getItem(AuthGuard.VISITED_KEY));
if (data && data.token === token && Array.isArray(data.urls)) {
return data;
}
} catch { }
return { token: token, urls: [] };
}
private isVisitedInApp(target: string): boolean {
return this.getVisited().urls.indexOf(target) >= 0;
}
private rememberVisitedInApp(target: string): void {
const data = this.getVisited();
if (data.urls.indexOf(target) < 0) {
data.urls.push(target);
try { sessionStorage.setItem(AuthGuard.VISITED_KEY, JSON.stringify(data)); } catch { }
}
}
private getAllMenuLinks(): Observable<string[] | null> {
const token = localStorage.getItem('token');
if (this.allMenuLinks$ == null || this.allMenuLinksToken !== token) {
this.allMenuLinksToken = token;
const request$ = this.authService.getMenuesFromConfig().pipe(
map((items: any[]) => this.collectLinks(items)),
catchError(() => {
// Don't keep a failed result - retry on the next navigation.
this.resetMenuCache();
return of(null);
}),
shareReplay(1)
);
this.allMenuLinks$ = request$;
}
return this.allMenuLinks$;
}
private resetMenuCache(): void {
this.allMenuLinks$ = null;
this.allMenuLinksToken = null;
}
private onLogout(): void {
this.resetMenuCache();
sessionStorage.removeItem(AuthGuard.VISITED_KEY);
}
/** Flattens a menu tree (menuList) or a flat RolePermission list into normalized links. */
private collectLinks(items: any[]): string[] {
const links: string[] = [];
const walk = (nodes: any[]) => {
if (!Array.isArray(nodes)) { return; }
for (const node of nodes) {
if (node == null) { continue; }
const link = node.routerLink ?? node.link ?? node.Link;
if (typeof link === 'string') {
const normalized = AuthGuard.normalize(link);
if (normalized !== '') { // the dashboard link "/" must not cover every URL
links.push(normalized);
}
}
walk(node.items);
}
};
walk(items);
return links;
}
/** Lower case, decoded path without query string, fragment, matrix params or edge slashes. */
private static normalize(url: string): string {
let path = (url || '').split('?')[0].split('#')[0];
path = path.split('/').map(seg => seg.split(';')[0]).join('/');
try { path = decodeURIComponent(path); } catch { }
return path.replace(/^\/+|\/+$/g, '').toLowerCase();
}
/** True when the menu link is the target itself or a parent path of it (segment boundary). */
private static covers(link: string, target: string): boolean {
return target === link || target.startsWith(link + '/');
}
public getMenuList(): any {
return JSON.parse(localStorage.getItem('menuList'));
@ -188,8 +39,8 @@ export class AuthGuard implements CanActivate, CanActivateChild {
if (x.label === "") {
if (x.items.length > 0) {
for (let i = 0; i < x.items.length; i++) {
if (x.items[i].label === "Dash-Board") {
x.label = "Dash-Board";
if (x.items[i].label === "Dashboard") {
x.label = "Dashboard";
x.items = null;
x.routerLink = "/";
break;
@ -202,6 +53,7 @@ export class AuthGuard implements CanActivate, CanActivateChild {
menuKey:menu.menuCode || '',
label: menu.label || '',
icon: menu.icon || null,
dividerAfter: menu.dividerAfter || false,
routerLink: menu.routerLink || null,
items: menu.items ? this.transformMenuData(menu.items) : null
}));

View File

@ -1,7 +1,28 @@
import { BaseObject } from '../Basic/baseObject';
export class AllowanceDeduction extends BaseObject {
constructor() {
super();
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.AllowanceDeduction = void 0;
var baseObject_1 = require("../Basic/baseObject");
var AllowanceDeduction = /** @class */ (function (_super) {
__extends(AllowanceDeduction, _super);
function AllowanceDeduction() {
return _super.call(this) || this;
}
}
return AllowanceDeduction;
}(baseObject_1.BaseObject));
exports.AllowanceDeduction = AllowanceDeduction;
//# sourceMappingURL=allow-deduct.js.map

View File

@ -1 +1 @@
{"version":3,"file":"allow-deduct.js","sourceRoot":"","sources":["allow-deduct.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAE/C,MAAM,OAAO,kBAAmB,SAAQ,UAAU;IAC9C;QACI,KAAK,EAAE,CAAC;IACZ,CAAC;CAIJ"}
{"version":3,"file":"allow-deduct.js","sourceRoot":"","sources":["allow-deduct.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,kDAA+C;AAE/C;IAAwC,sCAAU;IAC9C;QACI,OAAA,MAAK,WAAE,SAAC;IACZ,CAAC;IAIL,yBAAC;AAAD,CAAC,AAPD,CAAwC,uBAAU,GAOjD;AAPY,gDAAkB"}

View File

@ -1,5 +1,8 @@
export class updateRosterModel {
constructor() {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateRosterModel = void 0;
var updateRosterModel = /** @class */ (function () {
function updateRosterModel() {
this.empIds = [];
this.fromDate = new Date();
this.toDate = new Date();
@ -13,5 +16,7 @@ export class updateRosterModel {
this.holiday1 = 0;
this.holiday2 = 0;
}
}
return updateRosterModel;
}());
exports.updateRosterModel = updateRosterModel;
//# sourceMappingURL=updateRosterModel.js.map

View File

@ -1 +1 @@
{"version":3,"file":"updateRosterModel.js","sourceRoot":"","sources":["updateRosterModel.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,iBAAiB;IAC1B;QACI,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACzB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC;QACxB,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;QAC3B,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;IACtB,CAAC;CAaJ"}
{"version":3,"file":"updateRosterModel.js","sourceRoot":"","sources":["updateRosterModel.ts"],"names":[],"mappings":";;;AAEA;IACI;QACI,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACzB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC;QACxB,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;QAC3B,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;IACtB,CAAC;IAaL,wBAAC;AAAD,CAAC,AA3BD,IA2BC;AA3BY,8CAAiB"}

View File

@ -1,3 +1,10 @@
export class PayrollComponentList {
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PayrollComponentList = void 0;
var PayrollComponentList = /** @class */ (function () {
function PayrollComponentList() {
}
return PayrollComponentList;
}());
exports.PayrollComponentList = PayrollComponentList;
//# sourceMappingURL=PayrollComponentList.js.map

View File

@ -1 +1 @@
{"version":3,"file":"PayrollComponentList.js","sourceRoot":"","sources":["PayrollComponentList.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,oBAAoB;CAOhC"}
{"version":3,"file":"PayrollComponentList.js","sourceRoot":"","sources":["PayrollComponentList.ts"],"names":[],"mappings":";;;AAEA;IAAA;IAOA,CAAC;IAAD,2BAAC;AAAD,CAAC,AAPD,IAOC;AAPY,oDAAoB"}

View File

@ -1,9 +1,31 @@
import { BaseObject } from '../Basic/baseObject';
export class AccessCard extends BaseObject {
constructor() {
super(...arguments);
this.accessCardType = [];
this.cardOperation = [];
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.AccessCard = void 0;
var baseObject_1 = require("../Basic/baseObject");
var AccessCard = /** @class */ (function (_super) {
__extends(AccessCard, _super);
function AccessCard() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.accessCardType = [];
_this.cardOperation = [];
return _this;
}
}
return AccessCard;
}(baseObject_1.BaseObject));
exports.AccessCard = AccessCard;
//# sourceMappingURL=accessCard.js.map

View File

@ -1 +1 @@
{"version":3,"file":"accessCard.js","sourceRoot":"","sources":["accessCard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAMjD,MAAM,OAAO,UAAW,SAAQ,UAAU;IAA1C;;QAII,mBAAc,GAAqB,EAAE,CAAC;QACtC,kBAAa,GAAoB,EAAE,CAAC;IAExC,CAAC;CAAA"}
{"version":3,"file":"accessCard.js","sourceRoot":"","sources":["accessCard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,kDAAiD;AAMjD;IAAgC,8BAAU;IAA1C;;QAII,oBAAc,GAAqB,EAAE,CAAC;QACtC,mBAAa,GAAoB,EAAE,CAAC;;IAExC,CAAC;IAAD,iBAAC;AAAD,CAAC,AAPD,CAAgC,uBAAU,GAOzC;AAPY,gCAAU"}

View File

@ -1,3 +1,10 @@
export class AccessCardType {
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AccessCardType = void 0;
var AccessCardType = /** @class */ (function () {
function AccessCardType() {
}
return AccessCardType;
}());
exports.AccessCardType = AccessCardType;
//# sourceMappingURL=accessCardType.js.map

View File

@ -1 +1 @@
{"version":3,"file":"accessCardType.js","sourceRoot":"","sources":["accessCardType.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,cAAc;CAK1B"}
{"version":3,"file":"accessCardType.js","sourceRoot":"","sources":["accessCardType.ts"],"names":[],"mappings":";;;AAGA;IAAA;IAKA,CAAC;IAAD,qBAAC;AAAD,CAAC,AALD,IAKC;AALY,wCAAc"}

View File

@ -1,10 +1,32 @@
import { BaseObject } from '../Basic/baseObject';
export class ActingResponsibilitySetup extends BaseObject {
constructor() {
super();
this.fromDate = new Date();
this.toDate = new Date();
this.remarks = "";
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.ActingResponsibilitySetup = void 0;
var baseObject_1 = require("../Basic/baseObject");
var ActingResponsibilitySetup = /** @class */ (function (_super) {
__extends(ActingResponsibilitySetup, _super);
function ActingResponsibilitySetup() {
var _this = _super.call(this) || this;
_this.fromDate = new Date();
_this.toDate = new Date();
_this.remarks = "";
return _this;
}
}
return ActingResponsibilitySetup;
}(baseObject_1.BaseObject));
exports.ActingResponsibilitySetup = ActingResponsibilitySetup;
//# sourceMappingURL=actingResponsibilitySetup.js.map

View File

@ -1 +1 @@
{"version":3,"file":"actingResponsibilitySetup.js","sourceRoot":"","sources":["actingResponsibilitySetup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,MAAM,OAAO,yBAA0B,SAAQ,UAAU;IAErD;QACI,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACzB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACtB,CAAC;CAeJ"}
{"version":3,"file":"actingResponsibilitySetup.js","sourceRoot":"","sources":["actingResponsibilitySetup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,kDAAiD;AAGjD;IAA+C,6CAAU;IAErD;QACI,YAAA,MAAK,WAAE,SAAC;QAER,KAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC;QAC3B,KAAI,CAAC,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACzB,KAAI,CAAC,OAAO,GAAG,EAAE,CAAC;;IACtB,CAAC;IAeL,gCAAC;AAAD,CAAC,AAvBD,CAA+C,uBAAU,GAuBxD;AAvBY,8DAAyB"}

View File

@ -1,5 +1,8 @@
export class AttendanceRegularizationDTO {
constructor() {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AttendanceRegularizationDTO = void 0;
var AttendanceRegularizationDTO = /** @class */ (function () {
function AttendanceRegularizationDTO() {
this.attendanceDate = "";
this.employeeNo = "";
this.empName = "";
@ -11,5 +14,7 @@ export class AttendanceRegularizationDTO {
this.referenceId = 0;
this.reference = "";
}
}
return AttendanceRegularizationDTO;
}());
exports.AttendanceRegularizationDTO = AttendanceRegularizationDTO;
//# sourceMappingURL=attendanceRegularizationDTO.js.map

View File

@ -1 +1 @@
{"version":3,"file":"attendanceRegularizationDTO.js","sourceRoot":"","sources":["attendanceRegularizationDTO.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,2BAA2B;IACpC;QACI,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,mBAAmB,GAAG,EAAE,CAAC;QAC9B,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;IACxB,CAAC;CAoBJ"}
{"version":3,"file":"attendanceRegularizationDTO.js","sourceRoot":"","sources":["attendanceRegularizationDTO.ts"],"names":[],"mappings":";;;AAGA;IACI;QACI,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,mBAAmB,GAAG,EAAE,CAAC;QAC9B,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;IACxB,CAAC;IAoBL,kCAAC;AAAD,CAAC,AAhCD,IAgCC;AAhCY,kEAA2B"}

View File

@ -1,21 +1,43 @@
import { BaseObject } from '../Basic/baseObject';
import { EnumStatus, HolidayType } from '../enums';
export class AttnNationalHoliday extends BaseObject {
constructor() {
super();
this.attnNationalHolidayLocations = [];
this.attnShiftWiseNationalHolidays = [];
this.description = '';
this.fromTime = new Date().toISOString();
this.toTime = new Date().toISOString();
this.fromDate = new Date();
this.toDate = new Date();
this.holidayType = HolidayType.General;
this.holidayHour = undefined;
this.payrollTypeID = undefined;
this.attnNationalHolidayLocations = [];
this.attnShiftWiseNationalHolidays = [];
this.status = EnumStatus.Active;
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.AttnNationalHoliday = void 0;
var baseObject_1 = require("../Basic/baseObject");
var enums_1 = require("../enums");
var AttnNationalHoliday = /** @class */ (function (_super) {
__extends(AttnNationalHoliday, _super);
function AttnNationalHoliday() {
var _this = _super.call(this) || this;
_this.attnNationalHolidayLocations = [];
_this.attnShiftWiseNationalHolidays = [];
_this.description = '';
_this.fromTime = new Date().toISOString();
_this.toTime = new Date().toISOString();
_this.fromDate = new Date();
_this.toDate = new Date();
_this.holidayType = enums_1.HolidayType.General;
_this.holidayHour = undefined;
_this.payrollTypeID = undefined;
_this.attnNationalHolidayLocations = [];
_this.attnShiftWiseNationalHolidays = [];
_this.status = enums_1.EnumStatus.Active;
return _this;
}
}
return AttnNationalHoliday;
}(baseObject_1.BaseObject));
exports.AttnNationalHoliday = AttnNationalHoliday;
//# sourceMappingURL=attnNationalHoliday.js.map

View File

@ -1 +1 @@
{"version":3,"file":"attnNationalHoliday.js","sourceRoot":"","sources":["attnNationalHoliday.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAC,UAAU,EAAE,WAAW,EAAC,MAAM,UAAU,CAAC;AAIjD,MAAM,OAAO,mBAAoB,SAAQ,UAAU;IAC/C;QACI,KAAK,EAAE,CAAC;QAqBZ,iCAA4B,GAAkC,EAAE,CAAC;QACjE,kCAA6B,GAAmC,EAAE,CAAC;QArB/D,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QACvC,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACzB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC;QACvC,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;QAC7B,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/B,IAAI,CAAC,4BAA4B,GAAG,EAAE,CAAC;QACvC,IAAI,CAAC,6BAA6B,GAAG,EAAE,CAAC;QACxC,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IACpC,CAAC;CAcJ"}
{"version":3,"file":"attnNationalHoliday.js","sourceRoot":"","sources":["attnNationalHoliday.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,kDAA+C;AAC/C,kCAAiD;AAIjD;IAAyC,uCAAU;IAC/C;QACI,YAAA,MAAK,WAAE,SAAC;QAqBZ,kCAA4B,GAAkC,EAAE,CAAC;QACjE,mCAA6B,GAAmC,EAAE,CAAC;QArB/D,KAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,KAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QACzC,KAAI,CAAC,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QACvC,KAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC;QAC3B,KAAI,CAAC,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACzB,KAAI,CAAC,WAAW,GAAG,mBAAW,CAAC,OAAO,CAAC;QACvC,KAAI,CAAC,WAAW,GAAG,SAAS,CAAC;QAC7B,KAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/B,KAAI,CAAC,4BAA4B,GAAG,EAAE,CAAC;QACvC,KAAI,CAAC,6BAA6B,GAAG,EAAE,CAAC;QACxC,KAAI,CAAC,MAAM,GAAG,kBAAU,CAAC,MAAM,CAAC;;IACpC,CAAC;IAcL,0BAAC;AAAD,CAAC,AA5BD,CAAyC,uBAAU,GA4BlD;AA5BY,kDAAmB"}

View File

@ -1,9 +1,31 @@
import { BaseObject } from '../Basic/baseObject';
export class AttnNationalHolidayLocation extends BaseObject {
constructor() {
super();
this.attnNationalHolidayID = undefined;
this.locationID = undefined;
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.AttnNationalHolidayLocation = void 0;
var baseObject_1 = require("../Basic/baseObject");
var AttnNationalHolidayLocation = /** @class */ (function (_super) {
__extends(AttnNationalHolidayLocation, _super);
function AttnNationalHolidayLocation() {
var _this = _super.call(this) || this;
_this.attnNationalHolidayID = undefined;
_this.locationID = undefined;
return _this;
}
}
return AttnNationalHolidayLocation;
}(baseObject_1.BaseObject));
exports.AttnNationalHolidayLocation = AttnNationalHolidayLocation;
//# sourceMappingURL=attnNationalHolidayLocation.js.map

View File

@ -1 +1 @@
{"version":3,"file":"attnNationalHolidayLocation.js","sourceRoot":"","sources":["attnNationalHolidayLocation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAE/C,MAAM,OAAO,2BAA4B,SAAQ,UAAU;IACvD;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,qBAAqB,GAAG,SAAS,CAAC;QACvC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAChC,CAAC;CAGJ"}
{"version":3,"file":"attnNationalHolidayLocation.js","sourceRoot":"","sources":["attnNationalHolidayLocation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,kDAA+C;AAE/C;IAAiD,+CAAU;IACvD;QACI,YAAA,MAAK,WAAE,SAAC;QACR,KAAI,CAAC,qBAAqB,GAAG,SAAS,CAAC;QACvC,KAAI,CAAC,UAAU,GAAG,SAAS,CAAC;;IAChC,CAAC;IAGL,kCAAC;AAAD,CAAC,AARD,CAAiD,uBAAU,GAQ1D;AARY,kEAA2B"}

View File

@ -1,3 +1,10 @@
export class AttnRawData {
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AttnRawData = void 0;
var AttnRawData = /** @class */ (function () {
function AttnRawData() {
}
return AttnRawData;
}());
exports.AttnRawData = AttnRawData;
//# sourceMappingURL=attnRawData.js.map

View File

@ -1 +1 @@
{"version":3,"file":"attnRawData.js","sourceRoot":"","sources":["attnRawData.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,WAAW;CAevB"}
{"version":3,"file":"attnRawData.js","sourceRoot":"","sources":["attnRawData.ts"],"names":[],"mappings":";;;AAIA;IAAA;IAeA,CAAC;IAAD,kBAAC;AAAD,CAAC,AAfD,IAeC;AAfY,kCAAW"}

View File

@ -1,10 +1,32 @@
import { BaseObject } from '../Basic/baseObject';
export class AttnShiftWiseNationalHoliday extends BaseObject {
constructor() {
super();
this.aNationalHolidayID = undefined;
this.shiftID = undefined;
this.workPlanGroupID = undefined;
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.AttnShiftWiseNationalHoliday = void 0;
var baseObject_1 = require("../Basic/baseObject");
var AttnShiftWiseNationalHoliday = /** @class */ (function (_super) {
__extends(AttnShiftWiseNationalHoliday, _super);
function AttnShiftWiseNationalHoliday() {
var _this = _super.call(this) || this;
_this.aNationalHolidayID = undefined;
_this.shiftID = undefined;
_this.workPlanGroupID = undefined;
return _this;
}
}
return AttnShiftWiseNationalHoliday;
}(baseObject_1.BaseObject));
exports.AttnShiftWiseNationalHoliday = AttnShiftWiseNationalHoliday;
//# sourceMappingURL=attnShiftWiseNationalHoliday.js.map

View File

@ -1 +1 @@
{"version":3,"file":"attnShiftWiseNationalHoliday.js","sourceRoot":"","sources":["attnShiftWiseNationalHoliday.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAE/C,MAAM,OAAO,4BAA6B,SAAQ,UAAU;IACxD;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;QACpC,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;QACzB,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;IACrC,CAAC;CAIJ"}
{"version":3,"file":"attnShiftWiseNationalHoliday.js","sourceRoot":"","sources":["attnShiftWiseNationalHoliday.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,kDAA+C;AAE/C;IAAkD,gDAAU;IACxD;QACI,YAAA,MAAK,WAAE,SAAC;QACR,KAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;QACpC,KAAI,CAAC,OAAO,GAAG,SAAS,CAAC;QACzB,KAAI,CAAC,eAAe,GAAG,SAAS,CAAC;;IACrC,CAAC;IAIL,mCAAC;AAAD,CAAC,AAVD,CAAkD,uBAAU,GAU3D;AAVY,oEAA4B"}

View File

@ -1,3 +1,10 @@
export class AttnWiseAllowance {
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AttnWiseAllowance = void 0;
var AttnWiseAllowance = /** @class */ (function () {
function AttnWiseAllowance() {
}
return AttnWiseAllowance;
}());
exports.AttnWiseAllowance = AttnWiseAllowance;
//# sourceMappingURL=attnWiseAllowance%20.js.map

View File

@ -1 +1 @@
{"version":3,"file":"attnWiseAllowance .js","sourceRoot":"","sources":["attnWiseAllowance .ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,iBAAiB;CAuB7B"}
{"version":3,"file":"attnWiseAllowance .js","sourceRoot":"","sources":["attnWiseAllowance .ts"],"names":[],"mappings":";;;AAGA;IAAA;IAuBA,CAAC;IAAD,wBAAC;AAAD,CAAC,AAvBD,IAuBC;AAvBY,8CAAiB"}

View File

@ -1,7 +1,28 @@
import { BaseObject } from '../Basic/baseObject';
export class CardOperation extends BaseObject {
constructor() {
super();
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.CardOperation = void 0;
var baseObject_1 = require("../Basic/baseObject");
var CardOperation = /** @class */ (function (_super) {
__extends(CardOperation, _super);
function CardOperation() {
return _super.call(this) || this;
}
}
return CardOperation;
}(baseObject_1.BaseObject));
exports.CardOperation = CardOperation;
//# sourceMappingURL=cardOperation.js.map

View File

@ -1 +1 @@
{"version":3,"file":"cardOperation.js","sourceRoot":"","sources":["cardOperation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAOjD,MAAM,OAAO,aAAc,SAAQ,UAAU;IAEzC;QACI,KAAK,EAAE,CAAC;IACZ,CAAC;CAiBJ"}
{"version":3,"file":"cardOperation.js","sourceRoot":"","sources":["cardOperation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,kDAAiD;AAOjD;IAAmC,iCAAU;IAEzC;QACI,OAAA,MAAK,WAAE,SAAC;IACZ,CAAC;IAiBL,oBAAC;AAAD,CAAC,AArBD,CAAmC,uBAAU,GAqB5C;AArBY,sCAAa"}

View File

@ -1,4 +1,28 @@
import { BaseObject } from '../Basic/baseObject';
export class EmployeeCordinator extends BaseObject {
}
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.EmployeeCordinator = void 0;
var baseObject_1 = require("../Basic/baseObject");
var EmployeeCordinator = /** @class */ (function (_super) {
__extends(EmployeeCordinator, _super);
function EmployeeCordinator() {
return _super !== null && _super.apply(this, arguments) || this;
}
return EmployeeCordinator;
}(baseObject_1.BaseObject));
exports.EmployeeCordinator = EmployeeCordinator;
//# sourceMappingURL=employeeCordinator.js.map

View File

@ -1 +1 @@
{"version":3,"file":"employeeCordinator.js","sourceRoot":"","sources":["employeeCordinator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAMjD,MAAM,OAAO,kBAAmB,SAAQ,UAAU;CASjD"}
{"version":3,"file":"employeeCordinator.js","sourceRoot":"","sources":["employeeCordinator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,kDAAiD;AAMjD;IAAwC,sCAAU;IAAlD;;IASA,CAAC;IAAD,yBAAC;AAAD,CAAC,AATD,CAAwC,uBAAU,GASjD;AATY,gDAAkB"}

View File

@ -1,19 +1,41 @@
import { BaseObject } from '../Basic/baseObject';
import { Employee } from '../Employee/employee';
import { OutsideDuty } from './outsideDuty';
export class EmployeeOutsideDuty extends BaseObject {
constructor() {
super();
this.employeeID = undefined;
this.employeeNo = '';
this.employeeName = '';
this.employee = new Employee();
this.entryDate = new Date();
this.startDate = new Date();
this.endDate = new Date();
this.comments = '';
this.outsideDutyID = undefined;
this.outsideDuty = new OutsideDuty();
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.EmployeeOutsideDuty = void 0;
var baseObject_1 = require("../Basic/baseObject");
var employee_1 = require("../Employee/employee");
var outsideDuty_1 = require("./outsideDuty");
var EmployeeOutsideDuty = /** @class */ (function (_super) {
__extends(EmployeeOutsideDuty, _super);
function EmployeeOutsideDuty() {
var _this = _super.call(this) || this;
_this.employeeID = undefined;
_this.employeeNo = '';
_this.employeeName = '';
_this.employee = new employee_1.Employee();
_this.entryDate = new Date();
_this.startDate = new Date();
_this.endDate = new Date();
_this.comments = '';
_this.outsideDutyID = undefined;
_this.outsideDuty = new outsideDuty_1.OutsideDuty();
return _this;
}
}
return EmployeeOutsideDuty;
}(baseObject_1.BaseObject));
exports.EmployeeOutsideDuty = EmployeeOutsideDuty;
//# sourceMappingURL=employeeOutsideDuty.js.map

View File

@ -1 +1 @@
{"version":3,"file":"employeeOutsideDuty.js","sourceRoot":"","sources":["employeeOutsideDuty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAE1C,MAAM,OAAO,mBAAoB,SAAQ,UAAU;IAW/C;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,IAAI,IAAI,EAAE,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/B,IAAI,CAAC,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;IACzC,CAAC;CACJ"}
{"version":3,"file":"employeeOutsideDuty.js","sourceRoot":"","sources":["employeeOutsideDuty.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,kDAA+C;AAC/C,iDAA8C;AAC9C,6CAA0C;AAE1C;IAAyC,uCAAU;IAW/C;QACI,YAAA,MAAK,WAAE,SAAC;QACR,KAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,KAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,KAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,KAAI,CAAC,QAAQ,GAAG,IAAI,mBAAQ,EAAE,CAAC;QAC/B,KAAI,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;QAC5B,KAAI,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;QAC5B,KAAI,CAAC,OAAO,GAAG,IAAI,IAAI,EAAE,CAAC;QAC1B,KAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,KAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/B,KAAI,CAAC,WAAW,GAAG,IAAI,yBAAW,EAAE,CAAC;;IACzC,CAAC;IACL,0BAAC;AAAD,CAAC,AAxBD,CAAyC,uBAAU,GAwBlD;AAxBY,kDAAmB"}

View File

@ -1,38 +1,60 @@
import { EnumDayOfWeek } from '../enums';
import { Shift } from './shift';
import { Employee } from '../Employee/employee';
import { BaseObject } from '../Basic/baseObject';
export class EmployeeWorkPlanSetup extends BaseObject {
constructor() {
super();
this.employeeID = undefined;
this.shiftID = undefined;
this.startDate = new Date();
this.workPlanGroupID = undefined;
this.workPlanGroupType = undefined;
this.weekEndOn = EnumDayOfWeek.Friday;
this.weekEndOn2 = EnumDayOfWeek.Saturday;
this.payrolltypeID = undefined;
this.employee = new Employee();
this.shift = new Shift();
this.saturdayShiftID = undefined;
this.saturdayShift = new Shift();
this.sundayShiftID = undefined;
this.sundayShift = new Shift();
this.mondayShiftID = undefined;
this.mondayShift = new Shift();
this.tuesdayShiftID = undefined;
this.tuesdayShift = new Shift();
this.wednesdayShiftID = undefined;
this.wednesdayShift = new Shift();
this.thursdayShiftID = undefined;
this.thursdayShift = new Shift();
this.fridayShiftID = undefined;
this.fridayShift = new Shift();
this.shiftsName = '';
this.employeeNoView = '';
this.employeeNameView = '';
this.workPlanGroupNameView = '';
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.EmployeeWorkPlanSetup = void 0;
var enums_1 = require("../enums");
var shift_1 = require("./shift");
var employee_1 = require("../Employee/employee");
var baseObject_1 = require("../Basic/baseObject");
var EmployeeWorkPlanSetup = /** @class */ (function (_super) {
__extends(EmployeeWorkPlanSetup, _super);
function EmployeeWorkPlanSetup() {
var _this = _super.call(this) || this;
_this.employeeID = undefined;
_this.shiftID = undefined;
_this.startDate = new Date();
_this.workPlanGroupID = undefined;
_this.workPlanGroupType = undefined;
_this.weekEndOn = enums_1.EnumDayOfWeek.Friday;
_this.weekEndOn2 = enums_1.EnumDayOfWeek.Saturday;
_this.payrolltypeID = undefined;
_this.employee = new employee_1.Employee();
_this.shift = new shift_1.Shift();
_this.saturdayShiftID = undefined;
_this.saturdayShift = new shift_1.Shift();
_this.sundayShiftID = undefined;
_this.sundayShift = new shift_1.Shift();
_this.mondayShiftID = undefined;
_this.mondayShift = new shift_1.Shift();
_this.tuesdayShiftID = undefined;
_this.tuesdayShift = new shift_1.Shift();
_this.wednesdayShiftID = undefined;
_this.wednesdayShift = new shift_1.Shift();
_this.thursdayShiftID = undefined;
_this.thursdayShift = new shift_1.Shift();
_this.fridayShiftID = undefined;
_this.fridayShift = new shift_1.Shift();
_this.shiftsName = '';
_this.employeeNoView = '';
_this.employeeNameView = '';
_this.workPlanGroupNameView = '';
return _this;
}
}
return EmployeeWorkPlanSetup;
}(baseObject_1.BaseObject));
exports.EmployeeWorkPlanSetup = EmployeeWorkPlanSetup;
//# sourceMappingURL=employeeWorkPlanSetup.js.map

View File

@ -1 +1 @@
{"version":3,"file":"employeeWorkPlanSetup.js","sourceRoot":"","sources":["employeeWorkPlanSetup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAoB,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAG/C,MAAM,OAAO,qBAAsB,SAAQ,UAAU;IACjD;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QACjC,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAC;QACnC,IAAI,CAAC,SAAS,GAAG,aAAa,CAAC,MAAM,CAAC;QACtC,IAAI,CAAC,UAAU,GAAG,aAAa,CAAC,QAAQ,CAAC;QACzC,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QACjC,IAAI,CAAC,aAAa,GAAG,IAAI,KAAK,EAAE,CAAC;QACjC,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/B,IAAI,CAAC,WAAW,GAAG,IAAI,KAAK,EAAE,CAAC;QAC/B,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/B,IAAI,CAAC,WAAW,GAAG,IAAI,KAAK,EAAE,CAAC;QAC/B,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;QAChC,IAAI,CAAC,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;QAChC,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;QAClC,IAAI,CAAC,cAAc,GAAG,IAAI,KAAK,EAAE,CAAC;QAClC,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QACjC,IAAI,CAAC,aAAa,GAAG,IAAI,KAAK,EAAE,CAAC;QACjC,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/B,IAAI,CAAC,WAAW,GAAG,IAAI,KAAK,EAAE,CAAC;QAC/B,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;QAC3B,IAAI,CAAC,qBAAqB,GAAG,EAAE,CAAC;IACpC,CAAC;CAuCJ"}
{"version":3,"file":"employeeWorkPlanSetup.js","sourceRoot":"","sources":["employeeWorkPlanSetup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,kCAA0D;AAC1D,iCAA8B;AAC9B,iDAA8C;AAC9C,kDAA+C;AAG/C;IAA2C,yCAAU;IACjD;QACI,YAAA,MAAK,WAAE,SAAC;QACR,KAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,KAAI,CAAC,OAAO,GAAG,SAAS,CAAC;QACzB,KAAI,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;QAC5B,KAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QACjC,KAAI,CAAC,iBAAiB,GAAG,SAAS,CAAC;QACnC,KAAI,CAAC,SAAS,GAAG,qBAAa,CAAC,MAAM,CAAC;QACtC,KAAI,CAAC,UAAU,GAAG,qBAAa,CAAC,QAAQ,CAAC;QACzC,KAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/B,KAAI,CAAC,QAAQ,GAAG,IAAI,mBAAQ,EAAE,CAAC;QAC/B,KAAI,CAAC,KAAK,GAAG,IAAI,aAAK,EAAE,CAAC;QACzB,KAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QACjC,KAAI,CAAC,aAAa,GAAG,IAAI,aAAK,EAAE,CAAC;QACjC,KAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/B,KAAI,CAAC,WAAW,GAAG,IAAI,aAAK,EAAE,CAAC;QAC/B,KAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/B,KAAI,CAAC,WAAW,GAAG,IAAI,aAAK,EAAE,CAAC;QAC/B,KAAI,CAAC,cAAc,GAAG,SAAS,CAAC;QAChC,KAAI,CAAC,YAAY,GAAG,IAAI,aAAK,EAAE,CAAC;QAChC,KAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;QAClC,KAAI,CAAC,cAAc,GAAG,IAAI,aAAK,EAAE,CAAC;QAClC,KAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QACjC,KAAI,CAAC,aAAa,GAAG,IAAI,aAAK,EAAE,CAAC;QACjC,KAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/B,KAAI,CAAC,WAAW,GAAG,IAAI,aAAK,EAAE,CAAC;QAC/B,KAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,KAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QACzB,KAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;QAC3B,KAAI,CAAC,qBAAqB,GAAG,EAAE,CAAC;;IACpC,CAAC;IAuCL,4BAAC;AAAD,CAAC,AAtED,CAA2C,uBAAU,GAsEpD;AAtEY,sDAAqB"}

View File

@ -1,3 +1,10 @@
export class GatePass {
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GatePass = void 0;
var GatePass = /** @class */ (function () {
function GatePass() {
}
return GatePass;
}());
exports.GatePass = GatePass;
//# sourceMappingURL=gatePass.js.map

View File

@ -1 +1 @@
{"version":3,"file":"gatePass.js","sourceRoot":"","sources":["gatePass.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,QAAQ;CAcpB"}
{"version":3,"file":"gatePass.js","sourceRoot":"","sources":["gatePass.ts"],"names":[],"mappings":";;;AAGA;IAAA;IAcA,CAAC;IAAD,eAAC;AAAD,CAAC,AAdD,IAcC;AAdY,4BAAQ"}

View File

@ -1,13 +1,35 @@
import { BaseObject } from '../Basic/baseObject';
import { EnumHolidayType } from '../enums';
export class HolidayCalendar extends BaseObject {
constructor() {
super();
this.type = EnumHolidayType.Weekend;
this.description = '';
this.holidayDate = new Date();
this.locationID = null;
this.weeklyHolidayType = null;
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.HolidayCalendar = void 0;
var baseObject_1 = require("../Basic/baseObject");
var enums_1 = require("../enums");
var HolidayCalendar = /** @class */ (function (_super) {
__extends(HolidayCalendar, _super);
function HolidayCalendar() {
var _this = _super.call(this) || this;
_this.type = enums_1.EnumHolidayType.Weekend;
_this.description = '';
_this.holidayDate = new Date();
_this.locationID = null;
_this.weeklyHolidayType = null;
return _this;
}
}
return HolidayCalendar;
}(baseObject_1.BaseObject));
exports.HolidayCalendar = HolidayCalendar;
//# sourceMappingURL=holidayCalendar.js.map

View File

@ -1 +1 @@
{"version":3,"file":"holidayCalendar.js","sourceRoot":"","sources":["holidayCalendar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAC,eAAe,EAAC,MAAM,UAAU,CAAC;AAEzC,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAC3C;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC,OAAO,CAAC;QACpC,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAClC,CAAC;CAMJ"}
{"version":3,"file":"holidayCalendar.js","sourceRoot":"","sources":["holidayCalendar.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,kDAA+C;AAC/C,kCAAyC;AAEzC;IAAqC,mCAAU;IAC3C;QACI,YAAA,MAAK,WAAE,SAAC;QACR,KAAI,CAAC,IAAI,GAAG,uBAAe,CAAC,OAAO,CAAC;QACpC,KAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,KAAI,CAAC,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC;QAC9B,KAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,KAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;;IAClC,CAAC;IAML,sBAAC;AAAD,CAAC,AAdD,CAAqC,uBAAU,GAc9C;AAdY,0CAAe"}

View File

@ -1,12 +1,36 @@
import { BaseObject } from '../Basic/baseObject';
export class MonthlyWorkPlan extends BaseObject {
constructor() {
super();
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.EmployeeWorkPlan = exports.MonthlyWorkPlan = void 0;
var baseObject_1 = require("../Basic/baseObject");
var MonthlyWorkPlan = /** @class */ (function (_super) {
__extends(MonthlyWorkPlan, _super);
function MonthlyWorkPlan() {
return _super.call(this) || this;
}
}
export class EmployeeWorkPlan extends BaseObject {
constructor() {
super();
return MonthlyWorkPlan;
}(baseObject_1.BaseObject));
exports.MonthlyWorkPlan = MonthlyWorkPlan;
var EmployeeWorkPlan = /** @class */ (function (_super) {
__extends(EmployeeWorkPlan, _super);
function EmployeeWorkPlan() {
return _super.call(this) || this;
}
}
return EmployeeWorkPlan;
}(baseObject_1.BaseObject));
exports.EmployeeWorkPlan = EmployeeWorkPlan;
//# sourceMappingURL=monthlyWorkPlan.js.map

View File

@ -1 +1 @@
{"version":3,"file":"monthlyWorkPlan.js","sourceRoot":"","sources":["monthlyWorkPlan.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAE3C;QAEI,KAAK,EAAE,CAAC;IACZ,CAAC;CAWJ;AAGD,MAAM,OAAO,gBAAiB,SAAQ,UAAU;IAC5C;QACI,KAAK,EAAE,CAAC;IACZ,CAAC;CAaJ"}
{"version":3,"file":"monthlyWorkPlan.js","sourceRoot":"","sources":["monthlyWorkPlan.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAGA,kDAAiD;AAGjD;IAAqC,mCAAU;IAE3C;QAEI,OAAA,MAAK,WAAE,SAAC;IACZ,CAAC;IAWL,sBAAC;AAAD,CAAC,AAhBD,CAAqC,uBAAU,GAgB9C;AAhBY,0CAAe;AAmB5B;IAAsC,oCAAU;IAC5C;QACI,OAAA,MAAK,WAAE,SAAC;IACZ,CAAC;IAaL,uBAAC;AAAD,CAAC,AAhBD,CAAsC,uBAAU,GAgB/C;AAhBY,4CAAgB"}

View File

@ -1,7 +1,28 @@
import { BaseObject } from '../Basic/baseObject';
export class OutsideDuty extends BaseObject {
constructor() {
super();
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.OutsideDuty = void 0;
var baseObject_1 = require("../Basic/baseObject");
var OutsideDuty = /** @class */ (function (_super) {
__extends(OutsideDuty, _super);
function OutsideDuty() {
return _super.call(this) || this;
}
}
return OutsideDuty;
}(baseObject_1.BaseObject));
exports.OutsideDuty = OutsideDuty;
//# sourceMappingURL=outsideDuty.js.map

View File

@ -1 +1 @@
{"version":3,"file":"outsideDuty.js","sourceRoot":"","sources":["outsideDuty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAE/C,MAAM,OAAO,WAAY,SAAQ,UAAU;IAEvC;QACI,KAAK,EAAE,CAAC;IACZ,CAAC;CACJ"}
{"version":3,"file":"outsideDuty.js","sourceRoot":"","sources":["outsideDuty.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,kDAA+C;AAE/C;IAAiC,+BAAU;IAEvC;QACI,OAAA,MAAK,WAAE,SAAC;IACZ,CAAC;IACL,kBAAC;AAAD,CAAC,AALD,CAAiC,uBAAU,GAK1C;AALY,kCAAW"}

View File

@ -1,39 +1,61 @@
import { EnumWorkPlanGroup } from '../enums';
import { BaseObject } from '../Basic/baseObject';
export class Shift extends BaseObject {
constructor() {
super();
this.code = '';
this.name = '';
this.workHour = 0;
this.flexibleHour = 0;
this.minimumInGraceTime = 0;
this.minimumOutGraceTime = 0;
this.inTime = new Date(2000, 2, 10, 8, 30, 0);
this.outTime = new Date(2000, 2, 10, 13, 30, 0);
this.hasAbsentTime = false;
this.isCounterClock = false;
this.lunchHour = 0;
this.minimumInOTHour = 0;
this.minimumOutOTHour = 0;
this.absentTime = new Date();
this.lateCalcualtion = 0;
this.delayCalcualtion = 0;
this.earlyExitBefore = 0;
this.minimumOTHour = 0;
this.isOverlapingDay = false;
this.shiftType = EnumWorkPlanGroup.Fixed;
this.shortName = '';
this.hasBenefits = false;
this.hasExtraHourAllowance = false;
this.extraHourAllowanceFromTime = new Date();
this.hasNightAllowance = false;
this.hasHolidayAllowance = false;
this.hasOtherAllowance = false;
this.hasRegularOverTime = false;
this.hasHolidayOverTime = false;
this.hasTiffinAllowance = false;
this.hasSpecialAllowance = false;
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.Shift = void 0;
var enums_1 = require("../enums");
var baseObject_1 = require("../Basic/baseObject");
var Shift = /** @class */ (function (_super) {
__extends(Shift, _super);
function Shift() {
var _this = _super.call(this) || this;
_this.code = '';
_this.name = '';
_this.workHour = 0;
_this.flexibleHour = 0;
_this.minimumInGraceTime = 0;
_this.minimumOutGraceTime = 0;
_this.inTime = new Date(2000, 2, 10, 8, 30, 0);
_this.outTime = new Date(2000, 2, 10, 13, 30, 0);
_this.hasAbsentTime = false;
_this.isCounterClock = false;
_this.lunchHour = 0;
_this.minimumInOTHour = 0;
_this.minimumOutOTHour = 0;
_this.absentTime = new Date();
_this.lateCalcualtion = 0;
_this.delayCalcualtion = 0;
_this.earlyExitBefore = 0;
_this.minimumOTHour = 0;
_this.isOverlapingDay = false;
_this.shiftType = enums_1.EnumWorkPlanGroup.Fixed;
_this.shortName = '';
_this.hasBenefits = false;
_this.hasExtraHourAllowance = false;
_this.extraHourAllowanceFromTime = new Date();
_this.hasNightAllowance = false;
_this.hasHolidayAllowance = false;
_this.hasOtherAllowance = false;
_this.hasRegularOverTime = false;
_this.hasHolidayOverTime = false;
_this.hasTiffinAllowance = false;
_this.hasSpecialAllowance = false;
return _this;
}
}
return Shift;
}(baseObject_1.BaseObject));
exports.Shift = Shift;
//# sourceMappingURL=shift.js.map

View File

@ -1 +1 @@
{"version":3,"file":"shift.js","sourceRoot":"","sources":["shift.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,iBAAiB,EAAC,MAAM,UAAU,CAAC;AACzD,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAG/C,MAAM,OAAO,KAAM,SAAQ,UAAU;IACjC;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QACf,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;QAClB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QACtB,IAAI,CAAC,kBAAkB,GAAG,CAAC,CAAC;QAC5B,IAAI,CAAC,mBAAmB,GAAG,CAAC,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QAC9C,IAAI,CAAC,OAAO,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QAChD,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC3B,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;QAC5B,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACnB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC;QACzB,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC;QAC1B,IAAI,CAAC,UAAU,GAAG,IAAI,IAAI,EAAE,CAAC;QAC7B,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC;QACzB,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC;QAC1B,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,iBAAiB,CAAC,KAAK,CAAC;QACzC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,IAAI,CAAC,qBAAqB,GAAG,KAAK,CAAC;QACnC,IAAI,CAAC,0BAA0B,GAAG,IAAI,IAAI,EAAE,CAAC;QAC7C,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC;QAC/B,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC;QACjC,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC;QAC/B,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;QAChC,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;QAChC,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;QAChC,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC;IAErC,CAAC;CAiDJ"}
{"version":3,"file":"shift.js","sourceRoot":"","sources":["shift.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,kCAAyD;AACzD,kDAA+C;AAG/C;IAA2B,yBAAU;IACjC;QACI,YAAA,MAAK,WAAE,SAAC;QACR,KAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QACf,KAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QACf,KAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;QAClB,KAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QACtB,KAAI,CAAC,kBAAkB,GAAG,CAAC,CAAC;QAC5B,KAAI,CAAC,mBAAmB,GAAG,CAAC,CAAC;QAC7B,KAAI,CAAC,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QAC9C,KAAI,CAAC,OAAO,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QAChD,KAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC3B,KAAI,CAAC,cAAc,GAAG,KAAK,CAAC;QAC5B,KAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACnB,KAAI,CAAC,eAAe,GAAG,CAAC,CAAC;QACzB,KAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC;QAC1B,KAAI,CAAC,UAAU,GAAG,IAAI,IAAI,EAAE,CAAC;QAC7B,KAAI,CAAC,eAAe,GAAG,CAAC,CAAC;QACzB,KAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC;QAC1B,KAAI,CAAC,eAAe,GAAG,CAAC,CAAC;QACzB,KAAI,CAAC,aAAa,GAAG,CAAC,CAAC;QACvB,KAAI,CAAC,eAAe,GAAG,KAAK,CAAC;QAC7B,KAAI,CAAC,SAAS,GAAG,yBAAiB,CAAC,KAAK,CAAC;QACzC,KAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,KAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,KAAI,CAAC,qBAAqB,GAAG,KAAK,CAAC;QACnC,KAAI,CAAC,0BAA0B,GAAG,IAAI,IAAI,EAAE,CAAC;QAC7C,KAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC;QAC/B,KAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC;QACjC,KAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC;QAC/B,KAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;QAChC,KAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;QAChC,KAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;QAChC,KAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC;;IAErC,CAAC;IAiDL,YAAC;AAAD,CAAC,AApFD,CAA2B,uBAAU,GAoFpC;AApFY,sBAAK"}

View File

@ -1,14 +1,36 @@
import { EnumWorkPlanGroup } from '../enums';
import { Shift } from './shift';
import { BaseObject } from '../Basic/baseObject';
export class ShiftRotation extends BaseObject {
constructor() {
super();
this.shiftID = undefined;
this.workPlanType = EnumWorkPlanGroup.Fixed;
this.workPlanGroupType = EnumWorkPlanGroup.Fixed;
this.shift = new Shift();
this.shortName = '';
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.ShiftRotation = void 0;
var enums_1 = require("../enums");
var shift_1 = require("./shift");
var baseObject_1 = require("../Basic/baseObject");
var ShiftRotation = /** @class */ (function (_super) {
__extends(ShiftRotation, _super);
function ShiftRotation() {
var _this = _super.call(this) || this;
_this.shiftID = undefined;
_this.workPlanType = enums_1.EnumWorkPlanGroup.Fixed;
_this.workPlanGroupType = enums_1.EnumWorkPlanGroup.Fixed;
_this.shift = new shift_1.Shift();
_this.shortName = '';
return _this;
}
}
return ShiftRotation;
}(baseObject_1.BaseObject));
exports.ShiftRotation = ShiftRotation;
//# sourceMappingURL=shiftRotation.js.map

View File

@ -1 +1 @@
{"version":3,"file":"shiftRotation.js","sourceRoot":"","sources":["shiftRotation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAG/C,MAAM,OAAO,aAAc,SAAQ,UAAU;IACzC;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,iBAAiB,CAAC,KAAK,CAAC;QAC5C,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,KAAK,CAAC;QACjD,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;IACxB,CAAC;CAOJ"}
{"version":3,"file":"shiftRotation.js","sourceRoot":"","sources":["shiftRotation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,kCAA2C;AAC3C,iCAA8B;AAC9B,kDAA+C;AAG/C;IAAmC,iCAAU;IACzC;QACI,YAAA,MAAK,WAAE,SAAC;QACR,KAAI,CAAC,OAAO,GAAG,SAAS,CAAC;QACzB,KAAI,CAAC,YAAY,GAAG,yBAAiB,CAAC,KAAK,CAAC;QAC5C,KAAI,CAAC,iBAAiB,GAAG,yBAAiB,CAAC,KAAK,CAAC;QACjD,KAAI,CAAC,KAAK,GAAG,IAAI,aAAK,EAAE,CAAC;QACzB,KAAI,CAAC,SAAS,GAAG,EAAE,CAAC;;IACxB,CAAC;IAOL,oBAAC;AAAD,CAAC,AAfD,CAAmC,uBAAU,GAe5C;AAfY,sCAAa"}

View File

@ -1,22 +1,44 @@
import { EnumWorkPlanGroup, HolidayDayOfWeek } from '../enums';
import { BaseObject } from '../Basic/baseObject';
export class WorkPlanGroup extends BaseObject {
constructor() {
super();
this.name = '';
this.type = EnumWorkPlanGroup.Fixed;
this.initialShiftID = undefined;
this.saturdayShiftID = undefined;
this.sundayShiftID = undefined;
this.mondayShiftID = undefined;
this.tuesdayShiftID = undefined;
this.wednesdayShiftID = undefined;
this.thursdayShiftID = undefined;
this.fridayShiftID = undefined;
this.holidayOne = HolidayDayOfWeek.None;
this.holidayTwo = HolidayDayOfWeek.None;
this.workPlanGroupType = EnumWorkPlanGroup.Fixed;
this.hasTwoHolidays = true;
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.WorkPlanGroup = void 0;
var enums_1 = require("../enums");
var baseObject_1 = require("../Basic/baseObject");
var WorkPlanGroup = /** @class */ (function (_super) {
__extends(WorkPlanGroup, _super);
function WorkPlanGroup() {
var _this = _super.call(this) || this;
_this.name = '';
_this.type = enums_1.EnumWorkPlanGroup.Fixed;
_this.initialShiftID = undefined;
_this.saturdayShiftID = undefined;
_this.sundayShiftID = undefined;
_this.mondayShiftID = undefined;
_this.tuesdayShiftID = undefined;
_this.wednesdayShiftID = undefined;
_this.thursdayShiftID = undefined;
_this.fridayShiftID = undefined;
_this.holidayOne = enums_1.HolidayDayOfWeek.None;
_this.holidayTwo = enums_1.HolidayDayOfWeek.None;
_this.workPlanGroupType = enums_1.EnumWorkPlanGroup.Fixed;
_this.hasTwoHolidays = true;
return _this;
}
}
return WorkPlanGroup;
}(baseObject_1.BaseObject));
exports.WorkPlanGroup = WorkPlanGroup;
//# sourceMappingURL=workPlanGroup.js.map

View File

@ -1 +1 @@
{"version":3,"file":"workPlanGroup.js","sourceRoot":"","sources":["workPlanGroup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAuC,MAAM,UAAU,CAAC;AACpG,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAG/C,MAAM,OAAO,aAAc,SAAQ,UAAU;IACzC;QACI,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC,KAAK,CAAC;QACpC,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;QAChC,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QACjC,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/B,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/B,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;QAChC,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;QAClC,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QACjC,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/B,IAAI,CAAC,UAAU,GAAG,gBAAgB,CAAC,IAAI,CAAC;QACxC,IAAI,CAAC,UAAU,GAAG,gBAAgB,CAAC,IAAI,CAAC;QACxC,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,KAAK,CAAC;QACjD,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;IAC/B,CAAC;CAiBJ"}
{"version":3,"file":"workPlanGroup.js","sourceRoot":"","sources":["workPlanGroup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,kCAAoG;AACpG,kDAA+C;AAG/C;IAAmC,iCAAU;IACzC;QACI,YAAA,MAAK,WAAE,SAAC;QAER,KAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QACf,KAAI,CAAC,IAAI,GAAG,yBAAiB,CAAC,KAAK,CAAC;QACpC,KAAI,CAAC,cAAc,GAAG,SAAS,CAAC;QAChC,KAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QACjC,KAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/B,KAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/B,KAAI,CAAC,cAAc,GAAG,SAAS,CAAC;QAChC,KAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;QAClC,KAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QACjC,KAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/B,KAAI,CAAC,UAAU,GAAG,wBAAgB,CAAC,IAAI,CAAC;QACxC,KAAI,CAAC,UAAU,GAAG,wBAAgB,CAAC,IAAI,CAAC;QACxC,KAAI,CAAC,iBAAiB,GAAG,yBAAiB,CAAC,KAAK,CAAC;QACjD,KAAI,CAAC,cAAc,GAAG,IAAI,CAAC;;IAC/B,CAAC;IAiBL,oBAAC;AAAD,CAAC,AAnCD,CAAmC,uBAAU,GAmC5C;AAnCY,sCAAa"}

View File

@ -1,10 +1,32 @@
import { BaseObject } from '../HRBasic/baseObject';
import { EnumAuthStatus } from '../enums';
export class UserAccessType extends BaseObject {
constructor() {
super();
this.description = "";
this.accessTypeStatus = EnumAuthStatus.Approved;
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.UserAccessType = void 0;
var baseObject_1 = require("../HRBasic/baseObject");
var enums_1 = require("../enums");
var UserAccessType = /** @class */ (function (_super) {
__extends(UserAccessType, _super);
function UserAccessType() {
var _this = _super.call(this) || this;
_this.description = "";
_this.accessTypeStatus = enums_1.EnumAuthStatus.Approved;
return _this;
}
}
return UserAccessType;
}(baseObject_1.BaseObject));
exports.UserAccessType = UserAccessType;
//# sourceMappingURL=UserAccessType.js.map

View File

@ -1 +1 @@
{"version":3,"file":"UserAccessType.js","sourceRoot":"","sources":["UserAccessType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,OAAO,cAAe,SAAQ,UAAU;IAG1C;QAEI,KAAK,EAAE,CAAC;QAKL,gBAAW,GAAW,EAAE,CAAC;QAJ5B,IAAI,CAAC,gBAAgB,GAAG,cAAc,CAAC,QAAQ,CAAC;IACpD,CAAC;CAOJ"}
{"version":3,"file":"UserAccessType.js","sourceRoot":"","sources":["UserAccessType.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,oDAAmD;AACnD,kCAA0C;AAE1C;IAAoC,kCAAU;IAG1C;QAEI,YAAA,MAAK,WAAE,SAAC;QAKL,iBAAW,GAAW,EAAE,CAAC;QAJ5B,KAAI,CAAC,gBAAgB,GAAG,sBAAc,CAAC,QAAQ,CAAC;;IACpD,CAAC;IAOL,qBAAC;AAAD,CAAC,AAdD,CAAoC,uBAAU,GAc7C;AAdY,wCAAc"}

View File

@ -14,8 +14,5 @@ export class UserAccessType extends BaseObject
public description: string = "";
public userID: number;
public payrollTypeNameview: string;
/** Approved (5) = live; New_Not_Yet_Approve (2) = requested, not live yet; Deleted_Not_Yet_Approve (3) = removal requested, still live. */
public accessTypeStatus: EnumAuthStatus;
public approvedBy?: number;
public approvedDate?: Date;
}

View File

@ -1,24 +1,46 @@
import { BaseObject } from '../Basic/baseObject';
export class UserRole extends BaseObject {
constructor() {
super();
this.isOld = true;
this.newRoleName = "";
this.userID = 0;
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.UserRole = void 0;
var baseObject_1 = require("../Basic/baseObject");
var UserRole = /** @class */ (function (_super) {
__extends(UserRole, _super);
function UserRole() {
var _this = _super.call(this) || this;
_this.isOld = true;
_this.newRoleName = "";
_this.userID = 0;
return _this;
}
getRoleNames(users, useRoles) {
UserRole.prototype.getRoleNames = function (users, useRoles) {
var useRole;
var str = '';
users.forEach(u => {
users.forEach(function (u) {
str = '';
var temproles = useRoles.filter(x => u.id == x.userID);
var temproles = useRoles.filter(function (x) { return u.id == x.userID; });
if (temproles = undefined) {
temproles.forEach(y => {
temproles.forEach(function (y) {
str = str + y.roleNameView;
});
}
u.roleNames = str;
});
}
}
};
return UserRole;
}(baseObject_1.BaseObject));
exports.UserRole = UserRole;
//# sourceMappingURL=UserRole.js.map

View File

@ -1 +1 @@
{"version":3,"file":"UserRole.js","sourceRoot":"","sources":["UserRole.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAK/C,MAAM,OAAO,QAAS,SAAQ,UAAU;IACpC;QACI,KAAK,EAAE,CAAC;QAsBZ,UAAK,GAAa,IAAI,CAAC;QACvB,gBAAW,GAAY,EAAE,CAAC;QAtBtB,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IACpB,CAAC;IAuBD,YAAY,CAAC,KAAa,EAAE,QAAoB;QAC5C,IAAI,OAAmB,CAAC;QACxB,IAAI,GAAG,GAAG,EAAE,CAAC;QACb,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YACd,GAAG,GAAG,EAAE,CAAC;YACT,IAAI,SAAS,GAAe,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;YACnE,IAAI,SAAU,GAAG,SAAS,EAAE,CAAC;gBACzB,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;oBAClB,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,YAAY,CAAC;gBAE/B,CAAC,CAAC,CAAC;YACP,CAAC;YACD,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC;QACtB,CAAC,CAAC,CAAC;IACP,CAAC;CACJ"}
{"version":3,"file":"UserRole.js","sourceRoot":"","sources":["UserRole.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,kDAA+C;AAK/C;IAA8B,4BAAU;IACpC;QACI,YAAA,MAAK,WAAE,SAAC;QAsBZ,WAAK,GAAa,IAAI,CAAC;QACvB,iBAAW,GAAY,EAAE,CAAC;QAtBtB,KAAI,CAAC,MAAM,GAAG,CAAC,CAAC;;IACpB,CAAC;IAuBD,+BAAY,GAAZ,UAAa,KAAa,EAAE,QAAoB;QAC5C,IAAI,OAAmB,CAAC;QACxB,IAAI,GAAG,GAAG,EAAE,CAAC;QACb,KAAK,CAAC,OAAO,CAAC,UAAA,CAAC;YACX,GAAG,GAAG,EAAE,CAAC;YACT,IAAI,SAAS,GAAe,QAAQ,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,MAAM,EAAhB,CAAgB,CAAC,CAAC;YACnE,IAAI,SAAU,GAAG,SAAS,EAAE,CAAC;gBACzB,SAAS,CAAC,OAAO,CAAC,UAAA,CAAC;oBACf,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,YAAY,CAAC;gBAE/B,CAAC,CAAC,CAAC;YACP,CAAC;YACD,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC;QACtB,CAAC,CAAC,CAAC;IACP,CAAC;IACL,eAAC;AAAD,CAAC,AA1CD,CAA8B,uBAAU,GA0CvC;AA1CY,4BAAQ"}

View File

@ -48,59 +48,3 @@ export class UserRole extends BaseObject {
}
// ---------- Maker-checker (Authentication > User Role Permission) ----------
/** What a role request asks for (EnumUserRoleRequestType on the server). */
export enum EnumUserRoleRequestType {
Add = 1,
Remove = 2,
}
/** Whose roles: an Admin user (userID) or a Self Service employee (employeeID + payrollTypeID). */
export class UserRoleSubject {
roleType: EnumRoleType;
userID?: number;
employeeID?: number;
payrollTypeID?: number;
}
/** Maker's request: the roles (of the subject's role type) the person should have. */
export class UserRoleChangeRequest extends UserRoleSubject {
roleIDs: number[] = [];
}
/** One UserRole row waiting for approval (Status 2 = give, 3 = take away); id is the UserRoleID. */
export class UserRoleRequest {
id: number;
requestType: EnumUserRoleRequestType;
roleID: number;
roleType: EnumRoleType;
userID?: number;
employeeID?: number;
payrollTypeID?: number;
status: EnumAuthStatus;
createdBy: number;
createdDate: Date;
roleName: string;
loginID: string;
personName: string;
employeeNo: string;
makerLoginID: string;
}
/** A person's roles of one role type, as the page shows them. */
export class UserRoleState {
roleType: EnumRoleType;
userID?: number;
employeeID?: number;
payrollTypeID?: number;
loginID: string;
personName: string;
/** False for a Self Service employee who has no login yet (one is made when a change is sent). */
hasLogin: boolean;
/** The login was made for a change still waiting for approval: it cannot sign in yet. */
loginWaiting: boolean;
liveRoleIDs: number[] = [];
pending: UserRoleRequest[] = [];
}

View File

@ -1,77 +0,0 @@
import { BaseObject } from '../Basic/baseObject';
/** One successful login (dbo.UserLoginInfo), as returned by api/Authentication/getUserAuditTrail. */
export class UserLogInInfo extends BaseObject {
userID: number;
loginTime: Date;
logoutTime?: Date;
logoutType?: number;
pcNumber: string;
ipAddress: string;
/** Mobile / tab device id; null for a browser login. */
deviceId: string;
loginID: string;
userName: string;
constructor() {
super();
this.userID = 0;
this.loginTime = undefined;
this.logoutTime = undefined;
this.logoutType = undefined;
this.pcNumber = '';
this.ipAddress = '';
this.deviceId = '';
this.loginID = '';
this.userName = '';
}
}
/** One failed login (dbo.BadLoginAttemptInfo), as returned by api/Authentication/getBadLoginAuditTrail. */
export class BadLoginAttemptInfo extends BaseObject {
userID: number;
attemptTime: Date;
pcNumber: string;
ipAddress: string;
/** Mobile / tab device id; null for a browser login. */
deviceId: string;
loginID: string;
userName: string;
constructor() {
super();
this.userID = 0;
this.attemptTime = undefined;
this.pcNumber = '';
this.ipAddress = '';
this.deviceId = '';
this.loginID = '';
this.userName = '';
}
}
/** Which change history the System Audit Log page asks for (HRM.BO EnumSystemAuditHistory). */
export enum EnumSystemAuditHistory {
Role = 1,
RolePermission = 2,
User = 3,
UserRole = 4,
UserAccessType = 5
}
/** One row of a page's change history (Z_ table), as returned by api/Authentication/getSystemAuditHistory. */
export interface SystemAuditHistory {
auditType: string;
auditDate: Date;
loginID: string;
name: string;
code: string;
userType: string;
roleName: string;
roleType: string;
menuKey: string;
menuName: string;
accessType: string;
activities: string;
actionBy: number;
actionByLoginID: string;
actionByName: string;
}

View File

@ -1,9 +1,31 @@
import { BaseObject } from '../Basic/baseObject';
export class PasswordHistory extends BaseObject {
constructor() {
super();
this.userID = undefined;
this.userPassword = '';
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.PasswordHistory = void 0;
var baseObject_1 = require("../Basic/baseObject");
var PasswordHistory = /** @class */ (function (_super) {
__extends(PasswordHistory, _super);
function PasswordHistory() {
var _this = _super.call(this) || this;
_this.userID = undefined;
_this.userPassword = '';
return _this;
}
}
return PasswordHistory;
}(baseObject_1.BaseObject));
exports.PasswordHistory = PasswordHistory;
//# sourceMappingURL=passwordHistory.js.map

View File

@ -1 +1 @@
{"version":3,"file":"passwordHistory.js","sourceRoot":"","sources":["passwordHistory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAE/C,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAG3C;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;QACxB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;IAC3B,CAAC;CACJ"}
{"version":3,"file":"passwordHistory.js","sourceRoot":"","sources":["passwordHistory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,kDAA+C;AAE/C;IAAqC,mCAAU;IAG3C;QACI,YAAA,MAAK,WAAE,SAAC;QACR,KAAI,CAAC,MAAM,GAAG,SAAS,CAAC;QACxB,KAAI,CAAC,YAAY,GAAG,EAAE,CAAC;;IAC3B,CAAC;IACL,sBAAC;AAAD,CAAC,AARD,CAAqC,uBAAU,GAQ9C;AARY,0CAAe"}

Some files were not shown because too many files have changed in this diff Show More