Example #1
0
 private void button3_Click(object sender, EventArgs e)
 {
     SquadForm sf;
     if (selectedOrder != null)
     {
         if (((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(SquadForm)) == null)
         {
             sf = new SquadForm(postgreConnection, dataSet1, (int)selectedOrder[3]);
             sf.MdiParent = this.MdiParent;
             sf.Show();
         }
         else
         {
             ((SquadForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(SquadForm))).ChangeActiveSquad((int)selectedOrder[3]);
             ((SquadForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(SquadForm))).Focus();
         }
     }
     else
         MessageBox.Show("Неверный ввод");
 }
Example #2
0
 private void карточкаЭтогоОтрядаToolStripMenuItem_Click(object sender, EventArgs e)
 {
     SquadForm sf;
     if (dataGridView1.SelectedRows.Count > 0)
     {
         if (((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(SquadForm)) == null)
         {
             sf = new SquadForm(postgreConnection, dataSet1, (int)dataGridView1.SelectedRows[0].Cells["id"].Value);
             sf.MdiParent = this.MdiParent;
             sf.Show();
         }
         else
         {
             ((SquadForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(SquadForm))).ChangeActiveSquad((int)dataGridView1.SelectedRows[0].Cells["id"].Value);
             ((SquadForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(SquadForm))).Focus();
         }
     }
 }
Example #3
0
 private void menuItemWithAccessLevel11_Click(object sender, EventArgs e)
 {
     if (CheckIfFormSpawned(typeof(SquadForm)) == null)
     {
         SquadForm sqForm = new SquadForm(postgreConnection, globalDS);
         sqForm.MdiParent = this;
         sqForm.Show();
     }
     else ((SquadForm)CheckIfFormSpawned(typeof(SquadForm))).Focus();
 }
Example #4
0
 private void показатьКарточкуДанногоОтрядаToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     SquadForm sf;
     if(listBox3.SelectedIndex!=-1)
     {
         if (((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(SquadForm)) == null)
         {
             sf = new SquadForm(postgreConnection, dataSet1, (int)listBox3.SelectedValue);
             sf.MdiParent = this.MdiParent;
             sf.Show();
         }
         else
         {
             ((SquadForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(SquadForm))).ChangeActiveSquad((int)listBox3.SelectedValue);
             ((SquadForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(SquadForm))).Focus();
         }
     }
 }
Example #5
0
 private void открытьКарточкуОтрядаToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if(listBox2.SelectedIndex!=-1)
     {
             SquadForm sf;
             if (((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(SquadForm)) == null)
             {
                 sf = new SquadForm(postgreConnection, data, (int)listBox2.SelectedValue);
                 sf.MdiParent = this.MdiParent;
                 sf.Show();
             }
             else
             {
                 ((SquadForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(SquadForm))).ChangeActiveSquad((int)listBox2.SelectedValue);
                 ((SquadForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(SquadForm))).Focus();
             }
     }
     else
         MessageBox.Show("Неверный ввод");
 }
Example #6
0
 private void открытьКарточкуОтрядаToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (dataGridView1.SelectedRows.Count != 0)
     {
         if (((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(SquadForm)) == null)
         {
             SquadForm sf = new SquadForm(pgc, gds, (int)dataGridView1.SelectedRows[0].Cells["squad_id"].Value);
             sf.MdiParent = this.MdiParent;
             sf.Show();
         }
         else
         {
             ((SquadForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(SquadForm))).ChangeActiveSquad((int)dataGridView1.SelectedRows[0].Cells["squad_id"].Value);
             ((SquadForm)((MainForm)this.MdiParent).CheckIfFormSpawned(typeof(SquadForm))).Focus();
         }
     }
     else
         MessageBox.Show("Неверный ввод");
 }