Added Viewer and
change to App Setting File from Constants
This commit is contained in:
@ -1,12 +0,0 @@
|
||||
namespace OI.Metrology.Shared.Models;
|
||||
|
||||
public class SelectListGroup
|
||||
{
|
||||
|
||||
public bool Disabled { get; set; }
|
||||
public string? Name { get; set; }
|
||||
|
||||
public SelectListGroup()
|
||||
{ }
|
||||
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
namespace OI.Metrology.Shared.Models;
|
||||
|
||||
public class SelectListItem
|
||||
{
|
||||
|
||||
public bool Disabled { get; set; }
|
||||
public SelectListGroup? Group { get; set; }
|
||||
public bool Selected { get; set; }
|
||||
public string? Text { get; set; }
|
||||
public string? Value { get; set; }
|
||||
|
||||
public SelectListItem()
|
||||
{ }
|
||||
|
||||
public SelectListItem(string text, string value)
|
||||
{
|
||||
Text = text;
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public SelectListItem(string text, string value, bool selected)
|
||||
{
|
||||
Text = text;
|
||||
Value = value;
|
||||
Selected = selected;
|
||||
}
|
||||
|
||||
public SelectListItem(string text, string value, bool selected, bool disabled)
|
||||
{
|
||||
Text = text;
|
||||
Value = value;
|
||||
Selected = selected;
|
||||
Disabled = disabled;
|
||||
}
|
||||
|
||||
}
|
8
Shared/Models/IWorkingDirectory.cs
Normal file
8
Shared/Models/IWorkingDirectory.cs
Normal file
@ -0,0 +1,8 @@
|
||||
namespace OI.Metrology.Shared.Models;
|
||||
|
||||
public interface IWorkingDirectory
|
||||
{
|
||||
|
||||
static string GetWorkingDirectory(string? executingAssemblyName, string subDirectoryName) => WorkingDirectory.GetWorkingDirectory(executingAssemblyName, subDirectoryName);
|
||||
|
||||
}
|
50
Shared/Models/WorkingDirectory.cs
Normal file
50
Shared/Models/WorkingDirectory.cs
Normal file
@ -0,0 +1,50 @@
|
||||
namespace OI.Metrology.Shared.Models;
|
||||
|
||||
internal abstract class WorkingDirectory
|
||||
{
|
||||
|
||||
internal static string GetWorkingDirectory(string? executingAssemblyName, string subDirectoryName)
|
||||
{
|
||||
string result = string.Empty;
|
||||
if (executingAssemblyName is null)
|
||||
throw new Exception();
|
||||
string traceFile;
|
||||
List<string> directories = new();
|
||||
Environment.SpecialFolder[] specialFolders = new Environment.SpecialFolder[]
|
||||
{
|
||||
Environment.SpecialFolder.LocalApplicationData,
|
||||
Environment.SpecialFolder.ApplicationData,
|
||||
Environment.SpecialFolder.History,
|
||||
Environment.SpecialFolder.CommonApplicationData,
|
||||
Environment.SpecialFolder.InternetCache
|
||||
};
|
||||
foreach (Environment.SpecialFolder specialFolder in specialFolders)
|
||||
directories.Add(Path.Combine(Environment.GetFolderPath(specialFolder), subDirectoryName, executingAssemblyName));
|
||||
foreach (string directory in directories)
|
||||
{
|
||||
for (int i = 1; i < 3; i++)
|
||||
{
|
||||
if (i == 1)
|
||||
result = directory;
|
||||
else
|
||||
result = string.Concat("D", directory[1..]);
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(result))
|
||||
_ = Directory.CreateDirectory(result);
|
||||
traceFile = string.Concat(result, @"\", DateTime.Now.Ticks, ".txt");
|
||||
File.WriteAllText(traceFile, traceFile);
|
||||
File.Delete(traceFile);
|
||||
break;
|
||||
}
|
||||
catch (Exception) { result = string.Empty; }
|
||||
}
|
||||
if (!string.IsNullOrEmpty(result))
|
||||
break;
|
||||
}
|
||||
if (string.IsNullOrEmpty(result))
|
||||
throw new Exception("Unable to set working directory!");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@ -4,5 +4,5 @@ namespace OI.Metrology.Shared.Repositories;
|
||||
|
||||
public interface IDbConnectionFactory
|
||||
{
|
||||
DbConnection GetDbConnection(String connStringName);
|
||||
DbConnection GetDbConnection();
|
||||
}
|
@ -21,24 +21,28 @@ public interface IMetrologyRepo
|
||||
void PurgeExistingData(int toolTypeId, string title);
|
||||
long InsertToolDataJSON(JToken jsonbody, long headerId, List<ToolTypeMetadata> metaData, string tableName);
|
||||
|
||||
DataTable ExportData(String spName, DateTime startTime, DateTime endTime);
|
||||
DataTable ExportData(string spName, DateTime startTime, DateTime endTime);
|
||||
|
||||
DataTable GetHeaders(int toolTypeId, DateTime? startTime, DateTime? endTime, int? pageNo, int? pageSize, long? headerid, out long totalRecords, bool isArchive);
|
||||
DataTable GetData(int toolTypeId, long headerId, bool isArchive);
|
||||
DataTable GetHeaders(int toolTypeId, DateTime? startTime, DateTime? endTime, int? pageNo, int? pageSize, long? headerid, out long totalRecords);
|
||||
DataTable GetData(int toolTypeId, long headerId);
|
||||
DataTable GetDataSharePoint(int toolTypeId, string headerId);
|
||||
|
||||
IEnumerable<HeaderCommon> GetHeaderTitles(int toolTypeId, int? pageNo, int? pageSize, out long totalRecords, bool isArchive);
|
||||
IEnumerable<HeaderCommon> GetHeaderTitles(int toolTypeId, int? pageNo, int? pageSize, out long totalRecords);
|
||||
|
||||
Guid GetHeaderAttachmentIDByTitle(int toolTypeId, string title);
|
||||
Guid GetDataAttachmentIDByTitle(int toolTypeId, string title);
|
||||
|
||||
Guid GetHeaderAttachmentID(int toolTypeId, long headerId);
|
||||
string GetHeaderInsertDate(int toolTypeId, long headerId);
|
||||
string GetAttachmentInsertDateByGUID(string tableName, Guid attachmentId);
|
||||
void SetHeaderDirName(string tableName, long headerId, string dateDir);
|
||||
Guid GetDataAttachmentID(int toolTypeId, long headerId, string title);
|
||||
string GetDataInsertDate(int toolTypeId, long headerId, string title);
|
||||
|
||||
void SetDataDirName(string tableName, long headerId, string title, string dateDir);
|
||||
DataSet GetOIExportData(int toolTypeId, long headerid);
|
||||
|
||||
IEnumerable<KeyValuePair<string, string>> GetHeaderFields(int toolTypeId, long headerid, bool isArchive);
|
||||
IEnumerable<KeyValuePair<string, string>> GetHeaderFields(int toolTypeId, long headerid);
|
||||
|
||||
IEnumerable<AwaitingDispo> GetAwaitingDispo();
|
||||
|
||||
|
@ -6,8 +6,5 @@ public interface IAttachmentsService
|
||||
{
|
||||
Stream GetAttachmentStreamByTitle(ToolType toolType, bool header, string title, string filename);
|
||||
Stream GetAttachmentStreamByAttachmentId(ToolType toolType, bool header, Guid attachmentId, string filename);
|
||||
//System.IO.Stream GetAttachmentStreamByAttachmentId(ToolType toolType, bool header, Guid attachmentId, string filename);
|
||||
|
||||
// void SaveAttachment(ToolType toolType, long headerId, string dataUniqueId, string filename, Microsoft.AspNetCore.Http.IFormFile uploadedFile);
|
||||
void SaveAttachment(ToolType toolType, long headerId, string dataUniqueId, string filename, object uploadedFile);
|
||||
}
|
@ -1,11 +1,9 @@
|
||||
using OI.Metrology.Shared.Models;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace OI.Metrology.Shared.ViewModels;
|
||||
|
||||
public class Export
|
||||
{
|
||||
public IEnumerable<SelectListItem>? ToolTypes { get; set; }
|
||||
|
||||
[Required]
|
||||
public string? ToolType { get; set; }
|
||||
|
Reference in New Issue
Block a user