Beispiel #1
0
        public UniqueForm(Form parent, DBRegistrationClass dbReg, List <TableClass> tables, NotNullsClass notnullObject, ContextMenuStrip cmGroup, ContextMenuStrip cm)
        {
            InitializeComponent();
            this.MdiParent = parent;

            _dbReg  = dbReg;
            _tables = tables;
            Cm      = cm;
            CmGroup = cmGroup;

            if (notnullObject == null)
            {
                NotNullObject                = new NotNullsClass();
                NotNullObject.Name           = "NEW_CNSTR";
                NotNullObject.ConstraintType = eConstraintType.NOTNULL;
            }
            else
            {
                NotNullObject = notnullObject;
            }
            OrgTable = tables.Find(X => X.Name == notnullObject.TableName);
            NotNullObject.TableName = OrgTable.Name;

            _localNotify.Register4Error(Notify_OnRaiseErrorHandler);
            _localNotify.Register4Info(Notify_OnRaiseInfoHandler);
        }
Beispiel #2
0
        public NotNullForm(Form parent, DBRegistrationClass dbReg, TreeNode tn, ContextMenuStrip cmGroup, ContextMenuStrip cm)
        {
            InitializeComponent();
            this.MdiParent = parent;

            _dbReg  = dbReg;
            Cm      = cm;
            CmGroup = cmGroup;
            Tn      = tn;

            TreeNode t            = StaticTreeClass.FindPrevDBNode(Tn);
            TreeNode orgTableNode = StaticTreeClass.FindPrevTableNode(Tn);
            TreeNode TableNode    = StaticTreeClass.FindFirstNodeInAllNodes(t, StaticVariablesClass.CommonTablesKeyGroupStr);

            //Bei insert
            if (Tn.Tag == null)
            {
                NotNullObject                = new NotNullsClass();
                NotNullObject.Name           = "NEW_CNSTR";
                NotNullObject.ConstraintType = eConstraintType.NOTNULL;
            }
            else
            {
                NotNullObject = Tn.Tag as NotNullsClass;
            }

            if (orgTableNode != null)
            {
                OrgTable = orgTableNode.Tag as TableClass;
                NotNullObject.TableName = OrgTable.Name;
            }

            Tables = StaticTreeClass.GetTableObjectsFromNode(TableNode);

            _localNotify.Notify.OnRaiseErrorHandler += Notify_OnRaiseErrorHandler;
            _localNotify.Notify.OnRaiseInfoHandler  += Notify_OnRaiseInfoHandler;
        }