Ejemplo n.º 1
0
        private void buttEdit_Click(object sender, EventArgs e)
        {
            AddStaffForm f = new AddStaffForm();

            for (int i = 0; i < dataGridView1.SelectedRows.Count; i++)
            {
                f.txtFn.Text           = dataGridView1.SelectedRows[i].Cells[1].Value.ToString();
                f.txtMn.Text           = dataGridView1.SelectedRows[i].Cells[2].Value.ToString();
                f.txtLn.Text           = dataGridView1.SelectedRows[i].Cells[3].Value.ToString();
                f.dateTimePicker1.Text = dataGridView1.SelectedRows[i].Cells[4].Value.ToString();
                f.comboxGend.Text      = dataGridView1.SelectedRows[i].Cells[5].Value.ToString();
                f.txtAge.Text          = dataGridView1.SelectedRows[i].Cells[6].Value.ToString();
                f.txtNationality.Text  = dataGridView1.SelectedRows[i].Cells[7].Value.ToString();
                f.comboCivil.Text      = dataGridView1.SelectedRows[i].Cells[8].Value.ToString();
                f.txtAddress.Text      = dataGridView1.SelectedRows[i].Cells[9].Value.ToString();
                f.txtEmail.Text        = dataGridView1.SelectedRows[i].Cells[10].Value.ToString();
                f.txtReligion.Text     = dataGridView1.SelectedRows[i].Cells[11].Value.ToString();
                f.comboxStatus.Text    = dataGridView1.SelectedRows[i].Cells[12].Value.ToString();
            }
            this.Hide();
            AddStaffForm addForm = new AddStaffForm();

            addForm.reference      = this;
            addForm.butAdd.Enabled = false;
            addForm.butAdd.Enabled = true;
            addForm.Show();
        }
Ejemplo n.º 2
0
        private void buttAdd_Click(object sender, EventArgs e)
        {
            this.Hide();
            AddStaffForm addForm = new AddStaffForm();

            addForm.reference      = this;
            addForm.butAdd.Enabled = true;
            addForm.butAdd.Enabled = false;
            addForm.Show();
        }