Regular DataUpload Done
This commit is contained in:
parent
7ef18abce5
commit
885e035201
22
CLAUDE.md
22
CLAUDE.md
|
|
@ -449,6 +449,28 @@ Gotcha in user approval: `UserDA.Approve` always sets `Status = Approved` (5), w
|
||||||
can never actually be approved. The user list labels that action "Re-activate" for this reason; the fix
|
can never actually be approved. The user list labels that action "Re-activate" for this reason; the fix
|
||||||
belongs in the server.
|
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
|
`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`
|
query that returns employee data, check whether existing siblings filter by it. Reading `EmployeeID`
|
||||||
throws for a self-service (`EnumUserType.Employee`) login that has none, so guard accordingly.
|
throws for a self-service (`EnumUserType.Employee`) login that has none, so guard accordingly.
|
||||||
|
|
|
||||||
|
|
@ -343,13 +343,11 @@ namespace HRM.DA
|
||||||
if (oBank.Code ==string.Empty)
|
if (oBank.Code ==string.Empty)
|
||||||
oBank.Code = GlobalFunctionService.GetMaxCode(tc, "banks", "Code");
|
oBank.Code = GlobalFunctionService.GetMaxCode(tc, "banks", "Code");
|
||||||
|
|
||||||
oBank.CreatedBy = 1;
|
|
||||||
oBank.CreatedDate = DateTime.Now;
|
oBank.CreatedDate = DateTime.Now;
|
||||||
BankDA.Insert(tc, oBank);
|
BankDA.Insert(tc, oBank);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
oBank.ModifiedBy = 1;
|
|
||||||
oBank.ModifiedDate = DateTime.Now;
|
oBank.ModifiedDate = DateTime.Now;
|
||||||
BankDA.Update(tc, oBank);
|
BankDA.Update(tc, oBank);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4759,6 +4759,32 @@ 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,
|
public void Save(List<Category> categorys, List<Grade> grades, List<Department> departments,
|
||||||
List<Location> locations,
|
List<Location> locations,
|
||||||
List<Religion> religions, List<Designation> designations, List<Bank> banks,
|
List<Religion> religions, List<Designation> designations, List<Bank> banks,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"version": "20261115-03",
|
"version": "20261117-01",
|
||||||
"buildTime": "2026-11-15T08:30:42.0805569Z"
|
"buildTime": "2026-11-17T10:52:35.6354741Z"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,8 +52,8 @@
|
||||||
//"Default": "provider=sql;sqlSyntax=SQL;server=103.197.204.164,1718;Database=MasterProjectDB;User Id=DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;",
|
//"Default": "provider=sql;sqlSyntax=SQL;server=103.197.204.164,1718;Database=MasterProjectDB;User Id=DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;",
|
||||||
//"SqlCommandConnection": "Data Source=103.197.204.164,1718;Initial Catalog=autocrop;Persist Security Info=True; User ID=DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;", // Development
|
//"SqlCommandConnection": "Data Source=103.197.204.164,1718;Initial Catalog=autocrop;Persist Security Info=True; User ID=DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;", // Development
|
||||||
|
|
||||||
"Default": "provider=sql;sqlSyntax=SQL;server=103.197.204.164,1718;Database=MasterProjectDBBRAC;User Id= DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;",
|
"Default": "provider=sql;sqlSyntax=SQL;server=103.197.204.164,1718;Database=MasterProjectDBUATBRAC;User Id= DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;",
|
||||||
"SqlCommandConnection": "Data Source=103.197.204.164,1718;Initial Catalog=MasterProjectDBBRAC;Persist Security Info=True; User ID=DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;" // Development
|
"SqlCommandConnection": "Data Source=103.197.204.164,1718;Initial Catalog=MasterProjectDBUATBRAC;Persist Security Info=True; User ID=DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;" // Development
|
||||||
|
|
||||||
},
|
},
|
||||||
"Calendar": {
|
"Calendar": {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user