Exemplo n.º 1
0
        public ExpressCompanySet()
        {
            InitializeComponent();
            this.dataGridView1.AutoGenerateColumns = false;
            this.dataGridView1.DataSource          = CompanyList;

            string command = string.Empty;

            command = "select * from CompanySet ";
            DataTable dt = conn.GetDataTableBySql(command);

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    CompanyEntry entry = new CompanyEntry();
                    entry.CompanyName = dt.Rows[i]["CompanyName"].ToString();
                    entry.ExpressNo   = dt.Rows[i]["ExpressNo"].ToString();
                    this.CompanyList.Add(entry);
                }
            }
        }
Exemplo n.º 2
0
        private void btnInsert_Click(object sender, EventArgs e)
        {
            CompanyEntry entry = new CompanyEntry();

            this.CompanyList.Add(entry);
        }