public iconAtHome SelectByOID(string PrefixTable, Guid guidiconOID) { iconAtHome icon = null; try { string sSQL = "SELECT * FROM ##iconAtHome WHERE iconOID=@iconOID"; SqlParameter[] sqlParam = new SqlParameter[1]; sqlParam[0] = new SqlParameter("@iconOID", SqlDbType.UniqueIdentifier); sqlParam[0].Value = guidiconOID; DataSet ds = SqlHelper.ExecuteDataset(ConnectionString, CommandType.Text, sSQL.Replace("##", PrefixTable), sqlParam); if (ds.Tables[0].Rows.Count > 0) { icon = new iconAtHome(); icon.iconOID = new Guid(ds.Tables[0].Rows[0]["iconOID"].ToString()); icon.Seq = Convert.ToInt32(ds.Tables[0].Rows[0]["Seq"].ToString()); icon.FileName = ds.Tables[0].Rows[0]["FileName"].ToString(); icon.Title = ds.Tables[0].Rows[0]["Title"].ToString(); icon.ShortDes = ds.Tables[0].Rows[0]["ShortDes"].ToString(); icon.iconURL = ds.Tables[0].Rows[0]["iconURL"].ToString(); } } catch (Exception ex) { } return(icon); }
public List <iconAtHome> SelectAll(string PrefixTable) { List <iconAtHome> iconAtHomeList = null; try { string sSQL = "SELECT * FROM ##iconAtHome"; DataSet ds = SqlHelper.ExecuteDataset(ConnectionString, CommandType.Text, sSQL.Replace("##", PrefixTable)); if (ds.Tables[0].Rows.Count > 0) { iconAtHomeList = new List <iconAtHome>(); iconAtHome icon = null; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { icon = new iconAtHome(); icon.iconOID = new Guid(ds.Tables[0].Rows[i]["iconOID"].ToString()); icon.Seq = Convert.ToInt32(ds.Tables[0].Rows[i]["Seq"].ToString()); icon.FileName = ds.Tables[0].Rows[i]["FileName"].ToString(); icon.Title = ds.Tables[0].Rows[i]["Title"].ToString(); icon.ShortDes = ds.Tables[0].Rows[i]["ShortDes"].ToString(); icon.iconURL = ds.Tables[0].Rows[i]["iconURL"].ToString(); iconAtHomeList.Add(icon); } } } catch (Exception ex) { } return(iconAtHomeList); }