Exemplo n.º 1
0
        private void init_data(STViewVotePCA param)
        {
            g_f  = false;
            gpos = -1;

            CPlayer clPlayer;

            string text;

            try
            {
                dataGridViewVotePCA.Rows.Clear();

                full_list = clWork.GetList(IS.idseason, param);

                bool fl = false;

                if (full_list.Count > 0)
                {
                    g_f = true;

                    dataGridViewVotePCA.Rows.Add(full_list.Count);

                    for (int i = 0; i < full_list.Count; i++)
                    {
                        dataGridViewVotePCA.Rows[i].Cells[0].Value = full_list[i].name;
                        dataGridViewVotePCA.Rows[i].Cells[1].Value = full_list[i].email;
                        dataGridViewVotePCA.Rows[i].Cells[2].Value = full_list[i].ip;

                        CDivision clDiv = new CDivision(connect, IS.idseason, full_list[i].iddivision);
                        dataGridViewVotePCA.Rows[i].Cells[3].Value = clDiv.stDiv.name;

                        clPlayer = new CPlayer(connect, full_list[i].idplayer);
                        text     = string.Format("{0} {1} {2}", clPlayer.stPlayer.family, clPlayer.stPlayer.name,
                                                 clPlayer.stPlayer.payname);
                        dataGridViewVotePCA.Rows[i].Cells[4].Value = text;

                        dataGridViewVotePCA.Rows[i].Cells[5].Value = full_list[i].ed.ToString();

                        if (flawour.Equals(full_list[i]))
                        {
                            gpos = i;
                        }
                    }

                    dataGridViewVotePCA.AllowUserToAddRows = false;
                }
                else
                {
                    dataGridViewVotePCA.AllowUserToAddRows = false;
                }

                toolStripStatusLabel1.Text = string.Format("Количество записей: {0}", full_list.Count);
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Exemplo n.º 2
0
        private void buttonGo_Click(object sender, EventArgs e)
        {
            try
            {
                v_param = new STViewVotePCA();

                v_param.all        = true;
                v_param.cntemail   = null;
                v_param.cntip      = null;
                v_param.iddivision = null;
                v_param.order      = null;

                if (radioButtonAll.Checked == true)
                {
                    v_param.all = true;
                }

                if (radioButtonUs.Checked == true)
                {
                    v_param.all = false;

                    if (checkBoxDivision.CheckState == CheckState.Checked)
                    {
                        if (comboBoxDivision.Text.Length > 0)
                        {
                            CDivision clDiv = new CDivision(connect, IS.idseason, comboBoxDivision.Text.Trim());
                            v_param.iddivision = clDiv.stDiv.id;
                        }
                    }

                    if (checkBoxEmail.CheckState == CheckState.Checked)
                    {
                        if (textBoxEmail.Text.Length > 0)
                        {
                            v_param.cntemail = int.Parse(textBoxEmail.Text.Trim());
                        }
                    }

                    if (checkBoxIP.CheckState == CheckState.Checked)
                    {
                        if (textBoxIP.Text.Length > 0)
                        {
                            v_param.cntip = int.Parse(textBoxIP.Text.Trim());
                        }
                    }
                }

                if (radioButtonSortName.Checked == true)
                {
                    v_param.order = "Name";
                }
                if (radioButtonSortEmail.Checked == true)
                {
                    v_param.order = "Email";
                }
                if (radioButtonSortIP.Checked == true)
                {
                    v_param.order = "IP";
                }
                if (radioButtonSortPlayer.Checked == true)
                {
                    v_param.order = "IdPlayer";
                }

                init_data(v_param);
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }