示例#1
0
        private void buttonOK_Click(object sender, EventArgs e)
        {
            try
            {
                newdata = read_data();

                DialogResult = DialogResult.OK;
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
示例#2
0
        public DlgGameExt(SqlConnection cn, STGameTagsPart?st)
        {
            InitializeComponent();

            connect = cn;

            if (st != null)
            {
                mode = 1;
                data = (STGameTagsPart)st;
            }
            else
            {
                mode = 0;
            }
        }
示例#3
0
        private STGameTagsPart read_data()
        {
            STGameTagsPart rData = new STGameTagsPart();

            rData.diktor     = new List <int>();
            rData.foto       = new List <int>();
            rData.interviewa = new List <int>();
            rData.interviewb = new List <int>();
            rData.komissar   = new List <int>();
            rData.report     = new List <int>();
            rData.secretar   = new List <int>();
            rData.statist    = new List <int>();
            rData.svabrist   = new List <int>();
            rData.tablo      = new List <int>();
            rData.video      = new List <int>();
            rData.vrach      = new List <int>();
            rData.t24        = new List <int>();
            rData.time       = new List <int>();


            string text   = null;
            string family = null;
            string name   = null;

            string[] words;

            try
            {
                // if (textBoxIntA.Text.Length > 0)
                //     rData.strinterviea = textBoxIntA.Text.Trim();
                // else rData.strinterviea = null;

                //  if (textBoxIntB.Text.Length > 0)
                //      rData.strintervieb = textBoxIntB.Text.Trim();
                //  else rData.strintervieb = null;

                /* секретарь */
                for (int i = 0; i < checkedListBoxSecretar.Items.Count; i++)
                {
                    if (checkedListBoxSecretar.GetItemChecked(i))
                    {
                        text = checkedListBoxSecretar.Items[i].ToString();
                        if (text.Length > 0)
                        {
                            char[] del = { ' ' };
                            words = text.Split(del);

                            family = words[0];
                            name   = words[1];

                            clPart = new CParticipant(connect, family, name);
                        }

                        rData.secretar.Add(clPart.stPart.idpart);
                    }
                }
                /* оператор табло */
                for (int i = 0; i < checkedListBoxTable.Items.Count; i++)
                {
                    if (checkedListBoxTable.GetItemChecked(i))
                    {
                        text = checkedListBoxTable.Items[i].ToString();
                        if (text.Length > 0)
                        {
                            char[] del = { ' ' };
                            words = text.Split(del);

                            family = words[0];
                            name   = words[1];

                            clPart = new CParticipant(connect, family, name);
                        }

                        rData.tablo.Add(clPart.stPart.idpart);
                    }
                }
                /* оператор время */
                for (int i = 0; i < checkedListBoxTime.Items.Count; i++)
                {
                    if (checkedListBoxTime.GetItemChecked(i))
                    {
                        text = checkedListBoxTime.Items[i].ToString();
                        if (text.Length > 0)
                        {
                            char[] del = { ' ' };
                            words = text.Split(del);

                            family = words[0];
                            name   = words[1];

                            clPart = new CParticipant(connect, family, name);
                        }

                        rData.time.Add(clPart.stPart.idpart);
                    }
                }
                /* оператор 24 */
                for (int i = 0; i < checkedListBox24.Items.Count; i++)
                {
                    if (checkedListBox24.GetItemChecked(i))
                    {
                        text = checkedListBox24.Items[i].ToString();
                        if (text.Length > 0)
                        {
                            char[] del = { ' ' };
                            words = text.Split(del);

                            family = words[0];
                            name   = words[1];

                            clPart = new CParticipant(connect, family, name);
                        }

                        rData.t24.Add(clPart.stPart.idpart);
                    }
                }
                /* диктор */
                for (int i = 0; i < checkedListBoxDiktor.Items.Count; i++)
                {
                    if (checkedListBoxDiktor.GetItemChecked(i))
                    {
                        text = checkedListBoxDiktor.Items[i].ToString();
                        if (text.Length > 0)
                        {
                            char[] del = { ' ' };
                            words = text.Split(del);

                            family = words[0];
                            name   = words[1];

                            clPart = new CParticipant(connect, family, name);
                        }

                        rData.diktor.Add(clPart.stPart.idpart);
                    }
                }
                /* врач */
                for (int i = 0; i < checkedListBoxVrach.Items.Count; i++)
                {
                    if (checkedListBoxVrach.GetItemChecked(i))
                    {
                        text = checkedListBoxVrach.Items[i].ToString();
                        if (text.Length > 0)
                        {
                            char[] del = { ' ' };
                            words = text.Split(del);

                            family = words[0];
                            name   = words[1];

                            clPart = new CParticipant(connect, family, name);
                        }

                        rData.vrach.Add(clPart.stPart.idpart);
                    }
                }
                /* комиссар */
                for (int i = 0; i < checkedListBoxKomissar.Items.Count; i++)
                {
                    if (checkedListBoxKomissar.GetItemChecked(i))
                    {
                        text = checkedListBoxKomissar.Items[i].ToString();
                        if (text.Length > 0)
                        {
                            char[] del = { ' ' };
                            words = text.Split(del);

                            family = words[0];
                            name   = words[1];

                            clPart = new CParticipant(connect, family, name);
                        }

                        rData.komissar.Add(clPart.stPart.idpart);
                    }
                }
                /* видео */
                for (int i = 0; i < checkedListBoxVideo.Items.Count; i++)
                {
                    if (checkedListBoxVideo.GetItemChecked(i))
                    {
                        text = checkedListBoxVideo.Items[i].ToString();
                        if (text.Length > 0)
                        {
                            char[] del = { ' ' };
                            words = text.Split(del);

                            family = words[0];
                            name   = words[1];

                            clPart = new CParticipant(connect, family, name);
                        }

                        rData.video.Add(clPart.stPart.idpart);
                    }
                }
                /* фото */
                for (int i = 0; i < checkedListBoxFoto.Items.Count; i++)
                {
                    if (checkedListBoxFoto.GetItemChecked(i))
                    {
                        text = checkedListBoxFoto.Items[i].ToString();
                        if (text.Length > 0)
                        {
                            char[] del = { ' ' };
                            words = text.Split(del);

                            family = words[0];
                            name   = words[1];

                            clPart = new CParticipant(connect, family, name);
                        }

                        rData.foto.Add(clPart.stPart.idpart);
                    }
                }
                /* интревью А */
                for (int i = 0; i < checkedListBoxIntrviewA.Items.Count; i++)
                {
                    if (checkedListBoxIntrviewA.GetItemChecked(i))
                    {
                        text = checkedListBoxIntrviewA.Items[i].ToString();
                        if (text.Length > 0)
                        {
                            char[] del = { ' ' };
                            words = text.Split(del);

                            family = words[0];
                            name   = words[1];

                            clPart = new CParticipant(connect, family, name);
                        }

                        rData.interviewa.Add(clPart.stPart.idpart);
                    }
                }
                /* интервью Б */
                for (int i = 0; i < checkedListBoxIntrviewB.Items.Count; i++)
                {
                    if (checkedListBoxIntrviewB.GetItemChecked(i))
                    {
                        text = checkedListBoxIntrviewB.Items[i].ToString();
                        if (text.Length > 0)
                        {
                            char[] del = { ' ' };
                            words = text.Split(del);

                            family = words[0];
                            name   = words[1];

                            clPart = new CParticipant(connect, family, name);
                        }

                        rData.interviewb.Add(clPart.stPart.idpart);
                    }
                }
                /* швабра */
                for (int i = 0; i < checkedListBoxShvabra.Items.Count; i++)
                {
                    if (checkedListBoxShvabra.GetItemChecked(i))
                    {
                        text = checkedListBoxShvabra.Items[i].ToString();
                        if (text.Length > 0)
                        {
                            char[] del = { ' ' };
                            words = text.Split(del);

                            family = words[0];
                            name   = words[1];

                            clPart = new CParticipant(connect, family, name);
                        }

                        rData.svabrist.Add(clPart.stPart.idpart);
                    }
                }
                /* отчет */
                for (int i = 0; i < checkedListBoxReport.Items.Count; i++)
                {
                    if (checkedListBoxReport.GetItemChecked(i))
                    {
                        text = checkedListBoxReport.Items[i].ToString();
                        if (text.Length > 0)
                        {
                            char[] del = { ' ' };
                            words = text.Split(del);

                            family = words[0];
                            name   = words[1];

                            clPart = new CParticipant(connect, family, name);
                        }

                        rData.report.Add(clPart.stPart.idpart);
                    }
                }
                /* статистика */
                for (int i = 0; i < checkedListBoxStats.Items.Count; i++)
                {
                    if (checkedListBoxStats.GetItemChecked(i))
                    {
                        text = checkedListBoxStats.Items[i].ToString();
                        if (text.Length > 0)
                        {
                            char[] del = { ' ' };
                            words = text.Split(del);

                            family = words[0];
                            name   = words[1];

                            clPart = new CParticipant(connect, family, name);
                        }

                        rData.statist.Add(clPart.stPart.idpart);
                    }
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }

            return(rData);
        }