Exemple #1
0
        private void btnThem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            frmEmployeeUpdate frm = new frmEmployeeUpdate();

            frm.ShowDialog();
            gcData.DataSource = em.LoadData();
        }
Exemple #2
0
        private void btnSua_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            int row_index = gvData.FocusedRowHandle;

            if (row_index < 0)
            {
                XtraMessageBox.Show("Vui lòng chọn dòng dữ liệu", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                string            col_IDDepart       = "IDDepart";
                string            col_IDEmployee     = "IDEmployee";
                string            col_EmployeeName   = "EmployeeName";
                object            value_IDDepart     = gvData.GetRowCellValue(row_index, col_IDDepart);
                object            value_IDEmployee   = gvData.GetRowCellValue(row_index, col_IDEmployee);
                object            value_EmployeeName = gvData.GetRowCellValue(row_index, col_EmployeeName);
                frmEmployeeUpdate frm = new frmEmployeeUpdate(Convert.ToInt32(value_IDEmployee.ToString()), value_EmployeeName.ToString(), value_IDDepart.ToString());
                frm.ShowDialog();
                gcData.DataSource = em.LoadData();
            }
        }