Exemple #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
            {
                using (var entityObj = new NKDC(BaseImportTools.XSTRING, null))
                {
                    MetaData dt = new MetaData();
                    dt.MetaDataID     = Guid.NewGuid();
                    dt.MetaDataType   = metaDataType;
                    dt.ContentToIndex = cont;

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

                    entityObj.MetaDatas.AddObject(dt);
                    entityObj.SaveChanges();
                    entityObj.MetaDataRelations.AddObject(rel);
                    entityObj.SaveChanges();
                }
            }
            catch (Exception ex) {
                string msg = "Error setting domains list " + ex.ToString();
            }
        }
        /// <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>
        public void SetMetaDataItem(Guid blockModelID, string metaDataType, string tableType, string cont)
        {
            try
            {
                using (new TransactionScope(TransactionScopeOption.Suppress))
                {
                    var d = new NKDC(_users.ApplicationConnectionString, null);

                    MetaData dt = new MetaData();
                    dt.MetaDataID     = Guid.NewGuid();
                    dt.MetaDataType   = metaDataType;
                    dt.ContentToIndex = cont;

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

                    d.MetaDatas.AddObject(dt);
                    d.SaveChanges();
                    d.MetaDataRelations.AddObject(rel);
                    d.SaveChanges();
                }
            }
            catch { }
        }
Exemple #3
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
            {
                using (var entityObj = new XODBC(BaseImportTools.XSTRING, null))
                {
                    MetaData dt = new MetaData();
                    dt.MetaDataID = Guid.NewGuid();
                    dt.MetaDataType = metaDataType;
                    dt.ContentToIndex = cont;

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

                    entityObj.MetaDatas.AddObject(dt);
                    entityObj.SaveChanges();
                    entityObj.MetaDataRelations.AddObject(rel);
                    entityObj.SaveChanges();
                }

            }
            catch (Exception ex) { 
                string msg = "Error setting domains list "+ex.ToString();
            }

        }