private void menuItemWithAccessLevel24_Click(object sender, EventArgs e) { if (CheckIfFormSpawned(typeof(CustomerForm)) == null) { CustomerForm ocf = new CustomerForm(postgreConnection, globalDS); ocf.MdiParent = this; ocf.Show(); } else { ((CustomerForm)CheckIfFormSpawned(typeof(CustomerForm))).Focus(); } }
private void button4_Click(object sender, EventArgs e) { CustomerForm sf; if (selectedOrder != null) { if (((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(CustomerForm)) == null) { sf = new CustomerForm(postgreConnection, dataSet1, (int)selectedOrder[2]); sf.MdiParent = this.MdiParent; sf.Show(); } else { ((CustomerForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(CustomerForm))).ChangeActiveCustomer((int)selectedOrder[2]); ((CustomerForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(CustomerForm))).Focus(); } } else MessageBox.Show("Неверный ввод"); }
private void открытьКарточкуЗаказчикаToolStripMenuItem_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count != 0) { if (((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(CustomerForm)) == null) { CustomerForm sf = new CustomerForm(pgc, gds, (int)dataGridView1.SelectedRows[0].Cells["customer_id"].Value); sf.MdiParent = this.MdiParent; sf.Show(); } else { ((CustomerForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(CustomerForm))).ChangeActiveCustomer((int)dataGridView1.SelectedRows[0].Cells["customer_id"].Value); ((CustomerForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(CustomerForm))).Focus(); } } else MessageBox.Show("Неверный ввод"); }