public override bool Update(TransactionManager transactionManager, ContractBill entity) { SqlDatabase database = new SqlDatabase(this._connectionString); DbCommand command = StoredProcedureProvider.GetCommandWrapper(database, "dbo.ContractBill_Update", this._useStoredProcedure); database.AddInParameter(command, "@Code", DbType.Int32, entity.Code); database.AddInParameter(command, "@ProjectCode", DbType.AnsiString, entity.ProjectCode); database.AddInParameter(command, "@ContractCode", DbType.AnsiString, entity.ContractCode); database.AddInParameter(command, "@BillNo", DbType.AnsiString, entity.BillNo); database.AddInParameter(command, "@BillMoney", DbType.Decimal, entity.BillMoney.HasValue ? ((object)entity.BillMoney) : ((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.AcceptChanges(); return(Convert.ToBoolean(num)); }
public virtual ContractBill Copy() { ContractBill bill = new ContractBill(); bill.Code = this.Code; bill.ProjectCode = this.ProjectCode; bill.ContractCode = this.ContractCode; bill.BillNo = this.BillNo; bill.BillMoney = this.BillMoney; bill.AcceptChanges(); return(bill); }