From c6e4e695c51319ac4f247418e5e0784bb365e5b9 Mon Sep 17 00:00:00 2001 From: chapal Date: Tue, 19 May 2026 12:30:21 +0600 Subject: [PATCH] Attn raw data upload --- .../read-attendance-rawdata.component.ts | 10 +++++----- HRM.UI/Controllers/Attendance/AttendanceController.cs | 8 ++++++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/HRM.UI/ClientApp/src/app/attendance/read-attendance-rawdata/read-attendance-rawdata.component.ts b/HRM.UI/ClientApp/src/app/attendance/read-attendance-rawdata/read-attendance-rawdata.component.ts index a596630..16b6284 100644 --- a/HRM.UI/ClientApp/src/app/attendance/read-attendance-rawdata/read-attendance-rawdata.component.ts +++ b/HRM.UI/ClientApp/src/app/attendance/read-attendance-rawdata/read-attendance-rawdata.component.ts @@ -164,13 +164,13 @@ export class ReadAttendanceRawdataComponent { this.uploadeddata.rowNo = i.toString(); this.uploadeddata.employeeNo = temp[0].replace(/^"(.*)"$/, '$1'); this.uploadeddata.punchTime = temp[1].replace(/^"(.*)"$/, '$1'); - //this.uploadeddata.punchTime = temp[2].replace(/^"(.*)"$/, '$1'); + this.uploadeddata.cardNo = temp[2].replace(/^"(.*)"$/, '$1'); //this.uploadeddata.deviceNo = temp[3].replace(/^"(.*)"$/, '$1'); //this.uploadeddata.deviceIPAddress = temp[4].replace(/^"(.*)"$/, '$1'); //this.uploadeddata.entryMode = temp[5].replace(/^"(.*)"$/, '$1'); this.uploadeddata.employeeNo = this.uploadeddata.employeeNo.replace(/\s/g, ''); - //this.uploadeddata.cardNo = this.uploadeddata.cardNo.replace(/\s/g, ''); + this.uploadeddata.cardNo = this.uploadeddata.cardNo.replace(/\s/g, ''); //this.uploadeddata.entryMode = this.uploadeddata.entryMode.replace(/\s/g, ''); ////console.log(this.uploadeddata.EmpID); this.uploadeddatas.push(this.uploadeddata); @@ -219,7 +219,7 @@ export class ReadAttendanceRawdataComponent { this._notificationService.showError("Employee No not Found"); return; } - + debugger; if (this.mandatoryItems.length <= 0) { this.attnRawDatas = []; this.uploadeddatas.forEach(x => { @@ -242,14 +242,14 @@ export class ReadAttendanceRawdataComponent { //item.punchTime = fromdt; ////// working if the format is dd/mm/yyyy hh:mm:ss - + debugger; item.punchTime = new Date; // otherwise error item.punchTimeDateString = x.punchTime; //console.log(item.punchTime); item.employeeID = this.employees.find(e => e.employeeNo.trim().toLowerCase() == x.employeeNo.trim().toLowerCase()) == undefined ? 0 : this.employees.find(e => e.employeeNo.trim().toLowerCase() == x.employeeNo.trim().toLowerCase()).id; item.employeeNo = x.employeeNo, item.entryMode = (x.entryMode == undefined || x.entryMode.length <= 0) ? 0 : this.entryModes.find(e => e.name.trim().toLowerCase() == x.entryMode.trim().toLowerCase()).value, - item.cardNo = (x.cardNo !== undefined || x.cardNo !== "" || x.cardNo !== null) ? item.employeeNo : item.cardNo, + item.cardNo = (x.cardNo == undefined || x.cardNo == "" || x.cardNo == null) ? item.employeeNo : x.cardNo, item.deviceNo = (x.deviceNo !== undefined || x.deviceNo !== "" || x.deviceNo !== null) ? "" : item.deviceNo, item.deviceIPAddress = (x.deviceIPAddress !== undefined || x.deviceIPAddress !== "" || x.deviceIPAddress !== null) ? "" : item.deviceIPAddress item.isManualEntry = true; diff --git a/HRM.UI/Controllers/Attendance/AttendanceController.cs b/HRM.UI/Controllers/Attendance/AttendanceController.cs index eccce54..427fbb6 100644 --- a/HRM.UI/Controllers/Attendance/AttendanceController.cs +++ b/HRM.UI/Controllers/Attendance/AttendanceController.cs @@ -2429,6 +2429,14 @@ namespace HRM.UI.Controllers.Attendance { //List items = new List(); //items = JsonConvert.DeserializeObject>(data.dataList.ToString()); + //DataTable accessCards = new AccessCardService().getCardInformation((int)EnumCardStatus.Attached); + foreach (AttnRawData item in items) + { + if (item.CardID == 0) + { + + } + } _attnRawDataService.SaveAuto(items); } catch (Exception e)