Exemplo n.º 1
0
        private void карточкаТипаРаботыЭтогоЗаказаToolStripMenuItem_Click(object sender, EventArgs e)
        {
            WorkForm sf;
            if (currAction == 1)

                if (dataGridView1.SelectedRows.Count > 0)
                {
                    if ((int)dataGridView1.SelectedRows[0].Cells["work_id"].Value != -1)
                    {
                        if (((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(WorkForm)) == null)
                        {
                            sf = new WorkForm(postgreConnection, dataSet1, (int)dataGridView1.SelectedRows[0].Cells["work_id"].Value);
                            sf.MdiParent = this.MdiParent;
                            sf.Show();
                        }
                        else
                        {
                            ((WorkForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(WorkForm))).ChangeActiveWork((int)dataGridView1.SelectedRows[0].Cells["work_id"].Value);
                            ((WorkForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(WorkForm))).Focus();
                        }
                    }
                    else
                        MessageBox.Show("У данного отряда нет текущего заказа");
                }
        }
Exemplo n.º 2
0
 private void menuItemWithAccessLevel25_Click(object sender, EventArgs e)
 {
     if (CheckIfFormSpawned(typeof(WorkForm)) == null)
     {
         WorkForm ocf = new WorkForm(postgreConnection, globalDS);
         ocf.MdiParent = this;
         ocf.Show();
     }
     else
     {
         ((WorkForm)CheckIfFormSpawned(typeof(WorkForm))).Focus();
     }
 }
Exemplo n.º 3
0
 private void показатьКарточкуДанногоТипаРаботToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     WorkForm sf;
     if (listBox2.SelectedIndex != -1)
     {
         if (((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(WorkForm)) == null)
         {
             sf = new WorkForm(postgreConnection, dataSet1, (int)listBox2.SelectedValue);
             sf.MdiParent = this.MdiParent;
             sf.Show();
         }
         else
         {
             ((WorkForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(WorkForm))).ChangeActiveWork((int)listBox2.SelectedValue);
             ((WorkForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(WorkForm))).Focus();
         }
     }
 }
Exemplo n.º 4
0
 private void показатьКарточкуДанногоТипаРаботToolStripMenuItem_Click(object sender, EventArgs e)
 {
     WorkForm sf;
     if (dataGridView1.SelectedRows.Count > 0)
     {
         if (((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(SquadForm)) == null)
         {
             sf = new WorkForm(postgreConnection, dataSet1, (int)dataGridView1.SelectedRows[0].Cells["work_id"].Value);
             sf.MdiParent = this.MdiParent;
             sf.Show();
         }
         else
         {
             ((WorkForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(WorkForm))).ChangeActiveWork((int)dataGridView1.SelectedRows[0].Cells["work_id"].Value);
             ((WorkForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(WorkForm))).Focus();
         }
     }
 }
Exemplo n.º 5
0
 private void открытьКарточкуТипаРаботToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (dataGridView1.SelectedRows.Count != 0)
     {
         if (((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(OrderForm)) == null)
         {
             WorkForm sf = new WorkForm(pgc, gds, (int)dataGridView1.SelectedRows[0].Cells["work_id"].Value);
             sf.MdiParent = this.MdiParent;
             sf.Show();
         }
         else
         {
             ((WorkForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(WorkForm))).ChangeActiveWork((int)dataGridView1.SelectedRows[0].Cells["work_id"].Value);
             ((WorkForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(WorkForm))).Focus();
         }
     }
     else
         MessageBox.Show("Неверный ввод");
 }