Beispiel #1
0
        private void dataGridView1_CellMouseDown(object sender, DataGridViewCellEventArgs e)
        {
            if(e.ColumnIndex == 3) {
                orderIndex
                        = int.Parse(dataGridView1[0, e.RowIndex].Value.ToString()) - 1;
                if (orders[orderIndex].ODetails.Count > 0)
                {
                    orderDetailsBindingSource.DataSource = orders[orderIndex].ODetails;
                }
                
            }
            if(e.ColumnIndex == 4)
            {
                orderIndex = int.Parse(dataGridView1[0, e.RowIndex].Value.ToString()) - 1;
                if (orderIndex > 0 && orderIndex < orders.Count)
                {
                    orders.RemoveAt(orderIndex);
                    orderBindingSource.DataSource = orders.Where(s => s.OrderNo > 0);
                    DeleteSuccess ds = new DeleteSuccess();
                    ds.Show();
                }

            }
            
           

        }
Beispiel #2
0
 private void dataGridView1_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (e.ColumnIndex == 3)
     {
         int orderIndex
             = e.RowIndex;
         if (orderIndex >= 0 && orderIndex < orders.Count)
         {
             if (orders[orderIndex].Items.Count > 0)
             {
                 orderItemBindingSource.DataSource = orders[orderIndex].Items;
             }
         }
     }
     if (e.ColumnIndex == 4)
     {
         int orderIndex = e.RowIndex;
         if (orderIndex >= 0 && orderIndex < orders.Count)
         {
             orders.RemoveAt(orderIndex);
             orderBindingSource.DataSource = orders.Where(s => s.Id != null);
             DeleteSuccess ds = new DeleteSuccess();
             ds.Show();
         }
     }
 }