Пример #1
0
 public static List<Statistic> getResearch()
 {
     try
     {
         String SQL = "SELECT Count(OutputID), TypeNo FROM ResearchOutput GROUP BY TypeNo;";
         Matrix matrix = RISReader.ReadTable(SQL);
         List<Statistic> Stats = new List<Statistic>();
         for (int x = 0; x < matrix.NumberOfRows; x++)
         {
             ArrayList AL = matrix.GetNextRow();
             Statistic stat = new Statistic();
             stat.Count = int.Parse(AL[0].ToString());
             stat.TypeNo = int.Parse(AL[1].ToString());
             switch (stat.TypeNo)
             {
                 case 0: stat.Type = "Journal Articles";
                     break;
                 case 1: stat.Type = "Conference Papers";
                     break;
                 default: stat.Type = "Books";
                     break;
             }
             Stats.Add(stat);
         }
         return Stats;
     }
     catch (Exception e)
     {
     }
     throw new MsgBoxException("HELO HI");
 }
Пример #2
0
 public static List<Statistic> getUsage()
 {
     try
     {
         String SQL = "SELECT Count(SysID), Type FROM RegisteredUser GROUP BY Type;";
         Matrix matrix = RISReader.ReadTable(SQL);
         List<Statistic> Stats = new List<Statistic>();
         for (int x = 0; x < matrix.NumberOfRows; x++)
         {
             ArrayList AL = matrix.GetNextRow();
             Statistic stat = new Statistic();
             stat.Count = int.Parse(AL[0].ToString());
             stat.Type = AL[1].ToString();
             
             Stats.Add(stat);
         }
         return Stats;
     }
     catch (Exception e)
     {
     }
     throw new MsgBoxException("HELO HI");
 }
Пример #3
0
        private static List<Statistic> getCombo(int typeno)
        {
            List<Statistic> Stats = new List<Statistic>();
            try
            {
                String SQL = String.Format("SELECT Count(R.OutputID), U.Type FROM ResearchOutput AS R INNER JOIN RegisteredUser AS U ON R.AuthorID = U.SysID WHERE R.TypeNo = '{0}' GROUP BY U.Type;",typeno);
                Matrix matrix = RISReader.ReadTable(SQL);

                for (int x = 0; x < matrix.NumberOfRows; x++)
                {
                    ArrayList AL = matrix.GetNextRow();
                    Statistic stat = new Statistic();
                    stat.Count = int.Parse(AL[0].ToString());
                    stat.TypeNo = typeno;
                    switch (stat.TypeNo)
                    {
                        case 0: stat.Type = "Journal Articles";
                            break;
                        case 1: stat.Type = "Conference Papers";
                            break;
                        default: stat.Type = "Books";
                            break;
                    }
                    stat.Type += " by \n" + AL[1].ToString() + "s";
                    stat.shortType = AL[1].ToString() + "s";
                    Stats.Add(stat);
                }
            }
            catch (Exception ex)
            {
            }
            return Stats;
        }