コード例 #1
0
ファイル: frmDepartment.cs プロジェクト: tongvinh/VSGit
        private void btnThem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            frmDepartmentUpdate frm = new frmDepartmentUpdate();

            frm.ShowDialog();
            gcData.DataSource = de.LoadData();
        }
コード例 #2
0
ファイル: frmDepartment.cs プロジェクト: tongvinh/VSGit
        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_DepartName    = "DepartName";
                string col_Description   = "Description";
                string col_HD            = "HD";
                object value_IDDepart    = gvData.GetRowCellValue(row_index, col_IDDepart);
                object value_DepartName  = gvData.GetRowCellValue(row_index, col_DepartName);
                object value_Description = gvData.GetRowCellValue(row_index, col_Description);
                object value_HD          = gvData.GetRowCellValue(row_index, col_HD);
                frmDepartmentUpdate frm  = new frmDepartmentUpdate(value_IDDepart.ToString(), value_DepartName.ToString(), value_Description.ToString(), Convert.ToBoolean(value_HD));
                frm.ShowDialog();
                gcData.DataSource = de.LoadData();
            }
        }