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 name = worksheet.Cells[row, NameCell.Column].Value2;
|
||||||
object sku = worksheet.Cells[row, SkuCell.Column].Value2;
|
object sku = worksheet.Cells[row, SkuCell.Column].Value2;
|
||||||
object measure = worksheet.Cells[row, MeasureCell.Column].Value2;
|
object measure = worksheet.Cells[row, MeasureCell.Column].Value2;
|
||||||
Measure productMeasure;
|
var productMeasure = measure.ToString() switch
|
||||||
|
|
||||||
switch (measure.ToString())
|
|
||||||
{
|
{
|
||||||
case "м":
|
"м" => Measure.M,
|
||||||
productMeasure = Measure.M;
|
"шт" => Measure.P,
|
||||||
break;
|
"м2" => Measure.M2,
|
||||||
case "шт":
|
"кг" => Measure.Kg,
|
||||||
productMeasure = Measure.P;
|
_ => Measure.P,
|
||||||
break;
|
};
|
||||||
case "м2":
|
|
||||||
productMeasure = Measure.M2;
|
|
||||||
break;
|
|
||||||
case "кг":
|
|
||||||
productMeasure = Measure.Kg;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
productMeasure = Measure.P;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (productLine == null || name == null || sku == null)
|
if (productLine == null || name == null || sku == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
public class FileDialog : IFileDialog
|
public class FileDialog : IFileDialog
|
||||||
{
|
{
|
||||||
private Application _application;
|
private readonly Application _application;
|
||||||
|
|
||||||
public FileDialog(Application application)
|
public FileDialog(Application application)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user