Example #1
0
 public PandoraSynthesisShadow(int synthesisType, Guid itemId1, int itemCode1, Guid itemId2, int itemCode2,
                               Guid itemId3, int itemCode3, Guid itemId4, int itemCode4, Guid itemId5, int itemCode5, Guid suitdrawingId, int suitdrawingItemCode,
                               bool isProtect, int costCoin, int costPoint, int resultType, Guid resultItemId, int resultItemCode, Guid transactionId,
                               Guid luckyItemId, int luckyItemCode, Guid goldformulaItemId, int goldformulaItemCode, double rate)
 {
     Shadow = new ShadowPandoraSynthesisEntity();
     Shadow.TransactionId       = transactionId;
     Shadow.SynthesisType       = synthesisType;
     Shadow.ItemId1             = itemId1;
     Shadow.ItemCode1           = itemCode1;
     Shadow.ItemId2             = itemId2;
     Shadow.ItemCode2           = itemCode2;
     Shadow.ItemId3             = itemId3;
     Shadow.ItemCode3           = itemCode3;
     Shadow.ItemId4             = itemId4;
     Shadow.ItemCode4           = itemCode4;
     Shadow.ItemId5             = itemId5;
     Shadow.ItemCode5           = itemCode5;
     Shadow.SuitdrawingId       = suitdrawingId;
     Shadow.SuitdrawingItemCode = suitdrawingItemCode;
     Shadow.IsProtect           = isProtect;
     Shadow.CostCoin            = costCoin;
     Shadow.CostPoint           = costPoint;
     Shadow.ResultType          = resultType;
     Shadow.ResultItemId        = resultItemId;
     Shadow.ResultItemCode      = resultItemCode;
     Shadow.LuckyItemId         = luckyItemId;
     Shadow.LuckyItemCode       = luckyItemCode;
     Shadow.GoldFormulaItemId   = goldformulaItemId;
     Shadow.GoldFormulaItemCode = goldformulaItemCode;
     Shadow.Rate = Convert.ToDecimal(rate);
 }
Example #2
0
        /// <summary>
        /// 带事务Insert
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="trans">The trans.</param>
        /// <returns></returns>
        /// <remarks>2014/3/22 22:05:56</remarks>
        public bool SavePandoraSynthesis(ShadowPandoraSynthesisEntity entity, DbTransaction trans = null)
        {
            var       database       = new SqlDatabase(this.ConnectionString);
            DbCommand commandWrapper = database.GetStoredProcCommand("dbo.P_PandoraSynthesis_Insert");

            database.AddInParameter(commandWrapper, "@TransactionId", DbType.Guid, entity.TransactionId);
            database.AddInParameter(commandWrapper, "@SynthesisType", DbType.Int32, entity.SynthesisType);
            database.AddInParameter(commandWrapper, "@ItemId1", DbType.Guid, entity.ItemId1);
            database.AddInParameter(commandWrapper, "@ItemCode1", DbType.Int32, entity.ItemCode1);
            database.AddInParameter(commandWrapper, "@ItemId2", DbType.Guid, entity.ItemId2);
            database.AddInParameter(commandWrapper, "@ItemCode2", DbType.Int32, entity.ItemCode2);
            database.AddInParameter(commandWrapper, "@ItemId3", DbType.Guid, entity.ItemId3);
            database.AddInParameter(commandWrapper, "@ItemCode3", DbType.Int32, entity.ItemCode3);
            database.AddInParameter(commandWrapper, "@ItemId4", DbType.Guid, entity.ItemId4);
            database.AddInParameter(commandWrapper, "@ItemCode4", DbType.Int32, entity.ItemCode4);
            database.AddInParameter(commandWrapper, "@ItemId5", DbType.Guid, entity.ItemId5);
            database.AddInParameter(commandWrapper, "@ItemCode5", DbType.Int32, entity.ItemCode5);
            database.AddInParameter(commandWrapper, "@SuitdrawingId", DbType.Guid, entity.SuitdrawingId);
            database.AddInParameter(commandWrapper, "@SuitdrawingItemCode", DbType.Int32, entity.SuitdrawingItemCode);
            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, "@LuckyItemId", DbType.Guid, entity.LuckyItemId);
            database.AddInParameter(commandWrapper, "@LuckyItemCode", DbType.Int32, entity.LuckyItemCode);
            database.AddInParameter(commandWrapper, "@GoldFormulaItemId", DbType.Guid, entity.GoldFormulaItemId);
            database.AddInParameter(commandWrapper, "@GoldFormulaItemCode", DbType.Int32, entity.GoldFormulaItemCode);
            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));
        }