/// <summary> /// Opens Entry form for the entry that double clicked on /// </summary> /// <remarks>Created: Werner Scheffer 13/08/2013</remarks> private void grdEntries_DoubleClick(object sender, EventArgs e) { try { if ((grdEntries.MainView as GridView).FocusedRowHandle < 0)//|| !(grdEntries.MainView as GridView).CalcHitInfo(MousePosition).InRow) { return; } object FocusedRow = (grdEntries.MainView as GridView).GetFocusedRow(); if (FocusedRow is DevExpress.Data.NotLoadedObject) { return; } //TODO: Fix this Entry.EntryForm child = new Entry.EntryForm(Convert.ToInt64(((DevExpress.Data.Async.Helpers.ReadonlyThreadSafeProxyForObjectFromAnotherThread)FocusedRow).OriginalRow.GetType().GetProperty("Id").GetValue(((DevExpress.Data.Async.Helpers.ReadonlyThreadSafeProxyForObjectFromAnotherThread)FocusedRow).OriginalRow, null))); child.ReadOnly = true; ShowForm(child); } catch (Exception ex) { if (CDS.Shared.Exception.UserInterfaceExceptionHandler.HandleException(ref ex)) { throw ex; } } }
/// <summary> /// Creates an Entry to reverce the effect of the current open entry. /// </summary> /// <remarks>Created: Werner Scheffer 09/01/2012</remarks> private void btnReverseEntry_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { EntryForm childForm = new EntryForm(); childForm.AllowNavigate = false; childForm.glxHeader = BL.GLX.GLX_Header.CreateReversalEntry(glxHeader, DataContext); childForm.ItemState = EntityState.Generated; ShowForm(childForm); } catch (Exception ex) { if (CDS.Shared.Exception.UserInterfaceExceptionHandler.HandleException(ref ex)) { throw ex; } } }
/// <summary> /// Open the Entry form for the record indicated in the parameter. /// </summary> /// <param name="Id">The id (primary key) of the record to open.</param> /// <remarks>Created: Theo Crous 01/12/2011</remarks> protected override void OnOpenRecord(long Id) { try { base.OnOpenRecord(Id); if (checkOutOfSiteAccess(Id)) { EntryForm childForm = new EntryForm(Id); childForm.ReadOnly = true; ShowForm(childForm); } } catch (Exception ex) { if (CDS.Shared.Exception.UserInterfaceExceptionHandler.HandleException(ref ex)) { throw ex; } } }