Example #1
0
 private void button4_Click(object sender, EventArgs e)
 {
     if (COrderEntryDataGridView.SelectedRows.Count > 0)
     {
         int          id           = int.Parse(COrderEntryDataGridView[Program.FindTitle(COrderEntryDataGridView, "Id"), COrderEntryDataGridView.SelectedRows[0].Index].Value.ToString());
         OrderEntry   orderEntry   = (from o in CurrentOrder.OrderEntry where o.Id == id select o).First();
         OPOrderEntry oPOrderEntry = new OPOrderEntry();
         oPOrderEntry.FormClosed += (object s, FormClosedEventArgs args) => COrderEntryDataGridView.Refresh();
         oPOrderEntry.Show();
         oPOrderEntry.Change(orderEntry);
         oPOrderEntry.Id = id;
     }
 }
Example #2
0
 private void COrderDataGridView_SelectionChanged(object sender, EventArgs e)
 {
     if (COrderDataGridView.SelectedRows.Count > 0)
     {
         int id = int.Parse(COrderDataGridView[Program.FindTitle(COrderDataGridView, "Идентификационный номер"), COrderDataGridView.SelectedRows[0].Index].Value.ToString());
         CurrentOrder = (from o in Operations.cont.OrderSet where o.Id == id select o).First();
         BindingList <OrderEntry> bindingList = new BindingList <OrderEntry>(CurrentOrder.OrderEntry.ToList());
         COrderEntryDataGridView.DataSource = bindingList;
         Program.HideColumns(ref COrderEntryDataGridView, EntityTypes.OrderEntry, CurrentUser);
         Program.Rename(ref COrderEntryDataGridView);
         COrderEntryDataGridView.Refresh();
         COrderEntryDataGridView.ClearSelection();
     }
 }