private void frmPLRR_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (((CPFM)playbookFormRef.cbxFormations.SelectedItem).FTYP == 1 || ((CPFM)playbookFormRef.cbxFormations.SelectedItem).FTYP == 2 || ((CPFM)playbookFormRef.cbxFormations.SelectedItem).FTYP == 3)
            {
                playbookFormRef.PSLO = EditedPSALs;
            }
            else if (((CPFM)playbookFormRef.cbxFormations.SelectedItem).FTYP == 11 || ((CPFM)playbookFormRef.cbxFormations.SelectedItem).FTYP == 12 || ((CPFM)playbookFormRef.cbxFormations.SelectedItem).FTYP == 13)
            {
                playbookFormRef.PSLD = EditedPSALs;
            }

            int dgvRow = playbookFormRef.dgvPLYS.CurrentCell.RowIndex;
            int dgvCol = playbookFormRef.dgvPLYS.CurrentCell.ColumnIndex;

            playbookFormRef.SetPlay(playbookFormRef.Play);
            playbookFormRef.Play = playbookFormRef.GetPlay();
            playbookFormRef.UpdatePlay(playbookFormRef.Play);

            playbookFormRef.dgvPLYS.CurrentCell = playbookFormRef.dgvPLYS[dgvCol, dgvRow];
        }
Ejemplo n.º 2
0
        private void btnCreatePSAL_Click(object sender, EventArgs e)
        {
            if (((CPFM)playbookFormRef.cbxFormations.SelectedItem).FTYP == 1 || ((CPFM)playbookFormRef.cbxFormations.SelectedItem).FTYP == 2 || ((CPFM)playbookFormRef.cbxFormations.SelectedItem).FTYP == 3)
            {
                playbookFormRef.PSLO.AddRange(NewPSAL);
            }
            else if (((CPFM)playbookFormRef.cbxFormations.SelectedItem).FTYP == 11 || ((CPFM)playbookFormRef.cbxFormations.SelectedItem).FTYP == 12 || ((CPFM)playbookFormRef.cbxFormations.SelectedItem).FTYP == 13)
            {
                playbookFormRef.PSLD.AddRange(NewPSAL);
            }

            if (chbAssignPSAL.Checked)
            {
                int dgvRow = playbookFormRef.dgvPLYS.CurrentCell.RowIndex;
                int dgvCol = playbookFormRef.dgvPLYS.CurrentCell.ColumnIndex;

                playbookFormRef.Play.PLYS[playbookFormRef.dgvPLYS.SelectedCells[0].RowIndex] = new PLYS
                {
                    rec  = playbookFormRef.Play.PLYS[playbookFormRef.dgvPLYS.SelectedCells[0].RowIndex].rec,
                    PSAL = NewPSAL[0].psal,
                    ARTL = playbookFormRef.Play.PLYS[playbookFormRef.dgvPLYS.SelectedCells[0].RowIndex].ARTL,
                    PLYL = playbookFormRef.Play.PLYS[playbookFormRef.dgvPLYS.SelectedCells[0].RowIndex].PLYL,
                    PLRR = ((PLRR)cbxPLRR.SelectedItem).plrr,
                    poso = playbookFormRef.Play.PLYS[playbookFormRef.dgvPLYS.SelectedCells[0].RowIndex].poso
                };

                playbookFormRef.SetPlay(playbookFormRef.Play);
                playbookFormRef.Play = playbookFormRef.GetPlay();
                playbookFormRef.UpdatePlay(playbookFormRef.Play);

                playbookFormRef.dgvPLYS.CurrentCell = playbookFormRef.dgvPLYS[dgvCol, dgvRow];
            }

            playbookFormRef.PSAL_PLRR_ARTL = playbookFormRef.GetPSAL_PLRR_ARTL();

            Close();
        }
        private void btnResetSETL_Click(object sender, EventArgs e)
        {
            playbookFormRef.Play.SETL = (from row in DefaultSETL
                                         select new SETL()
            {
                rec = row.rec,
                setl = row.setl,
                FORM = row.FORM,
                MOTN = row.MOTN,
                CLAS = row.CLAS,
                SETT = row.SETT,
                SITT = row.SITT,
                SLF_ = row.SLF_,
                name = row.name,
                poso = row.poso
            }).Cast <SETL>().ToList();

            dgvSETL.AutoResizeColumns();
            int SETLrec = ((SETL)playbookFormRef.cbxSubFormations.SelectedItem).rec;
            int PBPLrec = ((PBPL)playbookFormRef.cbxPlays.SelectedItem).rec;

            playbookFormRef.SetPlay(playbookFormRef.Play);
            playbookFormRef.Play = playbookFormRef.GetPlay();
            playbookFormRef.UpdateSubFormations();
            playbookFormRef.UpdateAlignments();
            playbookFormRef.UpdatePlays();

            playbookFormRef.cbxSubFormations.SelectedItem = (playbookFormRef.cbxSubFormations.Items.Cast <SETL>().ToList()).Find(item => item.rec == SETLrec);
            playbookFormRef.cbxPlays.SelectedItem         = (playbookFormRef.cbxPlays.Items.Cast <PBPL>().ToList()).Find(item => item.rec == PBPLrec);

            playbookFormRef.UpdatePlay(playbookFormRef.Play);
            dgvSETL.DataSource = playbookFormRef.Play.SETL;

            Program.ResizeDataGrid(dgvSETL);
            Focus();
        }