private void btnAddRecord_Click(object sender, EventArgs e)
 {
     if (Permissions.authorizedToUseFunction(Permissions.ADD_SERVICE_RECORD))
     {
         AddServiceRecordDialog ad = new AddServiceRecordDialog();
         ad.ShowDialog();
     }
 }
        private void editRow(int selectedIndex)
        {
            if (Permissions.authorizedToUseFunction(Permissions.MODIFY_SERVICE_RECORD))
            {
                TempHolder.selectedIndex       = dgvServiceRecord.CurrentCell.RowIndex;
                TempHolder.selectedId          = dgvServiceRecord.Rows[selectedIndex].Cells[0].Value.ToString();
                TempHolder.selectedSchool      = dgvServiceRecord.Rows[selectedIndex].Cells[1].Value.ToString();
                TempHolder.selectedFrom        = dgvServiceRecord.Rows[selectedIndex].Cells[2].Value.ToString();
                TempHolder.selectedTo          = dgvServiceRecord.Rows[selectedIndex].Cells[3].Value.ToString();
                TempHolder.selectedDesignation = dgvServiceRecord.Rows[selectedIndex].Cells[4].Value.ToString();
                TempHolder.selectedStatus      = dgvServiceRecord.Rows[selectedIndex].Cells[5].Value.ToString();
                TempHolder.selectedSalary      = dgvServiceRecord.Rows[selectedIndex].Cells[6].Value.ToString();
                TempHolder.selectedStation     = dgvServiceRecord.Rows[selectedIndex].Cells[7].Value.ToString();
                TempHolder.selectedBranch      = dgvServiceRecord.Rows[selectedIndex].Cells[8].Value.ToString();
                TempHolder.selectedCause       = dgvServiceRecord.Rows[selectedIndex].Cells[9].Value.ToString();
                TempHolder.selectedLawop       = dgvServiceRecord.Rows[selectedIndex].Cells[10].Value.ToString();

                TempHolder.editMode = true;
                AddServiceRecordDialog asr = new AddServiceRecordDialog();
                asr.ShowDialog();
            }
        }