private TrainNo GetTrainNo(TF.RunSafty.Model.VIEW_Base_TrainNo trainNo) { TrainNo model = new TrainNo(); model.trainjiaoluID = trainNo.strTrainJiaoluGUID; model.trainjiaoluName = trainNo.strTrainJiaoluName; model.placeID = trainNo.strPlaceID; model.placeName = trainNo.strPlaceName; model.trainTypeName = trainNo.strTrainTypeName; model.trainNumber = trainNo.strTrainNumber; model.trainNo = trainNo.strTrainNo; model.remark = trainNo.strRemark; if (trainNo.dtStartTime.HasValue) { model.startTime = trainNo.dtStartTime.Value; } model.startStationID = trainNo.strStartStation; model.startStationName = trainNo.strStartStationName; model.endStationID = trainNo.strEndStation; model.endStationName = trainNo.strEndStationName; model.trainmanTypeID = trainNo.nTrainmanTypeID.ToString(); model.trainmanTypeName = trainNo.strTrainmanTypeName; model.planTypeID = trainNo.nPlanType.ToString(); model.planTypeName = trainNo.strPlanTypeName; model.dragTypeID = trainNo.nDragType.ToString(); model.dragTypeName = trainNo.nDragTypeName; model.kehuoID = trainNo.nKehuoID.ToString(); model.kehuoName = trainNo.strKehuoName; model.remarkTypeID = trainNo.nRemarkType.ToString(); model.remarkTypeName = trainNo.strRemarkTypeName; model.trainNoID = trainNo.strGUID; if (trainNo.dtPlanStartTime.HasValue) { model.kaiCheTime = trainNo.dtPlanStartTime.Value; } else { if (trainNo.dtStartTime.HasValue) { model.kaiCheTime = trainNo.dtStartTime.Value; } } model.strWorkDay = trainNo.strWorkDay; model.dtCallTime = trainNo.dtCallTime; model.dtArriveTime = trainNo.dtArriveTime; model.nNeedRest = trainNo.nNeedRest; return(model); }
public void SetModelValue(TrainNo paramModel, TF.RunSafty.Model.TAB_Base_TrainNo train) { train.dtCreateTime = DateTime.Now; if (!string.IsNullOrEmpty(paramModel.dragTypeID)) { train.nDragType = int.Parse(paramModel.dragTypeID); } if (!string.IsNullOrEmpty(paramModel.kehuoID)) { train.nKehuoID = int.Parse(paramModel.kehuoID); } if (!string.IsNullOrEmpty(paramModel.planTypeID)) { train.nPlanType = int.Parse(paramModel.planTypeID); } train.nRemarkType = int.Parse(paramModel.remarkTypeID); train.nTrainmanTypeID = int.Parse(paramModel.trainmanTypeID); train.strEndStation = paramModel.endStationID; train.strPlaceID = paramModel.placeID; train.strRemark = paramModel.remark; train.strStartStation = paramModel.startStationID; train.strTrainJiaoluGUID = paramModel.trainjiaoluID; train.strTrainNo = paramModel.trainNo; train.strTrainNumber = paramModel.trainNumber; train.strTrainTypeName = paramModel.trainTypeName; DateTime dt = paramModel.startTime; train.dtStartTime = dt; train.dtRealStartTime = dt; DateTime dtChuQinTime; if (DateTime.TryParse(paramModel.kaiCheTime.ToString(), out dtChuQinTime)) { train.dtPlanStartTime = dtChuQinTime; } train.nNeedRest = paramModel.nNeedRest; train.dtCallTime = paramModel.dtCallTime; train.dtArriveTime = paramModel.dtArriveTime; train.strWorkDay = paramModel.strWorkDay; }