public override bool Update(TransactionManager transactionManager, ContractAccount entity) { SqlDatabase database = new SqlDatabase(this._connectionString); DbCommand command = StoredProcedureProvider.GetCommandWrapper(database, "dbo.ContractAccount_Update", this._useStoredProcedure); database.AddInParameter(command, "@ContractAccountCode", DbType.AnsiString, entity.ContractAccountCode); database.AddInParameter(command, "@OriginalContractAccountCode", DbType.AnsiString, entity.OriginalContractAccountCode); database.AddInParameter(command, "@ContractAccountID", DbType.AnsiString, entity.ContractAccountID); database.AddInParameter(command, "@ContractCode", DbType.AnsiString, entity.ContractCode); database.AddInParameter(command, "@Reason", DbType.AnsiString, entity.Reason); database.AddInParameter(command, "@Status", DbType.Int32, entity.Status.HasValue ? ((object)entity.Status) : ((object)DBNull.Value)); database.AddInParameter(command, "@CreateDate", DbType.DateTime, entity.CreateDate.HasValue ? ((object)entity.CreateDate) : ((object)DBNull.Value)); database.AddInParameter(command, "@CreatePerson", DbType.AnsiString, entity.CreatePerson); database.AddInParameter(command, "@ContractChangeCode", DbType.AnsiString, entity.ContractChangeCode); 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.OriginalContractAccountCode = entity.ContractAccountCode; entity.AcceptChanges(); return(Convert.ToBoolean(num)); }
public virtual ContractAccount Copy() { ContractAccount account = new ContractAccount(); account.ContractAccountCode = this.ContractAccountCode; account.OriginalContractAccountCode = this.OriginalContractAccountCode; account.ContractAccountID = this.ContractAccountID; account.ContractCode = this.ContractCode; account.Reason = this.Reason; account.Status = this.Status; account.CreateDate = this.CreateDate; account.CreatePerson = this.CreatePerson; account.ContractChangeCode = this.ContractChangeCode; account.AcceptChanges(); return(account); }