コード例 #1
0
        public static DataTable LoadReports()
        {
            DataTable table;

            try
            {
                string[]          files = Directory.GetFiles(Constant.ApplicationDirectory + @"\report\", "*.grf");
                List <HIS_Report> list  = new List <HIS_Report>();
                for (int i = 0; i < files.Length; i++)
                {
                    FileInfo   info = new FileInfo(files[i]);
                    HIS_Report item = new HIS_Report();
                    item.ReportName = info.Name;
                    item.ReportPath = files[i];
                    list.Add(item);
                }
                table = ApiFunction.ObjToDataTable(list);
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
            return(table);
        }