public sm_biz_Workpiece CreateWorkpiece(string fullno) { int year = Serial.Year; var _o = new sm_biz_Workpiece(); _o.MachineID = fullno.ToCharArray(0, 1)[0]; _o.Type = fullno.ToCharArray(1, 1)[0]; _o.Date = new DateTime(year, fullno.ToCharArray(2, 1)[0] - '@', fullno.Substring(3, 2).ToInt32()); _o.Shift = fullno.ToCharArray(5, 1)[0]; _o.Serial = SafeConvert.ToInt16(fullno.Substring(6, 3)); _o.State = 0; return(_o); }