|
|
|
@ -282,9 +282,11 @@ public class GradingResultVM : BaseViewModel |
|
|
|
} |
|
|
|
} |
|
|
|
[Log] |
|
|
|
[Log] |
|
|
|
private void SaveToCsv() |
|
|
|
private void SaveToCsv() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
try |
|
|
|
{ |
|
|
|
{ |
|
|
|
string strBaseUrl = AppDomain.CurrentDomain.BaseDirectory; |
|
|
|
string strBaseUrl = AppDomain.CurrentDomain.BaseDirectory; |
|
|
|
string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,"csv", "histroy.csv"); |
|
|
|
string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "csv", "histroy.csv"); |
|
|
|
Measurements info = algorithmResult.measurements; |
|
|
|
Measurements info = algorithmResult.measurements; |
|
|
|
string line = |
|
|
|
string line = |
|
|
|
$"{DiamondCode}," + |
|
|
|
$"{DiamondCode}," + |
|
|
|
@ -304,8 +306,9 @@ public class GradingResultVM : BaseViewModel |
|
|
|
$"," + |
|
|
|
$"," + |
|
|
|
$"," + |
|
|
|
$"," + |
|
|
|
$"{GetGradeEnName(GetGradeOrder(CutLevelTotal))}"; |
|
|
|
$"{GetGradeEnName(GetGradeOrder(CutLevelTotal))}"; |
|
|
|
if (File.Exists(filePath)) { |
|
|
|
if (File.Exists(filePath)) |
|
|
|
using (var writer = new StreamWriter(filePath,true)) |
|
|
|
{ |
|
|
|
|
|
|
|
using (var writer = new StreamWriter(filePath, true)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
writer.WriteLine(line); |
|
|
|
writer.WriteLine(line); |
|
|
|
@ -314,7 +317,8 @@ public class GradingResultVM : BaseViewModel |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
File.Create(filePath).Close(); |
|
|
|
File.Create(filePath).Close(); |
|
|
|
string header = "Diamond Code,Wight,Measurement1, Measurement2, Measurement3, Table, Crown Height,Pavilion Depth, Total Depth,Crown Angle, Pavilion Angle,Culet Size, Girdle Percent,Girdle Name, POL or Pol/ Sym,SYM,CUT - PROP"; |
|
|
|
string header = |
|
|
|
|
|
|
|
"Diamond Code,Wight,Measurement1, Measurement2, Measurement3, Table, Crown Height,Pavilion Depth, Total Depth,Crown Angle, Pavilion Angle,Culet Size, Girdle Percent,Girdle Name, POL or Pol/ Sym,SYM,CUT - PROP"; |
|
|
|
using (var writer = new StreamWriter(filePath, true)) |
|
|
|
using (var writer = new StreamWriter(filePath, true)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
writer.WriteLine(header); |
|
|
|
writer.WriteLine(header); |
|
|
|
@ -322,6 +326,11 @@ public class GradingResultVM : BaseViewModel |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
catch (Exception ex) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Logger.Error($"Auto Save Error: {ex.Message}"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void saveTempDS(string selValue) |
|
|
|
private void saveTempDS(string selValue) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|