コード例 #1
0
 public List<DbDescription> GetDescriptions(IRepository repository)
 {
     var list = new List<DbDescription>();
     string res = string.Empty;
     var tlist = repository.GetAllTableNames();
     if (tlist.Contains(tableName))
     {
         var ds = repository.ExecuteSql(selectScript);
         if (ds.Tables.Count > 0)
         {
             foreach (DataRow row in ds.Tables[0].Rows)
             {
                 var dbDesc = new DbDescription();
                 dbDesc.Object = row[0] == DBNull.Value ? null : row[0].ToString();
                 dbDesc.Parent = row[1] == DBNull.Value ? null : row[1].ToString();
                 dbDesc.Description = row[2] == DBNull.Value ? null : row[2].ToString();
                 list.Add(dbDesc);
             }
         }
     }
     return list;
 }
コード例 #2
0
ファイル: DescriptionHelper.cs プロジェクト: herohut/elab
        public List <DbDescription> GetDescriptions(IRepository repository)
        {
            var    list  = new List <DbDescription>();
            string res   = string.Empty;
            var    tlist = repository.GetAllTableNames();

            if (tlist.Contains(tableName))
            {
                var ds = repository.ExecuteSql(selectScript);
                if (ds.Tables.Count > 0)
                {
                    foreach (DataRow row in ds.Tables[0].Rows)
                    {
                        var dbDesc = new DbDescription();
                        dbDesc.Object      = row[0] == DBNull.Value ? null : row[0].ToString();
                        dbDesc.Parent      = row[1] == DBNull.Value ? null : row[1].ToString();
                        dbDesc.Description = row[2] == DBNull.Value ? null : row[2].ToString();
                        list.Add(dbDesc);
                    }
                }
            }
            return(list);
        }