Пример #1
0
 private void menuItemWithAccessLevel2_Click(object sender, EventArgs e)
 {
     if (dataGridView1.SelectedRows.Count > 0)
     {
         if (((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(OrderForm)) == null)
         {
             OrderForm of = new OrderForm(postgreConnection, dataSet1, selectedOrderID: (int)dataGridView1.SelectedRows[0].Cells[0].Value);
             of.MdiParent = this.MdiParent;
             of.Show();
         }
         else
         {
             ((OrderForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(OrderForm))).ChangeActiveOrder((int)dataGridView1.SelectedRows[0].Cells[0].Value);
             ((OrderForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(OrderForm))).Focus();
         }
     }
 }
Пример #2
0
 private void карточкаЭтогоЗаказаToolStripMenuItem_Click(object sender, EventArgs e)
 {
     OrderForm sf;
     if(currAction==1)
         if (dataGridView1.SelectedRows.Count > 0)
         {
             if ((int)dataGridView1.SelectedRows[0].Cells["order_id"].Value != -1)
             {
                 if (((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(OrderForm)) == null)
                 {
                     sf = new OrderForm(postgreConnection, dataSet1, (int)dataGridView1.SelectedRows[0].Cells["order_id"].Value);
                     sf.MdiParent = this.MdiParent;
                     sf.Show();
                 }
                 else
                 {
                     ((OrderForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(OrderForm))).ChangeActiveOrder((int)dataGridView1.SelectedRows[0].Cells["order_id"].Value);
                     ((OrderForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(OrderForm))).Focus();
                 }
             }
             else
                 MessageBox.Show("У данного отряда нет текущего заказа");
         }
 }
Пример #3
0
 private void показатьКарточкуДанногоЗаказаToolStripMenuItem_Click(object sender, EventArgs e)
 {
     OrderForm sf;
     if (ordersDataGridView.SelectedRows.Count > 0)
     {
         if (((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(OrderForm)) == null)
         {
             sf = new OrderForm(postgreConnection, dataSet1, (int)ordersDataGridView.SelectedRows[0].Cells["order_id"].Value);
             sf.MdiParent = this.MdiParent;
             sf.Show();
         }
         else
         {
             ((OrderForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(OrderForm))).ChangeActiveOrder((int)ordersDataGridView.SelectedRows[0].Cells["order_id"].Value);
             ((OrderForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(OrderForm))).Focus();
         }
     }
 }
Пример #4
0
 private void menuItemWithAccessLevel21_Click(object sender, EventArgs e)
 {
     if (CheckIfFormSpawned(typeof(OrderForm)) == null)
     {
         OrderForm of = new OrderForm(postgreConnection, globalDS);
         of.MdiParent = this;
         of.Show();
     }
     else
         ((OrderForm)CheckIfFormSpawned(typeof(OrderForm))).Focus();
 }
Пример #5
0
 private void открытьКарточкуЗаказаToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (dataGridView1.SelectedRows.Count != 0)
     {
         if (((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(OrderForm)) == null)
         {
             OrderForm sf = new OrderForm(pgc, gds, (int)dataGridView1.SelectedRows[0].Cells["order_id"].Value);
             sf.MdiParent = this.MdiParent;
             sf.Show();
         }
         else
         {
             ((OrderForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(OrderForm))).ChangeActiveOrder((int)dataGridView1.SelectedRows[0].Cells["order_id"].Value);
             ((OrderForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(OrderForm))).Focus();
         }
     }
     else
         MessageBox.Show("Неверный ввод");
 }