Refactoring
This commit is contained in:
parent
6bfd1d981b
commit
663dd39de4
@ -110,27 +110,14 @@ public class ExcelReader : IReader, IDisposable
|
||||
object name = worksheet.Cells[row, NameCell.Column].Value2;
|
||||
object sku = worksheet.Cells[row, SkuCell.Column].Value2;
|
||||
object measure = worksheet.Cells[row, MeasureCell.Column].Value2;
|
||||
Measure productMeasure;
|
||||
|
||||
switch (measure.ToString())
|
||||
var productMeasure = measure.ToString() switch
|
||||
{
|
||||
case "м":
|
||||
productMeasure = Measure.M;
|
||||
break;
|
||||
case "шт":
|
||||
productMeasure = Measure.P;
|
||||
break;
|
||||
case "м2":
|
||||
productMeasure = Measure.M2;
|
||||
break;
|
||||
case "кг":
|
||||
productMeasure = Measure.Kg;
|
||||
break;
|
||||
default:
|
||||
productMeasure = Measure.P;
|
||||
break;
|
||||
}
|
||||
|
||||
"м" => Measure.M,
|
||||
"шт" => Measure.P,
|
||||
"м2" => Measure.M2,
|
||||
"кг" => Measure.Kg,
|
||||
_ => Measure.P,
|
||||
};
|
||||
if (productLine == null || name == null || sku == null)
|
||||
continue;
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
public class FileDialog : IFileDialog
|
||||
{
|
||||
private Application _application;
|
||||
private readonly Application _application;
|
||||
|
||||
public FileDialog(Application application)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user