コード例 #1
0
ファイル: ContractCostChangeBase.cs プロジェクト: ishui/rms2
        public virtual ContractCostChange Copy()
        {
            ContractCostChange change = new ContractCostChange();

            change.ContractCostChangeCode         = this.ContractCostChangeCode;
            change.OriginalContractCostChangeCode = this.OriginalContractCostChangeCode;
            change.ContractCode       = this.ContractCode;
            change.ContractCostCode   = this.ContractCostCode;
            change.ContractChangeCode = this.ContractChangeCode;
            change.Cash              = this.Cash;
            change.ChangeCash        = this.ChangeCash;
            change.NewCash           = this.NewCash;
            change.OriginalCash      = this.OriginalCash;
            change.TotalChangeCash   = this.TotalChangeCash;
            change.MoneyType         = this.MoneyType;
            change.ExchangeRate      = this.ExchangeRate;
            change.Money             = this.Money;
            change.ChangeMoney       = this.ChangeMoney;
            change.NewMoney          = this.NewMoney;
            change.OriginalMoney     = this.OriginalMoney;
            change.TotalChangeMoney  = this.TotalChangeMoney;
            change.CostCode          = this.CostCode;
            change.CostBudgetSetCode = this.CostBudgetSetCode;
            change.Description       = this.Description;
            change.Status            = this.Status;
            change.AcceptChanges();
            return(change);
        }
コード例 #2
0
        public override bool Update(TransactionManager transactionManager, ContractCostChange entity)
        {
            SqlDatabase database = new SqlDatabase(this._connectionString);
            DbCommand   command  = StoredProcedureProvider.GetCommandWrapper(database, "dbo.ContractCostChange_Update", this._useStoredProcedure);

            database.AddInParameter(command, "@ContractCostChangeCode", DbType.AnsiString, entity.ContractCostChangeCode);
            database.AddInParameter(command, "@OriginalContractCostChangeCode", DbType.AnsiString, entity.OriginalContractCostChangeCode);
            database.AddInParameter(command, "@ContractCode", DbType.AnsiString, entity.ContractCode);
            database.AddInParameter(command, "@ContractCostCode", DbType.AnsiString, entity.ContractCostCode);
            database.AddInParameter(command, "@ContractChangeCode", DbType.AnsiString, entity.ContractChangeCode);
            database.AddInParameter(command, "@Cash", DbType.Decimal, entity.Cash.HasValue ? ((object)entity.Cash) : ((object)DBNull.Value));
            database.AddInParameter(command, "@ChangeCash", DbType.Decimal, entity.ChangeCash.HasValue ? ((object)entity.ChangeCash) : ((object)DBNull.Value));
            database.AddInParameter(command, "@NewCash", DbType.Decimal, entity.NewCash.HasValue ? ((object)entity.NewCash) : ((object)DBNull.Value));
            database.AddInParameter(command, "@OriginalCash", DbType.Decimal, entity.OriginalCash.HasValue ? ((object)entity.OriginalCash) : ((object)DBNull.Value));
            database.AddInParameter(command, "@TotalChangeCash", DbType.Decimal, entity.TotalChangeCash.HasValue ? ((object)entity.TotalChangeCash) : ((object)DBNull.Value));
            database.AddInParameter(command, "@MoneyType", DbType.AnsiString, entity.MoneyType);
            database.AddInParameter(command, "@ExchangeRate", DbType.Decimal, entity.ExchangeRate.HasValue ? ((object)entity.ExchangeRate) : ((object)DBNull.Value));
            database.AddInParameter(command, "@Money", DbType.Decimal, entity.Money.HasValue ? ((object)entity.Money) : ((object)DBNull.Value));
            database.AddInParameter(command, "@ChangeMoney", DbType.Decimal, entity.ChangeMoney.HasValue ? ((object)entity.ChangeMoney) : ((object)DBNull.Value));
            database.AddInParameter(command, "@NewMoney", DbType.Decimal, entity.NewMoney.HasValue ? ((object)entity.NewMoney) : ((object)DBNull.Value));
            database.AddInParameter(command, "@OriginalMoney", DbType.Decimal, entity.OriginalMoney.HasValue ? ((object)entity.OriginalMoney) : ((object)DBNull.Value));
            database.AddInParameter(command, "@TotalChangeMoney", DbType.Decimal, entity.TotalChangeMoney.HasValue ? ((object)entity.TotalChangeMoney) : ((object)DBNull.Value));
            database.AddInParameter(command, "@CostCode", DbType.AnsiString, entity.CostCode);
            database.AddInParameter(command, "@CostBudgetSetCode", DbType.AnsiString, entity.CostBudgetSetCode);
            database.AddInParameter(command, "@Description", DbType.AnsiString, entity.Description);
            database.AddInParameter(command, "@Status", DbType.Int32, entity.Status.HasValue ? ((object)entity.Status) : ((object)DBNull.Value));
            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.OriginalContractCostChangeCode = entity.ContractCostChangeCode;
            entity.AcceptChanges();
            return(Convert.ToBoolean(num));
        }