Exemplo n.º 1
0
        static MessageCode InnerSaveMixNew(NbManagerEntity manager, Guid mid, SkillBagWrap bag, int coin, string setSkills = null)
        {
            int errorCode = (int)MessageCode.FailUpdate;

            using (var tranMgr = new TransactionManager(Dal.ConnectionFactory.Instance.GetDefault()))
            {
                tranMgr.BeginTransaction();
                do
                {
                    var mess = ManagerCore.Instance.CostCoin(manager, coin, EnumCoinConsumeSourceType.SkillUpgrade,
                                                             ShareUtil.GenerateComb().ToString(), tranMgr.TransactionObject);
                    if (mess != MessageCode.Success)
                    {
                        break;
                    }
                    NbManagerskillbagMgr.MixUpTran(false, mid, setSkills, bag.SetMap, "", bag.RawBag.RowVersion, ref errorCode);
                }while (false);
                if (errorCode == (int)MessageCode.Success)
                {
                    tranMgr.Commit();
                }
                else
                {
                    tranMgr.Rollback();
                }
            }
            return((MessageCode)errorCode);
        }
Exemplo n.º 2
0
        static MessageCode InnerSaveMix(Guid mid, ItemPackageFrame pack, SkillBagWrap bag, ItemInfoEntity mixItems, string setSkills = null)
        {
            string itemMap   = mixItems.ItemId.ToString();
            int    errorCode = (int)MessageCode.FailUpdate;

            using (var tranMgr = new TransactionManager(Dal.ConnectionFactory.Instance.GetDefault()))
            {
                tranMgr.BeginTransaction();
                do
                {
                    if (null != pack && !pack.Save(tranMgr.TransactionObject))
                    {
                        break;
                    }
                    NbManagerskillbagMgr.MixUpTran(false, mid, setSkills, bag.SetMap, itemMap, bag.RawBag.RowVersion, ref errorCode);
                }while (false);
                if (errorCode == (int)MessageCode.Success)
                {
                    tranMgr.Commit();
                }
                else
                {
                    tranMgr.Rollback();
                }
            }
            itemMap = null;
            return((MessageCode)errorCode);
        }