public List <ElementKey> SelectByOID(Guid guidElementOID) { List <ElementKey> allKey = null; try { string sSQL = "SELECT Culture.*,Element.ElementKey FROM CL_ApplicationElementCulture Culture Left Join CL_ApplicationElement Element on Element.ElementOID = Culture.ElementOID WHERE Culture.ElementOID=@ElementOID"; SqlParameter[] sqlParam = new SqlParameter[1]; sqlParam[0] = new SqlParameter("@ElementOID", SqlDbType.UniqueIdentifier); sqlParam[0].Value = guidElementOID; DataSet ds = SqlHelper.ExecuteDataset(ConnectionString, CommandType.Text, sSQL, sqlParam); if (ds.Tables[0].Rows.Count > 0) { DataRow oneRow; allKey = new List <ElementKey>(); ElementKey elk = new ElementKey(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { oneRow = ds.Tables[0].Rows[i]; elk = new ElementKey(); elk.ElementOID = new Guid(oneRow["ElementOID"].ToString()); elk.Key = oneRow["ElementKey"].ToString(); elk.Culture = oneRow["Culture"].ToString(); elk.Value = oneRow["PropertyValue"].ToString(); allKey.Add(elk); } } } catch (Exception ex) { } return(allKey); }
public List <ElementKey> SelectAll() { List <ElementKey> allKey = null; try { string sSQL = "SELECT Culture.*,Element.ElementKey FROM CL_ApplicationElementCulture Culture Left Join CL_ApplicationElement Element on Element.ElementOID = Culture.ElementOID"; DataSet ds = SqlHelper.ExecuteDataset(ConnectionString, CommandType.Text, sSQL); if (ds.Tables[0].Rows.Count > 0) { DataRow oneRow; allKey = new List <ElementKey>(); ElementKey elk = new ElementKey(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { oneRow = ds.Tables[0].Rows[i]; elk = new ElementKey(); elk.ElementOID = new Guid(oneRow["ElementOID"].ToString()); elk.Key = oneRow["ElementKey"].ToString(); elk.Culture = oneRow["Culture"].ToString(); elk.Value = oneRow["PropertyValue"].ToString(); allKey.Add(elk); } } } catch (Exception ex) { } return(allKey); }