Created
March 24, 2020 18:23
-
-
Save hasokeric/a59612b22aa0e0777d2b8da14981a4a1 to your computer and use it in GitHub Desktop.
LaborDtl Fix Record Epicor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// <auto-generated> | |
// This code was generated by a tool. Any changes made manually will be lost | |
// the next time this code is regenerated. | |
// </auto-generated> | |
using (var updater = this.getDataUpdater("Erp", "LaborDtl")) | |
{ | |
var ttResultQuery = ttResults | |
.Where(row => !string.IsNullOrEmpty(row.RowMod) && row.RowMod != "P"); | |
foreach (var ttResult in ttResultQuery) | |
{ | |
var dsLaborDtl = (from tt in Db.LaborDtl where tt.Company == ttResult.LaborDtl_Company && tt.EmployeeNum == ttResult.LaborDtl_EmployeeNum && tt.LaborHedSeq == ttResult.LaborDtl_LaborHedSeq && tt.LaborDtlSeq == ttResult.LaborDtl_LaborDtlSeq select tt).FirstOrDefault(); | |
dsLaborDtl.TimeStatus = ttResult.LaborDtl_TimeStatus; | |
Db.Validate(); | |
ttResult.RowMod = "P"; | |
// Object to query mapping | |
{ | |
if (dsLaborDtl != null) | |
{ | |
ttResult.LaborDtl_ClockInDate = dsLaborDtl.ClockInDate; | |
ttResult.LaborDtl_Company = dsLaborDtl.Company; | |
ttResult.LaborDtl_EmployeeNum = dsLaborDtl.EmployeeNum; | |
ttResult.LaborDtl_LaborDtlSeq = dsLaborDtl.LaborDtlSeq; | |
ttResult.LaborDtl_LaborHedSeq = dsLaborDtl.LaborHedSeq; | |
ttResult.LaborDtl_TimeStatus = dsLaborDtl.TimeStatus; | |
} | |
} | |
} | |
} | |
var ttResultsForDelete = ttResults | |
.Where(row => row.RowMod != "P") | |
.ToArray(); | |
foreach (var ttResult in ttResultsForDelete) | |
{ | |
ttResults.Remove(ttResult); | |
} | |
foreach (var ttResult in ttResults) | |
{ | |
ttResult.RowMod = ""; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment