public override bool Update(TransactionManager transactionManager, ContractNexus entity) { SqlDatabase database = new SqlDatabase(this._connectionString); DbCommand command = StoredProcedureProvider.GetCommandWrapper(database, "dbo.ContractNexus_Update", this._useStoredProcedure); database.AddInParameter(command, "@ContractNexusCode", DbType.AnsiString, entity.ContractNexusCode); database.AddInParameter(command, "@OriginalContractNexusCode", DbType.AnsiString, entity.OriginalContractNexusCode); database.AddInParameter(command, "@ContractCode", DbType.AnsiString, entity.ContractCode); database.AddInParameter(command, "@ContractChangeCode", DbType.AnsiString, entity.ContractChangeCode); database.AddInParameter(command, "@Code", DbType.AnsiString, entity.Code); database.AddInParameter(command, "@Type", DbType.AnsiString, entity.Type); database.AddInParameter(command, "@Name", DbType.AnsiString, entity.Name); database.AddInParameter(command, "@ID", DbType.AnsiString, entity.ID); database.AddInParameter(command, "@Person", DbType.AnsiString, entity.Person); database.AddInParameter(command, "@Date", DbType.DateTime, entity.Date.HasValue ? ((object)entity.Date) : ((object)DBNull.Value)); database.AddInParameter(command, "@Path", DbType.AnsiString, entity.Path); database.AddInParameter(command, "@Money", DbType.Decimal, entity.Money.HasValue ? ((object)entity.Money) : ((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.OriginalContractNexusCode = entity.ContractNexusCode; entity.AcceptChanges(); return(Convert.ToBoolean(num)); }
public virtual ContractNexus Copy() { ContractNexus nexus = new ContractNexus(); nexus.ContractNexusCode = this.ContractNexusCode; nexus.OriginalContractNexusCode = this.OriginalContractNexusCode; nexus.ContractCode = this.ContractCode; nexus.ContractChangeCode = this.ContractChangeCode; nexus.Code = this.Code; nexus.Type = this.Type; nexus.Name = this.Name; nexus.ID = this.ID; nexus.Person = this.Person; nexus.Date = this.Date; nexus.Path = this.Path; nexus.Money = this.Money; nexus.AcceptChanges(); return(nexus); }