//从数据行中读取数据到NameGroup中,填充入寓寓休信息 public static void GroupWithRestFromDB(Group group, DataRow dr) { GroupFromDB(group, dr); group.arriveTime = TFParse.DBTimeToSerialString(dr["dtLastArriveTime"]); group.lastInRoomTime1 = TFParse.DBTimeToSerialString(dr["InRoomTime1"]); group.lastInRoomTime2 = TFParse.DBTimeToSerialString(dr["InRoomTime2"]); group.lastInRoomTime3 = TFParse.DBTimeToSerialString(dr["InRoomTime3"]); group.lastInRoomTime4 = TFParse.DBTimeToSerialString(dr["InRoomTime4"]); }
//从数据行中读取数据到Group中 public static void GroupFromDB(Group group, DataRow dr) { group.groupID = dr["strGroupGUID"].ToString(); group.trainPlanID = dr["strTrainPlanGUID"].ToString(); group.trainNo = ObjectConvertClass.static_ext_string(dr["strTrainNo"]); group.trainTypeName = ObjectConvertClass.static_ext_string(dr["strTrainTypeName"]); group.trainNumber = ObjectConvertClass.static_ext_string(dr["strTrainNumber"]); group.startTime = ObjectConvertClass.static_ext_string(dr["dtStartTime"]); group.trainman1.trainmanID = dr["strTrainmanGUID1"].ToString(); group.trainman1.trainmanName = dr["strTrainmanName1"].ToString(); group.trainman1.trainmanNumber = dr["strTrainmanNumber1"].ToString(); group.trainman1.telNumber = ObjectConvertClass.static_ext_string(dr["strTelNumber1"]); group.trainman1.strFixedGroupID = ObjectConvertClass.static_ext_string(dr["strFixedGroupGUID1"]); group.trainman1.lastEndworkTime = TF.RunSafty.Utils.Parse.TFParse.DBToDateTime(dr["dtLastEndworkTime1"], DateTime.MinValue); Int32.TryParse(dr["bIsKey1"].ToString(), out group.trainman1.isKey); if (!TF.RunSafty.Utils.Parse.TFParse.DBToInt(dr["nTrainmanState1"], ref group.trainman1.trainmanState)) { group.trainman1.trainmanState = 7; //tsNil; } if (!TF.RunSafty.Utils.Parse.TFParse.DBToInt(dr["nPost1"], ref group.trainman1.postID)) { group.trainman1.postID = 0; } group.trainman2.trainmanID = dr["strTrainmanGUID2"].ToString(); group.trainman2.trainmanName = dr["strTrainmanName2"].ToString(); group.trainman2.trainmanNumber = dr["strTrainmanNumber2"].ToString(); group.trainman2.telNumber = dr["strTelNumber2"].ToString(); group.trainman2.strFixedGroupID = ObjectConvertClass.static_ext_string(dr["strFixedGroupGUID2"]); group.trainman2.lastEndworkTime = TF.RunSafty.Utils.Parse.TFParse.DBToDateTime(dr["dtLastEndworkTime2"], DateTime.MinValue); Int32.TryParse(dr["bIsKey2"].ToString(), out group.trainman2.isKey); if (!TF.RunSafty.Utils.Parse.TFParse.DBToInt(dr["nTrainmanState2"], ref group.trainman2.trainmanState)) { group.trainman2.trainmanState = 7; //tsNil; } if (!TF.RunSafty.Utils.Parse.TFParse.DBToInt(dr["nPost2"], ref group.trainman2.postID)) { group.trainman2.postID = 0; } group.trainman3.trainmanID = dr["strTrainmanGUID3"].ToString(); group.trainman3.trainmanName = dr["strTrainmanName3"].ToString(); group.trainman3.trainmanNumber = dr["strTrainmanNumber3"].ToString(); group.trainman3.telNumber = dr["strTelNumber3"].ToString(); group.trainman3.strFixedGroupID = ObjectConvertClass.static_ext_string(dr["strFixedGroupGUID3"]); group.trainman3.lastEndworkTime = TF.RunSafty.Utils.Parse.TFParse.DBToDateTime(dr["dtLastEndworkTime3"], DateTime.MinValue); Int32.TryParse(dr["bIsKey3"].ToString(), out group.trainman3.isKey); if (!TF.RunSafty.Utils.Parse.TFParse.DBToInt(dr["nTrainmanState3"], ref group.trainman3.trainmanState)) { group.trainman3.trainmanState = 7; //tsNil; } if (!TF.RunSafty.Utils.Parse.TFParse.DBToInt(dr["nPost3"], ref group.trainman3.postID)) { group.trainman3.postID = 0; } group.trainman4.trainmanID = dr["strTrainmanGUID4"].ToString(); group.trainman4.trainmanName = dr["strTrainmanName4"].ToString(); group.trainman4.trainmanNumber = dr["strTrainmanNumber4"].ToString(); group.trainman4.telNumber = dr["strTelNumber4"].ToString(); group.trainman4.strFixedGroupID = ObjectConvertClass.static_ext_string(dr["strFixedGroupGUID4"]); group.trainman4.lastEndworkTime = TF.RunSafty.Utils.Parse.TFParse.DBToDateTime(dr["dtLastEndworkTime4"], DateTime.MinValue); Int32.TryParse(dr["bIsKey4"].ToString(), out group.trainman4.isKey); if (!TF.RunSafty.Utils.Parse.TFParse.DBToInt(dr["nTrainmanState4"], ref group.trainman4.trainmanState)) { group.trainman4.trainmanState = 7; //tsNil; } if (!TF.RunSafty.Utils.Parse.TFParse.DBToInt(dr["nPost4"], ref group.trainman4.postID)) { group.trainman4.postID = 0; } group.arriveTime = TFParse.DBTimeToSerialString(dr["dtLastArriveTime"]); group.groupState = 2;//tsNormal; if ((dr["GroupState"] != null) && (DBNull.Value.Equals(dr["GroupState"]) == false)) { group.groupState = 3;//tsPlaning; //psBeginWork if (dr["GroupState"].ToString() == "7") { group.groupState = 6;// tsRuning; } } }