public PandoraStrengthShadow(Guid itemId1, int itemCode1, int strength1, bool isProtect, int costCoin, int costPoint, int resultType, Guid resultItemId, int resultItemCode, int resultStrength, Guid transactionId , Guid luckyItemId, int luckyItemCode, double rate) { Shadow = new ShadowPandoraStrengthEntity(); Shadow.TransactionId = transactionId; Shadow.ItemId1 = itemId1; Shadow.ItemCode1 = itemCode1; Shadow.Strength1 = strength1; Shadow.IsProtect = isProtect; Shadow.CostCoin = costCoin; Shadow.CostPoint = costPoint; Shadow.ResultType = resultType; Shadow.ResultItemId = resultItemId; Shadow.ResultItemCode = resultItemCode; Shadow.ResultStrength = resultStrength; Shadow.LuckyItemId = luckyItemId; Shadow.LuckyItemCode = luckyItemCode; Shadow.Rate = Convert.ToDecimal(rate); }
/// <summary> /// 带事务Insert /// </summary> /// <param name="entity"></param> /// <param name="trans">The trans.</param> /// <returns></returns> /// <remarks>2014/3/23 22:11:34</remarks> public bool SavePandoraStrength(ShadowPandoraStrengthEntity entity, DbTransaction trans = null) { var database = new SqlDatabase(this.ConnectionString); DbCommand commandWrapper = database.GetStoredProcCommand("dbo.P_PandoraStrength_Insert"); database.AddInParameter(commandWrapper, "@TransactionId", DbType.Guid, entity.TransactionId); database.AddInParameter(commandWrapper, "@ItemId1", DbType.Guid, entity.ItemId1); database.AddInParameter(commandWrapper, "@ItemCode1", DbType.Int32, entity.ItemCode1); database.AddInParameter(commandWrapper, "@Strength1", DbType.Int32, entity.Strength1); database.AddInParameter(commandWrapper, "@ItemId2", DbType.Guid, entity.ItemId2); database.AddInParameter(commandWrapper, "@ItemCode2", DbType.Int32, entity.ItemCode2); database.AddInParameter(commandWrapper, "@Strength2", DbType.Int32, entity.Strength2); database.AddInParameter(commandWrapper, "@IsProtect", DbType.Boolean, entity.IsProtect); database.AddInParameter(commandWrapper, "@CostCoin", DbType.Int32, entity.CostCoin); database.AddInParameter(commandWrapper, "@CostPoint", DbType.Int32, entity.CostPoint); database.AddInParameter(commandWrapper, "@ResultType", DbType.Int32, entity.ResultType); database.AddInParameter(commandWrapper, "@ResultItemId", DbType.Guid, entity.ResultItemId); database.AddInParameter(commandWrapper, "@ResultItemCode", DbType.Int32, entity.ResultItemCode); database.AddInParameter(commandWrapper, "@ResultStrength", DbType.Int32, entity.ResultStrength); database.AddInParameter(commandWrapper, "@LuckyItemId", DbType.Guid, entity.LuckyItemId); database.AddInParameter(commandWrapper, "@LuckyItemCode", DbType.Int32, entity.LuckyItemCode); database.AddInParameter(commandWrapper, "@Rate", DbType.Decimal, entity.Rate); int results = 0; if (trans != null) { results = database.ExecuteNonQuery(commandWrapper, trans); } else { results = database.ExecuteNonQuery(commandWrapper); } return(Convert.ToBoolean(results)); }