|
|
@@ -2245,20 +2245,23 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
if (e.RowIndex >= 0)
|
|
|
{
|
|
|
- if (LabelInf.Columns[e.ColumnIndex].Name == "pib_datecode")
|
|
|
+ if (!(DataHelper.DBConnectionString.Contains("richwell") || DataHelper.DBConnectionString.Contains("192.168.0.88")))
|
|
|
{
|
|
|
- string datecode = LabelInf.Rows[e.RowIndex].Cells["pib_datecode"].Value.ToString();
|
|
|
- try
|
|
|
+ if (LabelInf.Columns[e.ColumnIndex].Name == "pib_datecode")
|
|
|
{
|
|
|
- System.DateTime dt = System.DateTime.ParseExact(datecode, "yyyyMMdd", CultureInfo.CurrentCulture);
|
|
|
- GregorianCalendar gc = new GregorianCalendar();
|
|
|
- int weekOfYear = gc.GetWeekOfYear(dt, CalendarWeekRule.FirstDay, DayOfWeek.Monday);
|
|
|
- if (weekOfYear < 10)
|
|
|
- LabelInf.Rows[e.RowIndex].Cells["pib_datecode1"].Value = dt.Year.ToString().Substring(2, 2) + "0" + weekOfYear;
|
|
|
- else
|
|
|
- LabelInf.Rows[e.RowIndex].Cells["pib_datecode1"].Value = dt.Year.ToString().Substring(2, 2) + weekOfYear;
|
|
|
+ string datecode = LabelInf.Rows[e.RowIndex].Cells["pib_datecode"].Value.ToString();
|
|
|
+ try
|
|
|
+ {
|
|
|
+ System.DateTime dt = System.DateTime.ParseExact(datecode, "yyyyMMdd", CultureInfo.CurrentCulture);
|
|
|
+ GregorianCalendar gc = new GregorianCalendar();
|
|
|
+ int weekOfYear = gc.GetWeekOfYear(dt, CalendarWeekRule.FirstDay, DayOfWeek.Monday);
|
|
|
+ if (weekOfYear < 10)
|
|
|
+ LabelInf.Rows[e.RowIndex].Cells["pib_datecode1"].Value = dt.Year.ToString().Substring(2, 2) + "0" + weekOfYear;
|
|
|
+ else
|
|
|
+ LabelInf.Rows[e.RowIndex].Cells["pib_datecode1"].Value = dt.Year.ToString().Substring(2, 2) + weekOfYear;
|
|
|
+ }
|
|
|
+ catch (Exception) { }
|
|
|
}
|
|
|
- catch (Exception) { }
|
|
|
}
|
|
|
}
|
|
|
}
|