示例#1
0
        /// <summary>
        /// Set an item of meta data with the given types and cvalues
        /// </summary>
        /// <param name="blockModelID"></param>
        /// <param name="metaDataType"></param>
        /// <param name="tableType"></param>
        /// <param name="cont"></param>
        private static void SetMetaDataItem(Guid blockModelID, string metaDataType, string tableType, string cont)
        {
            try
            {
                var d = new XODB.Models.BMMetaDataDataContext(global::System.Configuration.ConfigurationManager.ConnectionStrings["XODBConnectionString"].ConnectionString);

                XODB.Models.X_MetaData dt = new Models.X_MetaData();
                dt.MetaDataID = Guid.NewGuid();
                dt.MetaDataType = metaDataType;
                dt.ContentToIndex = cont;

                XODB.Models.X_MetaDataRelation rel = new XODB.Models.X_MetaDataRelation();
                rel.MetaDataRelationID = Guid.NewGuid();
                rel.MetaDataID = dt.MetaDataID;
                rel.TableType = tableType;
                rel.ReferenceID = blockModelID;

                d.X_MetaDatas.InsertOnSubmit(dt);
                d.SubmitChanges();
                d.X_MetaDataRelations.InsertOnSubmit(rel);
                d.SubmitChanges();
            }
            catch { }

        }
示例#2
0
        internal static void UpdateStage(Guid blockModelGUID, Guid stageMetaID, string stage)
        {
            if (stage != null && stage.Length > 0)
            {
                try
                {
                    var d = new XODB.Models.BMMetaDataDataContext(global::System.Configuration.ConfigurationManager.ConnectionStrings["XODBConnectionString"].ConnectionString);
                    XODB.Models.X_Parameter dt = new Models.X_Parameter();
                    dt.ParameterID = stageMetaID;
                    dt.ParameterName = "Stage";
                    dt.ParameterType = "Metadata";

                    XODB.Models.X_BlockModelMetadata rel = new XODB.Models.X_BlockModelMetadata();
                    rel.BlockModelID = blockModelGUID;
                    rel.BlockModelMetadataID = Guid.NewGuid();
                    rel.ParameterID = stageMetaID;
                    rel.IsColumnData = false;
                    rel.BlockModelMetadataText = stage;

                    d.X_Parameters.InsertOnSubmit(dt);
                    d.SubmitChanges();
                    d.X_BlockModelMetadatas.InsertOnSubmit(rel);
                    d.SubmitChanges();
                }
                catch { 
                }
            }

        }