public override bool Update(TransactionManager transactionManager, DictionaryItem entity)
        {
            SqlDatabase database = new SqlDatabase(this._connectionString);
            DbCommand   command  = StoredProcedureProvider.GetCommandWrapper(database, "dbo.DictionaryItem_Update", this._useStoredProcedure);

            database.AddInParameter(command, "@DictionaryItemCode", DbType.AnsiString, entity.DictionaryItemCode);
            database.AddInParameter(command, "@OriginalDictionaryItemCode", DbType.AnsiString, entity.OriginalDictionaryItemCode);
            database.AddInParameter(command, "@ProjectCode", DbType.AnsiString, entity.ProjectCode);
            database.AddInParameter(command, "@DictionaryNameCode", DbType.AnsiString, entity.DictionaryNameCode);
            database.AddInParameter(command, "@SortID", DbType.Int32, entity.SortID.HasValue ? ((object)entity.SortID) : ((object)DBNull.Value));
            database.AddInParameter(command, "@Name", DbType.AnsiString, entity.Name);
            int num = 0;

            if (transactionManager != null)
            {
                num = Utility.ExecuteNonQuery(transactionManager, command);
            }
            else
            {
                num = Utility.ExecuteNonQuery(database, command);
            }
            if (DataRepository.Provider.EnableEntityTracking)
            {
                EntityManager.StopTracking(entity.EntityTrackingKey);
            }
            entity.OriginalDictionaryItemCode = entity.DictionaryItemCode;
            entity.AcceptChanges();
            return(Convert.ToBoolean(num));
        }
Exemplo n.º 2
0
        public virtual DictionaryItem Copy()
        {
            DictionaryItem item = new DictionaryItem();

            item.DictionaryItemCode         = this.DictionaryItemCode;
            item.OriginalDictionaryItemCode = this.OriginalDictionaryItemCode;
            item.ProjectCode        = this.ProjectCode;
            item.DictionaryNameCode = this.DictionaryNameCode;
            item.SortID             = this.SortID;
            item.Name = this.Name;
            item.AcceptChanges();
            return(item);
        }