private void btnEditAsset_Click(object sender, EventArgs e)
 {
     try
     {
         XPDataTableObject row = (XPDataTableObject)gridViewAsset.GetRow(gridViewAsset.FocusedRowHandle);
         if (row == null)
         {
             return;
         }
         AssetEditorDlg frm = new AssetEditorDlg(Convert.ToInt32(row.GetMemberValue("AssetsID")), false);
         if (frm.ShowDialog() == DialogResult.OK)
         {
             sessionAsset.DropIdentityMap();
             XPCSAsset.Reload();
             gridViewAsset.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("AssetsCategoryID");
         AssetEditorDlg frm = new AssetEditorDlg((int)id, true);
         if (frm.ShowDialog() == DialogResult.OK)
         {
             sessionAsset.DropIdentityMap();
             XPCSAsset.Reload();
             gridViewAsset.RefreshData();
         }
     }
     catch (Exception ex)
     {
         MsgDlg.Show(ex.Message, MsgDlg.MessageType.Error, ex);
     }
 }