private void btnDeleteAsset_Click(object sender, EventArgs e) { try { XPDataTableObject row = (XPDataTableObject)gridViewItem.GetRow(gridViewItem.FocusedRowHandle); if (row == null) { return; } if (MsgDlg.Show("هل انت متأكد ؟", MsgDlg.MessageType.Question) == DialogResult.Yes) { gridViewItem.DeleteSelectedRows(); sessionItem.DropIdentityMap(); XPCSItem.Reload(); gridViewItem.RefreshData(); } } catch (Exception ex) { MsgDlg.Show(ex.Message, MsgDlg.MessageType.Error, ex); } }
private void btnEditAsset_Click(object sender, EventArgs e) { try { XPDataTableObject row = (XPDataTableObject)gridViewItem.GetRow(gridViewItem.FocusedRowHandle); if (row == null) { return; } TblAsnafEditorDlg frm = new TblAsnafEditorDlg(Convert.ToInt32(row.GetMemberValue("SanfID")), false); if (frm.ShowDialog() == DialogResult.OK) { sessionItem.DropIdentityMap(); XPCSItem.Reload(); gridViewItem.RefreshData(); } } catch (Exception ex) { MsgDlg.Show(ex.Message, MsgDlg.MessageType.Error, ex); } }
private void btnAddAsset_Click(object sender, EventArgs e) { try { object id = null; if (treeListMain.FocusedNode == null) { return; } id = treeListMain.FocusedNode.GetValue("SanfCategoryID"); TblAsnafEditorDlg frm = new TblAsnafEditorDlg((int)id, true); if (frm.ShowDialog() == DialogResult.OK) { sessionItem.DropIdentityMap(); XPCSItem.Reload(); gridViewItem.RefreshData(); } } catch (Exception ex) { MsgDlg.Show(ex.Message, MsgDlg.MessageType.Error, ex); } }
private void treeListMain_FocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e) { object id = null; if (treeListMain.FocusedNode == null) { id = -1; } else { id = e.Node.GetValue("SanfCategoryID"); } gridViewItem.ShowLoadingPanel(); XPCSItem.FixedFilterString = "[SanfCategoryID] = " + id; sessionItem.DropIdentityMap(); XPCSItem.Reload(); gridViewItem.RefreshData(); gridViewItem.HideLoadingPanel(); //LoadParamGrid(); }