Exemplo n.º 1
0
        void SearchbyName()
        {
            SearchResultui frm = new SearchResultui();

            for (int i = 0; i < dgEmployees.Rows.Count; i++)
            {
                DataGridViewRow r = dgEmployees.Rows[i];
                if (r.Cells[0].Value.ToString().Equals(txtName.Text))
                {
                    frm.AddEmployeeInfo(r.Cells[0].Value.ToString(),
                                        r.Cells[1].Value.ToString(), r.Cells[2].Value.ToString(),
                                        r.Cells[3].Value.ToString(), r.Cells[4].Value.ToString(),
                                        r.Cells[5].Value.ToString(), r.Cells[6].Value.ToString(),
                                        r.Cells[7].Value.ToString());
                }
            }
            frm.ShowDialog();
        }
Exemplo n.º 2
0
        private void BtnFilter_Click(object sender, EventArgs e)
        {
            SearchResultui frm = new SearchResultui();

            for (int i = 0; i < dgEmployees.Rows.Count; i++)
            {
                DataGridViewRow r = dgEmployees.Rows[i];
                if (r.Cells[3].Value.ToString().Equals(cbNationalFilter.Text))
                //if (r.Cells[3].Value.ToString().Equals(cbNationalFilter.Text))
                {
                    frm.AddEmployeeInfo(r.Cells[0].Value.ToString(),
                                        r.Cells[1].Value.ToString(), r.Cells[2].Value.ToString(),
                                        r.Cells[3].Value.ToString(), r.Cells[4].Value.ToString(),
                                        r.Cells[5].Value.ToString(), r.Cells[6].Value.ToString(),
                                        r.Cells[7].Value.ToString());
                }
            }
            frm.ShowDialog();
        }