Exemple #1
0
        private void GetEmployeeInfo()
        {
            if (dgvEmployeeInfo.SelectedRows.Count > 0 && dgvEmployeeInfo.CurrentCell != null)
            {
                int            rowId     = dgvEmployeeInfo.CurrentCell.RowIndex;
                frmAddEmployee newrecObj = new frmAddEmployee(dgvEmployeeInfo.Rows[rowId].Cells["Id"].Value.ToString(),
                                                              dgvEmployeeInfo.Rows[rowId].Cells["First Name"].Value.ToString(),
                                                              dgvEmployeeInfo.Rows[rowId].Cells["Middle Name"].Value.ToString(),
                                                              dgvEmployeeInfo.Rows[rowId].Cells["Last Name"].Value.ToString(),
                                                              dgvEmployeeInfo.Rows[rowId].Cells["Gender"].Value.ToString(),
                                                              dgvEmployeeInfo.Rows[rowId].Cells["Date Of Birth"].Value.ToString(),
                                                              dgvEmployeeInfo.Rows[rowId].Cells["address"].Value.ToString(),
                                                              dgvEmployeeInfo.Rows[rowId].Cells["Contact Number"].Value.ToString(),
                                                              dgvEmployeeInfo.Rows[rowId].Cells["Alternate Number"].Value.ToString(),
                                                              dgvEmployeeInfo.Rows[rowId].Cells["Email Id"].Value.ToString(),
                                                              dgvEmployeeInfo.Rows[rowId].Cells["Date Of Joining"].Value.ToString(),
                                                              dgvEmployeeInfo.Rows[rowId].Cells["AccountNo"].Value.ToString(),
                                                              dgvEmployeeInfo.Rows[rowId].Cells["IFSCcode"].Value.ToString(),
                                                              dgvEmployeeInfo.Rows[rowId].Cells["Comment"].Value.ToString(),
                                                              dgvEmployeeInfo.Rows[rowId].Cells["Salary"].Value.ToString());

                newrecObj.ShowDialog();
                Showrecord();
            }
            else
            {
                MessageBox.Show("Please select row for update", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #2
0
        private void newToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            frmAddEmployee nw = new frmAddEmployee();

            nw.ShowDialog();
            Showrecord();
        }