示例#1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            ERP.DAL.ERPRepository repository = new DAL.ERPRepository();
            var tableInfo = repository.GetTableInfos("pre_customers");

            string s = tableInfo.GetColumnSql();
            var    sortColumnInfos = tableInfo.SortColumnInfos;

            var data = repository.GetDataTable(s);

            this.dataGridView1.DataSource = data;
        }
示例#2
0
        public void TestMethod1()
        {
            ERP.DAL.ERPRepository repository = new DAL.ERPRepository();
            var tableInfo = repository.GetTableInfos("pre_customers");

            //ICollection<string> rs = repository.GetCols("pre_customers");
            string s = tableInfo.GetColumnSql();
            var    sortColumnInfos = tableInfo.SortColumnInfos;

            Console.WriteLine(s);
            //repository.AddPreCustomers();

            var data = repository.GetDataTable(s);

            foreach (DataRow row in data.Rows)
            {
                sortColumnInfos.ToList().ForEach(colInfo =>
                {
                    Console.Write(row[colInfo.Name].ToString() + ",");
                });
                Console.WriteLine();
            }
        }