private void init_data(STViewVoteASG param) { g_f = false; gpos = -1; // CPlayer clPlayer; string text; try { dataGridViewVoteASG.Rows.Clear(); full_list = clWork.GetList(IS.idseason, param); bool fl = false; if (full_list.Count > 0) { g_f = true; dataGridViewVoteASG.Rows.Add(full_list.Count); for (int i = 0; i < full_list.Count; i++) { dataGridViewVoteASG.Rows[i].Cells[0].Value = full_list[i].name; dataGridViewVoteASG.Rows[i].Cells[1].Value = full_list[i].email; dataGridViewVoteASG.Rows[i].Cells[2].Value = full_list[i].ip; dataGridViewVoteASG.Rows[i].Cells[3].Value = full_list[i].ed.ToString(); dataGridViewVoteASG.Rows[i].Cells[4].Value = full_list[i].data; if (flawour.Equals(full_list[i])) { gpos = i; } } dataGridViewVoteASG.AllowUserToAddRows = false; } else { dataGridViewVoteASG.AllowUserToAddRows = false; } toolStripStatusLabel1.Text = string.Format("Количество записей: {0}", full_list.Count); } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } }
private void buttonGo_Click(object sender, EventArgs e) { try { v_param = new STViewVoteASG(); v_param.all = true; v_param.cntemail = null; v_param.cntip = null; v_param.order = null; if (radioButtonAll.Checked == true) { v_param.all = true; } if (radioButtonUs.Checked == true) { v_param.all = false; 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 (checkBoxAll.CheckState == CheckState.Checked) { v_param.full = true; } } 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); } }