private void editbtn_Click(object sender, EventArgs e) { foreach (DataGridViewCell cell in dataGridView1.SelectedCells) { dataGridView1.Rows[cell.RowIndex].Selected = true; } if (dataGridView1.SelectedRows.Count > 1) { return; } Order order1 = new Order(); foreach (DataGridViewRow row in dataGridView1.SelectedRows) { string selectID = row.Cells[0].Value.ToString(); string ID = selectID.ToString(); //order1 = OrderService.Get(ID); OrderService.Remove(ID); } createForm form = new createForm(order1); if (DialogResult.OK == form.ShowDialog()) { OrderService.Add(order1); bindingSource1.DataSource = OrderService.GetAll(); bindingSource1.ResetBindings(false); } }
private void btnCreate_Click(object sender, EventArgs e) { createForm frm = new createForm(); frm.MdiParent = this; frm.WindowState = FormWindowState.Maximized; frm.Show(); }
private void creatbtn_Click(object sender, EventArgs e) { createForm form = new createForm(); if (DialogResult.OK == form.ShowDialog()) { OrderService.Add(form.order); bindingSource1.DataSource = OrderService.GetAll(); bindingSource1.ResetBindings(false); } }