コード例 #1
0
ファイル: Ticket.cs プロジェクト: LazyBui/Peygir
        public static string[] GetReporters(IDatabaseProvider db)
        {
            if (db == null)
            {
                throw new ArgumentNullException(nameof(db));
            }
            TicketReportersTableAdapter tableAdapter = db.DB.TicketReportersTableAdapter;

            PeygirDatabaseDataSet.TicketReportersDataTable rows = tableAdapter.GetData();

            // Create list.
            List <string> reporters = new List <string>();

            foreach (var row in rows)
            {
                // Add.
                string reporter = row.Reporter;
                reporters.Add(reporter);
            }

            return(reporters.ToArray());
        }