private void button1_Click(object sender, EventArgs e) { FRM_Add_User FRM = new FRM_Add_User(); FRM.ShowDialog(); this.dataGridView1.DataSource = Login.SearchUsers(""); }
private void إضافةمستخدمجديدToolStripMenuItem_Click(object sender, EventArgs e) { try { FRM_Add_User FRM = new FRM_Add_User(); FRM.ShowDialog(); } catch { MessageBox.Show("حدث خطأ ما !", "خطأ", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void button2_Click(object sender, EventArgs e) { try { FRM_Add_User FRM = new FRM_Add_User(); FRM.txtID.Text = dataGridView1.CurrentRow.Cells[0].Value.ToString(); FRM.txtID.Enabled = false; FRM.txtName.Text = dataGridView1.CurrentRow.Cells[1].Value.ToString(); FRM.txtPWD.Text = dataGridView1.CurrentRow.Cells[2].Value.ToString(); FRM.txtCPWD.Text = dataGridView1.CurrentRow.Cells[2].Value.ToString(); FRM.txtType.Text = dataGridView1.CurrentRow.Cells[3].Value.ToString(); FRM.button1.Text = "تحديث"; FRM.Text = "تعديل بيانات المستخدم"; FRM.ShowDialog(); this.dataGridView1.DataSource = Login.SearchUsers(""); } catch { MessageBox.Show("حدث خطأ ما", "خطأ", MessageBoxButtons.OK, MessageBoxIcon.Error); } }