private void dgvPaydirt_CellClick(object sender, DataGridViewCellEventArgs e) { DataGridView dgv = (DataGridView)sender; flpPaydirt.Controls.Clear(); foreach (DataGridViewRow vrow in dgv.SelectedRows) { DataRow row = ((DataRowView)vrow.DataBoundItem).Row; ucPaydirt uc = new ucPaydirt(); uc.LoadRow(row); flpPaydirt.Controls.Add(uc); } }
private void show_import(DataRow row) { string emp_id = get_str(row, "strEmployee_number"); string last = get_str(row, "strEmployee_Lastname"); string first = get_str(row, "strEmployee_Firstname"); if (_uc == null) { _uc = new ucPaydirt(); _uc.Location = new Point(5, 5); pnlPaydirt.Controls.Add(_uc); } _uc.LoadRow(row); tbxPayroll.Text = emp_id; //flpPaydirt.Controls.Add(uc); bool found = false; flpTimebook.Controls.Clear(); foreach (DataRow match in _tb_dt.Rows) { string match_last = get_str(match, "Last Name"); if (match_last[0] != last[0]) { continue; } //pnlPaydirt.Controls.Add(uc); ucMatch ucm = new ucMatch(); ucm.LoadRow(match); bool yes = ucm.Match(last, first, emp_id); if (yes) { found = true; cmdUpdate.Show(); lbMatch.Text = "MATCH"; pnlMatch.BackColor = Color.PaleGreen; tbxTimebook.Text = (string)match["EmpId"]; flpTimebook.Tag = ucm.RcdID; if (ucm.IsKey(emp_id)) { cmdNew.Hide(); } } flpTimebook.Controls.Add(ucm); } if (!found) { cmdNew.Show(); cmdUpdate.Hide(); lbMatch.Text = "NO MATCH !"; pnlMatch.BackColor = Color.White; tbxTimebook.Text = string.Empty; flpTimebook.Tag = null; } }