コード例 #1
0
        public List <ApplicationElement> SelectByOID(string PrefixTable, Guid guidElementOID)
        {
            List <ApplicationElement> 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.Replace("##", PrefixTable), sqlParam);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    DataRow oneRow;
                    allKey = new List <ApplicationElement>();
                    ApplicationElement elk = new ApplicationElement();
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        oneRow         = ds.Tables[0].Rows[i];
                        elk            = new ApplicationElement();
                        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);
        }
コード例 #2
0
        public List <ApplicationElement> SelectAll(string PrefixTable)
        {
            List <ApplicationElement> 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.Replace("##", PrefixTable));
                if (ds.Tables[0].Rows.Count > 0)
                {
                    DataRow oneRow;
                    allKey = new List <ApplicationElement>();
                    ApplicationElement elk = new ApplicationElement();
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        oneRow         = ds.Tables[0].Rows[i];
                        elk            = new ApplicationElement();
                        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);
        }