Exemplo n.º 1
0
 protected override void OnOpenRecord(long Id)
 {
     try
     {
         base.OnOpenRecord(Id);
         SiteForm childForm = new SiteForm(Id);
         ShowForm(childForm);
     }
     catch (Exception ex)
     {
         if (CDS.Shared.Exception.UserInterfaceExceptionHandler.HandleException(ref ex))
         {
             throw ex;
         }
     }
 }
Exemplo n.º 2
0
        /*protected override void OnShown(EventArgs e)
         * {
         *
         *  base.OnShown(e);
         *
         *  OnOpenRecord(DataContext.EntitySystemContext.SYS_Site.FirstOrDefault().EntityId);
         *  this.Close();
         * }*/

        private void btnCopySite_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                DB.SYS_Site   copySite   = BL.ApplicationDataContext.DeepClone <DB.SYS_Site>(BL.SYS.SYS_Site.LoadByEntityId(SelectedRowId, DataContext), BL.SYS.SYS_Site.New);
                DB.SYS_Entity copyEntity = BL.ApplicationDataContext.DeepClone <DB.SYS_Entity>((BL.SYS.SYS_Site.LoadByEntityId(SelectedRowId, DataContext, new List <String>()
                {
                    "SYS_Entity"
                })).SYS_Entity, BL.SYS.SYS_Entity.NewSite);
                copySite.SYS_Entity = copyEntity;
                SiteForm childForm = new SiteForm();
                childForm.OpenRecord(copySite);
                ShowForm(childForm);
            }
            catch (Exception ex)
            {
                if (CDS.Shared.Exception.UserInterfaceExceptionHandler.HandleException(ref ex))
                {
                    throw ex;
                }
            }
        }