Merged PR 13298: Added just one approval back in after removing the method call from bug 239935

Added just one approval back in after removing the method call from bug 239935

Added IExcelDataReader support into MK Project

Changed instructions below the ECN Title field to align with Windchill

Related work items: #225480, #244087
This commit is contained in:
2025-03-19 21:19:06 +01:00
parent c4d29dad4e
commit f110fba4cd
9 changed files with 346 additions and 122 deletions

View File

@ -46,14 +46,12 @@ public class MRBHelper {
stream.CopyTo(fileStream);
}
#if !NET8
ExcelData x = new ExcelData(physicalPath);
ExcelData x = new(physicalPath);
lotDataList = x.ReadQDBFlagData();
foreach (string lotData in lotDataList) {
mrbDMO.InsertMRB_QDB_HoldFlag(guid, lotData, operation);
}
#endif
FileInfo f = new(physicalPath);
if (f.Exists)
@ -170,14 +168,12 @@ public class MRBHelper {
stream.CopyTo(fileStream);
}
#if !NET8
ExcelData x = new ExcelData(physicalPath);
ExcelData x = new(physicalPath);
lotDataList = x.ReadQDBFlagData();
foreach (string lotData in lotDataList) {
mrbDMO.InsertMRB_QDB_HoldFlag(guid, lotData, operation);
}
#endif
FileInfo f = new(physicalPath);
if (f.Exists)
@ -246,17 +242,16 @@ public class MRBHelper {
string fName = userIdentityName + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString();
string physicalPath = Path.Combine(lotTempPipeLine, fName + "." + fileExtension);
#if !NET8
IEnumerable<ExcelData.ExcelLotInfo> lotNumbers;
try {
using (var fileStream = new FileStream(physicalPath, FileMode.Create, FileAccess.Write)) {
using (FileStream fileStream = new(physicalPath, FileMode.Create, FileAccess.Write)) {
stream.CopyTo(fileStream);
}
ExcelData x = new ExcelData(physicalPath);
ExcelData x = new(physicalPath);
lotNumbers = x.ReadData();
} catch (Exception ex) {
throw new Exception(String.Format("Invalid file format for {0}: {1}", fileName, ex.Message));
throw new Exception(string.Format("Invalid file format for {0}: {1}", fileName, ex.Message));
}
// Get Tool, Issue Start and End Date
@ -266,7 +261,7 @@ public class MRBHelper {
foreach (var lotInfo in lotNumbers) {
if (lotInfo.LotDispo.Length == 1) {
if (dispos.Count(d => d.DispositionType.Trim().ToUpper() == lotInfo.LotDispo.Trim().ToUpper()) == 0) {
throw new Exception(String.Format("Invalid lot disposition {0} for lot no {1}",
throw new Exception(string.Format("Invalid lot disposition {0} for lot no {1}",
lotInfo.LotDispo, lotInfo.LotNo));
}
}
@ -276,8 +271,8 @@ public class MRBHelper {
if (!mrbInfo.ToolCSV.ToUpper().Equals("NA")) {
foreach (var lotInfo in lotNumbers) {
bool existingLotUpdated;
Lot l = new Lot();
l.LotNumber = lotInfo.LotNo;
Lot l = new();
l.LotNumber = lotInfo.LotNo ?? string.Empty;
if (lotInfo.LotDispo.Length == 1) {
l.DispoType = lotInfo.LotDispo[0];
}
@ -298,8 +293,8 @@ public class MRBHelper {
// Only find the child Splits when a Tool or a list of Tools is provided
foreach (var lotInfo in lotNumbers) {
bool existingLotUpdated;
Lot l = new Lot();
l.LotNumber = lotInfo.LotNo;
Lot l = new();
l.LotNumber = lotInfo.LotNo ?? string.Empty;
if (lotInfo.LotDispo.Length == 1) {
l.DispoType = lotInfo.LotDispo[0];
}
@ -308,7 +303,6 @@ public class MRBHelper {
mrbDMO.InsertLot(l, true, out existingLotUpdated);
}
}
#endif
FileInfo f = new(physicalPath);
if (f.Exists)