Ejemplo n.º 1
0
        public virtual ContractChange Copy()
        {
            ContractChange change = new ContractChange();

            change.ContractChangeCode         = this.ContractChangeCode;
            change.OriginalContractChangeCode = this.OriginalContractChangeCode;
            change.ContractChangeId           = this.ContractChangeId;
            change.ContractCode         = this.ContractCode;
            change.Voucher              = this.Voucher;
            change.Money                = this.Money;
            change.ChangeMoney          = this.ChangeMoney;
            change.NewMoney             = this.NewMoney;
            change.OriginalMoney        = this.OriginalMoney;
            change.TotalChangeMoney     = this.TotalChangeMoney;
            change.SupplierChangeMoney  = this.SupplierChangeMoney;
            change.ConsultantAuditMoney = this.ConsultantAuditMoney;
            change.ProjectAuditMoney    = this.ProjectAuditMoney;
            change.ChangeReason         = this.ChangeReason;
            change.Status               = this.Status;
            change.ChangePerson         = this.ChangePerson;
            change.ChangeDate           = this.ChangeDate;
            change.ChangeType           = this.ChangeType;
            change.CheckPerson          = this.CheckPerson;
            change.CheckDate            = this.CheckDate;
            change.AcceptChanges();
            return(change);
        }
Ejemplo n.º 2
0
        public override bool Update(TransactionManager transactionManager, ContractChange entity)
        {
            SqlDatabase database = new SqlDatabase(this._connectionString);
            DbCommand   command  = StoredProcedureProvider.GetCommandWrapper(database, "dbo.ContractChange_Update", this._useStoredProcedure);

            database.AddInParameter(command, "@ContractChangeCode", DbType.AnsiString, entity.ContractChangeCode);
            database.AddInParameter(command, "@OriginalContractChangeCode", DbType.AnsiString, entity.OriginalContractChangeCode);
            database.AddInParameter(command, "@ContractChangeId", DbType.AnsiString, entity.ContractChangeId);
            database.AddInParameter(command, "@ContractCode", DbType.AnsiString, entity.ContractCode);
            database.AddInParameter(command, "@Voucher", DbType.AnsiString, entity.Voucher);
            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, "@SupplierChangeMoney", DbType.Decimal, entity.SupplierChangeMoney.HasValue ? ((object)entity.SupplierChangeMoney) : ((object)DBNull.Value));
            database.AddInParameter(command, "@ConsultantAuditMoney", DbType.Decimal, entity.ConsultantAuditMoney.HasValue ? ((object)entity.ConsultantAuditMoney) : ((object)DBNull.Value));
            database.AddInParameter(command, "@ProjectAuditMoney", DbType.Decimal, entity.ProjectAuditMoney.HasValue ? ((object)entity.ProjectAuditMoney) : ((object)DBNull.Value));
            database.AddInParameter(command, "@ChangeReason", DbType.AnsiString, entity.ChangeReason);
            database.AddInParameter(command, "@Status", DbType.Int32, entity.Status.HasValue ? ((object)entity.Status) : ((object)DBNull.Value));
            database.AddInParameter(command, "@ChangePerson", DbType.AnsiString, entity.ChangePerson);
            database.AddInParameter(command, "@ChangeDate", DbType.DateTime, entity.ChangeDate.HasValue ? ((object)entity.ChangeDate) : ((object)DBNull.Value));
            database.AddInParameter(command, "@ChangeType", DbType.AnsiString, entity.ChangeType);
            database.AddInParameter(command, "@CheckPerson", DbType.AnsiString, entity.CheckPerson);
            database.AddInParameter(command, "@CheckDate", DbType.DateTime, entity.CheckDate.HasValue ? ((object)entity.CheckDate) : ((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.OriginalContractChangeCode = entity.ContractChangeCode;
            entity.AcceptChanges();
            return(Convert.ToBoolean(num));
        }