public static List <StationInWorkShop> GetStations(string WorkShopGUID) { List <StationInWorkShop> StationList = new List <StationInWorkShop>(); string strSql = "select * from VIEW_Base_StationInWorkShop where strWorkShopGUID = @WorkShopGUID order by nStationIndex"; SqlParameter[] sqlParams = { new SqlParameter("WorkShopGUID", WorkShopGUID) }; DataTable dt = SqlHelper.ExecuteDataset(SqlHelper.ConnString, CommandType.Text, strSql, sqlParams).Tables[0]; for (int i = 0; i < dt.Rows.Count; i++) { StationInWorkShop station = new StationInWorkShop(); station.RecordGUID = dt.Rows[i]["strRecordGUID"].ToString(); station.WorkShopGUID = dt.Rows[i]["strWorkShopGUID"].ToString(); station.StationGUID = dt.Rows[i]["strStationGUID"].ToString(); station.TMIS = Int32.Parse(dt.Rows[i]["nTMIS"].ToString()); station.StationIndex = Int32.Parse(dt.Rows[i]["nStationIndex"].ToString()); station.IsLocal = Int32.Parse(dt.Rows[i]["nIsLocal"].ToString()); station.IsGoBack = Int32.Parse(dt.Rows[i]["nIsGoBack"].ToString()); station.StationName = dt.Rows[i]["strStationName"].ToString(); station.bIsLocalStart = Int32.Parse(dt.Rows[i]["nIsLocalStart"].ToString()); StationList.Add(station); } return(StationList); }
public static bool IsAlias(Int32 TMIS, StationInWorkShop station, DataTable dtAlias) { for (int i = 0; i < dtAlias.Rows.Count; i++) { if ((dtAlias.Rows[i]["strRecordGUID"].ToString() == station.RecordGUID) && (dtAlias.Rows[i]["nTMIS"].ToString() == TMIS.ToString())) { return(true); } } return(false); }