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

@ -117,8 +117,8 @@ public class LotDispositionHelper {
public static void AttachSave(AppSettings appSettings, LotDispositionDMO lotDispositionDMO, int issueID, int userId, string fullFileName, Stream stream) {
// Some browsers send file names with full path.
// We are only interested in the file name.
var fileName = Path.GetFileName(fullFileName);
var physicalPath = Path.Combine(appSettings.AttachmentFolder + "LotDisposition", fileName);
string fileName = Path.GetFileName(fullFileName);
string physicalPath = Path.Combine(appSettings.AttachmentFolder + "LotDisposition", fileName);
using (FileStream fileStream = new(physicalPath, FileMode.Create, FileAccess.Write)) {
stream.CopyTo(fileStream);
@ -134,7 +134,7 @@ public class LotDispositionHelper {
public static string ExcelLotOpen(LotDispositionDMO lotDispositionDMO, int issueID, string userIdentityName, string lotTempPipeLine, string fullFileName, Stream stream) {
string physicalPath;
var fileExtension = Path.GetExtension(fullFileName);
string fileExtension = Path.GetExtension(fullFileName);
string fName = userIdentityName + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString();
physicalPath = Path.Combine(lotTempPipeLine, fName + "." + fileExtension);
@ -142,20 +142,18 @@ public class LotDispositionHelper {
stream.CopyTo(fileStream);
}
#if !NET8
ExcelData x = new ExcelData(physicalPath);
var lotNumbers = x.ReadData();
ExcelData x = new (physicalPath);
IEnumerable<ExcelData.ExcelLotInfo> lotNumbers = x.ReadData();
foreach (var lotInfo in lotNumbers) {
Lot l = new Lot();
l.LotNumber = lotInfo.LotNo;
foreach (ExcelData.ExcelLotInfo lotInfo in lotNumbers) {
Lot l = new();
l.LotNumber = lotInfo.LotNo ?? string.Empty;
l.IssueID = issueID;
if (l.LotStatusOptionID == 0)
l.LotStatusOption.LotStatusOptionID = (int)GlobalVars.LotStatusOption.Release;
lotDispositionDMO.InsertLot(l, true);
}
#endif
FileInfo f = new(physicalPath);
if (f.Exists)