private void button1_Click(object sender, EventArgs e) { FillForm form = new FillForm(); form.getDept(); form.getJob(); form.btnAdd.Visible = true; form.btnUpdate.Visible = false; this.Hide(); form.Show(); }
private void dataGridView3_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { FillForm form = new FillForm(); if (this.activeTab == "Department") { form.comboBox1.Text = "Department"; form.btnUpdate.Visible = true; form.btnAdd.Visible = false; form.txtCode.Text = dataGridView3.CurrentRow.Cells[1].Value.ToString(); form.txtDesc.Text = dataGridView3.CurrentRow.Cells[2].Value.ToString(); form.activeID = dataGridView3.CurrentRow.Cells[0].Value.ToString(); this.Hide(); form.Show(); } }
private void dataGridView2_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { dbClass db = new dbClass(); DataTable parent = db.dbSelect("SELECT code from tb_department WHERE id=" + dataGridView2.CurrentRow.Cells[2].Value.ToString()); FillForm form = new FillForm(); form.getDept(); if (this.activeTab == "Job") { form.comboBox1.Text = "Job"; form.btnUpdate.Visible = true; form.btnAdd.Visible = false; form.activeID = dataGridView2.CurrentRow.Cells[0].Value.ToString(); form.txtJob.Text = dataGridView2.CurrentRow.Cells[1].Value.ToString(); form.cmbParent.Text = parent.Rows[0][0].ToString(); form.txtSalary.Text = dataGridView2.CurrentRow.Cells[3].Value.ToString(); this.Hide(); form.Show(); } }
private void dataGridView1_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { DialogResult result = MessageBox.Show("Click YES to edit info press NO to print.", "Action", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (result.Equals(DialogResult.No)) { Print_Ind ind = new Print_Ind(); ind.id = this.del_id; ind.Show(); } else { dbClass db = new dbClass(); DataTable jb = db.dbSelect("SELECT description from tb_job WHERE id=" + dataGridView1.CurrentRow.Cells[9].Value.ToString()); DataTable dp = db.dbSelect("SELECT code from tb_department WHERE id=" + dataGridView1.CurrentRow.Cells[8].Value.ToString()); FillForm form = new FillForm(); form.getDept(); form.getJob(); if (this.activeTab == "Information") { form.comboBox1.Text = "Information"; form.txtLN.Text = dataGridView1.CurrentRow.Cells[1].Value.ToString(); form.txtFN.Text = dataGridView1.CurrentRow.Cells[2].Value.ToString(); form.txtMN.Text = dataGridView1.CurrentRow.Cells[3].Value.ToString(); form.txtAdd.Text = dataGridView1.CurrentRow.Cells[4].Value.ToString(); form.pickBday.Text = dataGridView1.CurrentRow.Cells[5].Value.ToString(); form.txtBPlace.Text = dataGridView1.CurrentRow.Cells[6].Value.ToString(); form.txtContact.Text = dataGridView1.CurrentRow.Cells[7].Value.ToString(); form.cmbDept.Text = dp.Rows[0][0].ToString(); form.cmbJob.Text = jb.Rows[0][0].ToString(); form.btnUpdate.Visible = true; form.btnAdd.Visible = false; form.activeID = dataGridView1.CurrentRow.Cells[0].Value.ToString(); this.Hide(); form.Show(); } } }