public Budget_iconAtHome SelectByOID(Guid guidiconOID) { Budget_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, sqlParam); if (ds.Tables[0].Rows.Count > 0) { icon = new Budget_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 <Budget_iconAtHome> SelectAll() { List <Budget_iconAtHome> iconAtHomeList = null; try { string sSQL = "SELECT * FROM iconAtHome Order By Seq"; DataSet ds = SqlHelper.ExecuteDataset(ConnectionString, CommandType.Text, sSQL); if (ds.Tables[0].Rows.Count > 0) { iconAtHomeList = new List <Budget_iconAtHome>(); Budget_iconAtHome icon = null; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { icon = new Budget_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); }