Exemplo n.º 1
0
        protected void OnButtonViewEntityClicked(object sender, EventArgs e)
        {
            IEntityConfig entityConfig = DomainConfiguration.GetEntityConfig(subjectType);

            if (entityConfig.SimpleDialog)
            {
                EntityEditSimpleDialog.RunSimpleDialog(this.Toplevel as Window, SubjectType, Subject);
                return;
            }

            ITdiTab mytab = DialogHelper.FindParentTab(this);

            if (mytab == null)
            {
                logger.Warn("Родительская вкладка не найдена.");
                return;
            }

            ITdiTab dlg = entityConfig.CreateDialog(Subject);

            mytab.TabParent.AddTab(dlg, mytab);
        }
Exemplo n.º 2
0
        public override void Execute()
        {
            var description = DomainConfiguration.GetEntityConfig(RepresentationModel.EntityType);

            if (description == null)
            {
                throw new NotImplementedException($"Для класса {RepresentationModel.EntityType} отсутствует {typeof(IEntityConfig)}");
            }
            if (description.SimpleDialog)
            {
                throw new NotImplementedException();
                //OrmSimpleDialog.RunSimpleDialog (this.Toplevel as Window, objectType, datatreeviewRef.GetSelectedObjects () [0]);
            }
            else
            {
                int selectedId = DomainHelper.GetId(dialog.SelectedNodes.First());
                dialog.TabParent.OpenTab(DialogHelper.GenerateDialogHashName(RepresentationModel.EntityType, selectedId),
                                         () => description.CreateDialog(selectedId),
                                         dialog
                                         );
            }
        }
Exemplo n.º 3
0
        public override void Execute()
        {
            dialog.TreeView.Selection.UnselectAll();
            var classDiscript = DomainConfiguration.GetEntityConfig(EntityClass);

            if (classDiscript.SimpleDialog)
            {
                EntityEditSimpleDialog.RunSimpleDialog((dialog as Widget).Toplevel as Window, EntityClass, null);
            }
            else if (RepresentationModel is IRepresentationModelWithParent)
            {
                var dlg = DomainConfiguration.GetEntityConfig(RepresentationModel.EntityType).CreateDialog((RepresentationModel as IRepresentationModelWithParent).GetParent);
                dialog.TabParent.AddTab(dlg, dialog);
                dlg.EntitySaved += dlg_EntitySaved;
            }
            else
            {
                var dlg = DomainConfiguration.GetEntityConfig(RepresentationModel.EntityType).CreateDialog();
                dlg.EntitySaved += dlg_EntitySaved;
                dialog.TabParent.AddTab(dlg, dialog, true);
            }
        }