Exemple #1
0
        public override void update()
        {

            CswNbtMetaDataObjectClass MailReportOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( NbtObjectClass.MailReportClass );
            foreach( CswNbtMetaDataNodeType MailReportNT in MailReportOC.getNodeTypes() )
            {
                // remove 'Nodes to Report' from all layouts
                CswNbtMetaDataNodeTypeProp NodesToReportNTP = MailReportNT.getNodeTypePropByObjectClassProp( CswNbtObjClassMailReport.PropertyName.NodesToReport );
                _CswNbtSchemaModTrnsctn.MetaData.NodeTypeLayout.removePropFromAllLayouts( NodesToReportNTP );

                // remove Run Status from Add layout
                CswNbtMetaDataNodeTypeProp RunStatusNTP = MailReportNT.getNodeTypePropByObjectClassProp( CswNbtObjClassMailReport.PropertyName.RunStatus );
                RunStatusNTP.removeFromLayout( CswNbtMetaDataNodeTypeLayoutMgr.LayoutType.Add );

                // set Target Type and Event to be conditional on Type = View
                CswNbtMetaDataNodeTypeProp TypeNTP = MailReportNT.getNodeTypePropByObjectClassProp( CswNbtObjClassMailReport.PropertyName.Type );
                CswNbtMetaDataNodeTypeProp TargetTypeNTP = MailReportNT.getNodeTypePropByObjectClassProp( CswNbtObjClassMailReport.PropertyName.TargetType );
                CswNbtMetaDataNodeTypeProp EventNTP = MailReportNT.getNodeTypePropByObjectClassProp( CswNbtObjClassMailReport.PropertyName.Event );
                TargetTypeNTP.setFilter( TypeNTP, TypeNTP.getFieldTypeRule().SubFields.Default, CswNbtPropFilterSql.PropertyFilterMode.Equals, CswNbtObjClassMailReport.TypeOptionView );
                EventNTP.setFilter( TypeNTP, TypeNTP.getFieldTypeRule().SubFields.Default, CswNbtPropFilterSql.PropertyFilterMode.Equals, CswNbtObjClassMailReport.TypeOptionView );

                // add help text to Report View
                CswNbtMetaDataNodeTypeProp ReportViewNTP = MailReportNT.getNodeTypePropByObjectClassProp( CswNbtObjClassMailReport.PropertyName.ReportView );
                ReportViewNTP.HelpText = "For 'Exists' events, a report is generated if the view returns any results that match the Target Type.  For 'Edit' events, a report is only generated if one of the properties in the view was modified.";

                // set target type and event for existing mail reports
                foreach( CswNbtObjClassMailReport MailReportNode in MailReportNT.getNodes( false, true ) )
                {
                    if( CswNbtObjClassMailReport.TypeOptionView == MailReportNode.Type.Value &&
                        0 == MailReportNode.TargetType.SelectedNodeTypeIds.Count )
                    {
                        CswNbtView View = _CswNbtSchemaModTrnsctn.restoreView( MailReportNode.ReportView.ViewId );
                        if( View.Root.ChildRelationships.Count > 0 )
                        {
                            CswNbtViewRelationship RootRel = View.Root.ChildRelationships[0];
                            if( RootRel.SecondType == NbtViewRelatedIdType.NodeTypeId )
                            {
                                MailReportNode.TargetType.SelectedNodeTypeIds.Add( RootRel.SecondId.ToString() );
                            }
                            else
                            {
                                CswNbtMetaDataObjectClass RootOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( RootRel.SecondId.ToString() );
                                if( null != RootOC.FirstNodeType )
                                {
                                    MailReportNode.TargetType.SelectedNodeTypeIds.Add( RootOC.FirstNodeType.NodeTypeId.ToString() );
                                }
                            }
                        }
                    }

                    if( MailReportNode.Event.Empty )
                    {
                        MailReportNode.Event.Value = CswNbtObjClassMailReport.EventOption.Exists.ToString();
                    }
                    MailReportNode.postChanges( false );

                } // foreach( CswNbtObjClassMailReport MailReportNode in MailReportNT.getNodes( false, true ) )
            } // foreach( CswNbtMetaDataNodeType MailReportNT in MailReportOC.getNodeTypes() )

        }//Update()
Exemple #2
0
        public override void update()
        {
            CswNbtMetaDataObjectClass MailReportOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswNbtMetaDataObjectClass.NbtObjectClass.MailReportClass );
            CswNbtMetaDataObjectClass ReportOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswNbtMetaDataObjectClass.NbtObjectClass.ReportClass );

            // Fix the relationship view not to be "IMCS Reports" by reseting it to the default view of the target, "All ReportClass"
            foreach( CswNbtMetaDataNodeType MailReportNT in MailReportOC.getLatestVersionNodeTypes() )
            {
                CswNbtMetaDataNodeTypeProp MRReportNTP = MailReportNT.getNodeTypePropByObjectClassProp( CswNbtObjClassMailReport.ReportPropertyName );
                _setDefaultView( MRReportNTP, MRReportNTP.FKType, MRReportNTP.FKValue, false );
            }

            // Fix the two demo mail reports
            foreach( CswNbtObjClassMailReport MRNode in MailReportOC.getNodes( false, true ) )
            {
                if( null != MRNode && MRNode.IsDemo )
                {
                    if( MRNode.Node.NodeName == "Equipment Mail Report" )
                    {
                        // Equipment Mail Report - If no report or view is assigned, remove it
                        if( ( null == MRNode.Report.RelatedNodeId || Int32.MinValue == MRNode.Report.RelatedNodeId.PrimaryKey ) &&
                            ( MRNode.ReportView.SelectedViewIds.IsEmpty || "196" == MRNode.ReportView.SelectedViewIds.ToString() ) )
                        {
                            MRNode.Node.delete();
                        }
                    }
                    else
                    {
                        // Mail Report 25751 - assign "Lab 1 Deficiencies" to mail report
                        CswNbtObjClassReport Lab1Report = null;
                        foreach( CswNbtObjClassReport ReportNode in ReportOC.getNodes( false, true ) )
                        {
                            if( "Lab 1 Deficiencies" == ReportNode.ReportName.Text )
                            {
                                Lab1Report = ReportNode;
                            }
                        }
                        if( null != Lab1Report )
                        {
                            CswNbtMetaDataNodeTypeProp NameNTP = MRNode.NodeType.getNodeTypeProp("Name");
                            if(null != NameNTP)
                            {
                                MRNode.Node.Properties[NameNTP].AsText.Text = "Lab 1 Deficiencies Mail Report";
                            }
                            MRNode.Report.RelatedNodeId = Lab1Report.NodeId;
                            MRNode.postChanges( false );
                        }
                        else
                        {
                            MRNode.Node.delete();
                        }
                    }
                }
            }
        }//Update()
 public override void update()
 {
     CswNbtMetaDataObjectClass MailReportOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.MailReportClass );
     foreach( CswNbtMetaDataNodeType MailReportNT in MailReportOC.getNodeTypes() )
     {
         CswNbtMetaDataNodeTypeProp DueDateIntervalNTP = MailReportNT.getNodeTypePropByObjectClassProp( CswNbtObjClassMailReport.PropertyName.DueDateInterval );
         if( null != DueDateIntervalNTP )
         {
             DueDateIntervalNTP.Attribute1 = CswConvert.ToDbVal( true ).ToString();
         }
     }
 }
 public override void update()
 {
     CswNbtMetaDataObjectClass MailReportOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( NbtObjectClass.MailReportClass );
     //CswNbtMetaDataObjectClassProp MailReportViewOCP = MailReportOC.getObjectClassProp( CswNbtObjClassMailReport.PropertyName.ReportView );
     foreach( CswNbtMetaDataNodeType MailReportNT in MailReportOC.getNodeTypes() )
     {
         CswNbtMetaDataNodeTypeProp MailReportViewNTP = MailReportNT.getNodeTypePropByObjectClassProp( CswNbtObjClassMailReport.PropertyName.ReportView );
         CswNbtView DefaultView = _CswNbtSchemaModTrnsctn.restoreView( MailReportViewNTP.DefaultValue.AsViewReference.ViewId );
         DefaultView.ViewMode = NbtViewRenderingMode.Grid;
         DefaultView.save();
     }
 } //update()
        public override void update()
        {
            CswNbtMetaDataObjectClass MailReportOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.MailReportClass );
            foreach( CswNbtMetaDataNodeType MailReportNT in MailReportOC.getNodeTypes())
            {
                CswNbtMetaDataNodeTypeProp NameNTP = MailReportNT.getNodeTypePropByObjectClassProp( CswNbtObjClassMailReport.PropertyName.Name );

                // Add 'Name' property to Add layout
                if( null == NameNTP.getAddLayout() )
                {
                    NameNTP.updateLayout( CswEnumNbtLayoutType.Add, false );
                }

            } // foreach( CswNbtMetaDataNodeType MailReportNT in _CswNbtSchemaModTrnsctn.MetaData.getNodeTypes( CswEnumNbtObjectClass.MailReportClass ) )
        } // update()
Exemple #6
0
        public override void update()
        {
            // Set MailReport.OutputFormat to be conditional on Type = Report

            CswNbtMetaDataObjectClass MailReportOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( NbtObjectClass.MailReportClass );
            CswNbtMetaDataObjectClassProp TypeOCP = MailReportOC.getObjectClassProp( CswNbtObjClassMailReport.PropertyName.Type );
            CswNbtMetaDataObjectClassProp OutputFormatOCP = MailReportOC.getObjectClassProp( CswNbtObjClassMailReport.PropertyName.OutputFormat );

            _CswNbtSchemaModTrnsctn.MetaData.UpdateObjectClassProp( OutputFormatOCP,
                                                                    CswNbtMetaDataObjectClassProp.ObjectClassPropAttributes.filterpropid,
                                                                    TypeOCP.PropId.ToString() );

            _CswNbtSchemaModTrnsctn.MetaData.UpdateObjectClassProp( OutputFormatOCP,
                                                                    CswNbtMetaDataObjectClassProp.ObjectClassPropAttributes.filter,
                                                                    CswNbtMetaDataObjectClassProp.makeFilter( TypeOCP.getFieldTypeRule().SubFields.Default,
                                                                                                              CswNbtPropFilterSql.PropertyFilterMode.Equals,
                                                                                                              CswNbtObjClassMailReport.TypeOptionReport ) );

            // because of case 27922, need to apply this to nodetypes manually
            foreach( CswNbtMetaDataNodeType MailReportNT in MailReportOC.getNodeTypes() )
            {
                CswNbtMetaDataNodeTypeProp TypeNTP = MailReportNT.getNodeTypePropByObjectClassProp( CswNbtObjClassMailReport.PropertyName.Type );
                CswNbtMetaDataNodeTypeProp OutputFormatNTP = MailReportNT.getNodeTypePropByObjectClassProp( CswNbtObjClassMailReport.PropertyName.OutputFormat );

                OutputFormatNTP.setFilter( TypeNTP,
                                           TypeNTP.getFieldTypeRule().SubFields.Default,
                                           CswNbtPropFilterSql.PropertyFilterMode.Equals,
                                           CswNbtObjClassMailReport.TypeOptionReport );

                // revert readonly
                foreach( CswNbtObjClassMailReport MailReportNode in MailReportNT.getNodes( false, true ) )
                {
                    MailReportNode.OutputFormat.setReadOnly( value: false, SaveToDb: true );
                    MailReportNode.postChanges( false );
                }

            } // foreach( CswNbtMetaDataNodeType MailReportNT in MailReportOC.getNodeTypes() )

        }//Update()