Пример #1
0
        private void client_suoyin_Load(object sender, EventArgs e)
        {
            customerdao     s  = new customerdao();
            List <customer> ss = new List <customer>();

            ss = s.find_all();
            Console.Write(ss);
            DataSet   ds = new DataSet();
            DataTable dt = new DataTable("Table_New");

            dt.Columns.Add("编号", typeof(string));
            dt.Columns.Add("姓名", typeof(string));
            dt.Columns.Add("联系电话", typeof(string));
            dt.Columns.Add("地址", typeof(string));
            int i = 0;

            foreach (customer s1 in ss)
            {
                dt.Rows.Add(s1.Customer_number, s1.Customer_name, s1.Phone, s1.Address);
                i++;
            }
            dataGridView1.DataSource = dt;
            foreach (DataGridViewColumn co in dataGridView1.Columns)
            {
                if (co.Index != 0)
                {
                    co.ReadOnly = true;
                }
            }
            data = dataGridView1;
        }
Пример #2
0
        private void ShoukuanSchedule_Load(object sender, EventArgs e)
        {
            customerdao     cdao = new customerdao();
            List <customer> cc   = new List <customer>();

            cc = cdao.find_all();
            foreach (customer c in cc)
            {
                comboBox1.Items.Add(c.Customer_number + " " + c.Customer_name);
            }
        }
Пример #3
0
        private void saleDetail_Load(object sender, EventArgs e)
        {
            customerdao     sdao = new customerdao();
            List <customer> ss   = new List <customer>();

            ss = sdao.find_all();
            foreach (customer s in ss)
            {
                comboBox1.Items.Add(s.Customer_number + " " + s.Customer_name);
                Console.WriteLine("加油");
            }
            label6.Text = "0";
        }