optimize
wet 2 years ago
parent 2051c65ce3
commit 9e0b3c08f5

@ -2711,7 +2711,7 @@ namespace Myshipping.Application
{ {
var value = string.Empty; var value = string.Empty;
if (order.PKGS!=null) { if (order.PKGS!=null) {
if (order.PKGS.ToString().Split('.').Count() > 1) if (order.PKGS.ToString().Split('.').Count() > 1&&Convert.ToInt32(order.PKGS.ToString().Split('.')[1])>0)
{ {
value = string.Format("{0:F2}", order.PKGS); value = string.Format("{0:F2}", order.PKGS);
} }
@ -2724,11 +2724,11 @@ namespace Myshipping.Application
if (cell != null) if (cell != null)
{ {
row.Cells[_cellNum - 1].SetCellValue(value + "(" + order.KINDPKGS + ")"); row.Cells[_cellNum - 1].SetCellValue(value + order.KINDPKGS );
} }
else else
{ {
row.CreateCell(_cellNum - 1).SetCellValue(value + "(" + order.KINDPKGS + ")"); row.CreateCell(_cellNum - 1).SetCellValue(value + order.KINDPKGS );
} }
} }
@ -2737,7 +2737,7 @@ namespace Myshipping.Application
var value = string.Empty; var value = string.Empty;
if (order.KGS != null) if (order.KGS != null)
{ {
if (order.KGS.ToString().Split('.').Count() > 1) if (order.KGS.ToString().Split('.').Count() > 1 && Convert.ToInt32(order.KGS.ToString().Split('.')[1]) > 0)
{ {
value = string.Format("{0:F2}", order.KGS); value = string.Format("{0:F2}", order.KGS);
} }
@ -2750,11 +2750,11 @@ namespace Myshipping.Application
ICell cell = row.GetCell(_cellNum - 1); ICell cell = row.GetCell(_cellNum - 1);
if (cell != null) if (cell != null)
{ {
row.Cells[_cellNum - 1].SetCellValue(value + "(KGS)"); row.Cells[_cellNum - 1].SetCellValue(value + "KGS");
} }
else else
{ {
row.CreateCell(_cellNum - 1).SetCellValue(value + "(KGS)"); row.CreateCell(_cellNum - 1).SetCellValue(value + "KGS");
} }
@ -2765,7 +2765,7 @@ namespace Myshipping.Application
var value = string.Empty; var value = string.Empty;
if (order.CBM != null) if (order.CBM != null)
{ {
if (order.CBM.ToString().Split('.').Count() > 1) if (order.CBM.ToString().Split('.').Count() > 1 && Convert.ToInt32(order.CBM.ToString().Split('.')[1]) > 0)
{ {
value = string.Format("{0:F2}", order.CBM); value = string.Format("{0:F2}", order.CBM);
} }
@ -2778,11 +2778,11 @@ namespace Myshipping.Application
ICell cell = row.GetCell(_cellNum - 1); ICell cell = row.GetCell(_cellNum - 1);
if (cell != null) if (cell != null)
{ {
row.Cells[_cellNum - 1].SetCellValue(value + "(CBM)"); row.Cells[_cellNum - 1].SetCellValue(value + "CBM");
} }
else else
{ {
row.CreateCell(_cellNum - 1).SetCellValue(value + "(CBM)"); row.CreateCell(_cellNum - 1).SetCellValue(value + "CBM");
} }
} }

Loading…
Cancel
Save