Пример #1
0
        //update details of a selected employee
        private void Button1_Click(object sender, EventArgs e)
        {
            //get the employee ID from application
            c.EmpId = Convert.ToInt32(txtId.Text);

            //navigate to employee registration form to update details
            EmployeeRegistration empReg = new EmployeeRegistration();

            empReg.txtempId.Text      = dgvEmployeeList.CurrentRow.Cells[0].Value.ToString();
            empReg.txtempName.Text    = dgvEmployeeList.CurrentRow.Cells[1].Value.ToString();
            empReg.txtBdy.Text        = dgvEmployeeList.CurrentRow.Cells[2].Value.ToString();
            empReg.comboBox1.Text     = dgvEmployeeList.CurrentRow.Cells[3].Value.ToString();
            empReg.txtAdd.Text        = dgvEmployeeList.CurrentRow.Cells[4].Value.ToString();
            empReg.txtNum.Text        = dgvEmployeeList.CurrentRow.Cells[5].Value.ToString();
            empReg.txtEmail.Text      = dgvEmployeeList.CurrentRow.Cells[6].Value.ToString();
            empReg.comboBox2.Text     = dgvEmployeeList.CurrentRow.Cells[7].Value.ToString();
            empReg.txtJoinedDate.Text = dgvEmployeeList.CurrentRow.Cells[8].Value.ToString();
            empReg.txtSal.Text        = dgvEmployeeList.CurrentRow.Cells[9].Value.ToString();

            empReg.ShowDialog();

            DataTable dt = c.Select();

            dgvEmployeeList.DataSource = dt;
        }
        private void BtnRgister_Click(object sender, EventArgs e)
        {
            //Hide the user control
            //this.Hide();
            EmployeeRegistration empRtr = new EmployeeRegistration();

            empRtr.ShowDialog();
        }
        private void BtnRgister_Click(object sender, EventArgs e)
        {
            EmployeeRegistration empRtr = new EmployeeRegistration();

            empRtr.ShowDialog();
        }