|
@@ -64,7 +64,7 @@ namespace UAS_LabelMachine
|
|
|
if (DateCode.Length == 4)
|
|
|
{
|
|
|
oYear = int.Parse(DateCode.Substring(0, 2));
|
|
|
- DateTime date= new DateTime(DateTime.Now.Year, 1, 1).AddDays(7 * int.Parse(DateCode.Substring(2, 2)));
|
|
|
+ DateTime date = new DateTime(DateTime.Now.Year, 1, 1).AddDays(7 * int.Parse(DateCode.Substring(2, 2)));
|
|
|
oMonth = date.Month;
|
|
|
oDay = date.Day;
|
|
|
}
|
|
@@ -279,7 +279,11 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
else if (collection[i] is NumericUpDown)
|
|
|
{
|
|
|
- (collection[i] as NumericUpDown).Value = int.Parse(dt.Rows[0][j].ToString());
|
|
|
+ int num = 0;
|
|
|
+ if (int.TryParse(dt.Rows[0][j].ToString(), out num))
|
|
|
+ {
|
|
|
+ (collection[i] as NumericUpDown).Value = num;
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|