Пример #1
0
        public Form1()
        {
            /* Use Customer Data Gateway to return all records*/
            InitializeComponent();
            CustomersList = CustomerActireRecord.Find();
            BindingSource bSource = new BindingSource();

            bSource.DataSource       = CustomersList;
            dataGridView1.DataSource = bSource;
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            // Save using active records
            CustomerActireRecord NewCustomer = new CustomerActireRecord(textBoxName.Text, Double.Parse(textBox1.Text), Int32.Parse(textBox2.Text), textBox3.Text);

            NewCustomer.Insert();
            CustomersList.Add(NewCustomer);
            dataGridView1.DataSource = CustomersList;
            dataGridView1.Update();
            dataGridView1.Refresh();
        }