예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            OrderDetails od = new OrderDetails("自己改", 0, 0);

            listBindingSource.Add(od);
            OrderService os = new OrderService();

            or.numOfDetails++;
            dataGridView2.Refresh();
            os.Update(or);
        }
예제 #2
0
 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0 && e.ColumnIndex == 5)
     {
         OrderDetails ods = (OrderDetails)listBindingSource.Current;
         OrderService os  = new OrderService();
         os.DeleteDetail(ods.ID);
         or.numOfDetails--;
         dataGridView2.Refresh();
         listBindingSource.RemoveAt(e.RowIndex);
         dataGridView2.Refresh();
         os.Update(or);
     }
 }
예제 #3
0
        private void button3_Click(object sender, EventArgs e)
        {
            OrderService os = new OrderService();

            os.Update(or);
        }