Exemplo n.º 1
0
        public static MessageCode GetWorthErrorCode(EnumWorthType worthType)
        {
            switch (worthType)
            {
            case EnumWorthType.Gold:
                return(MessageCode.LackofGold);

            case EnumWorthType.Coin:
                return(MessageCode.LackofCoin);

            case EnumWorthType.ManagerLevel:
                return(MessageCode.LackofManagerLevel);

            case EnumWorthType.VipLevel:
                return(MessageCode.LackofVipLevel);
            }
            return(MessageCode.NbParameterError);
        }
Exemplo n.º 2
0
        public static long GetWorthValue(Guid managerId, WorthSource worthSrc, EnumWorthType worthType)
        {
            long val = -1;

            try
            {
                if (null == worthSrc)
                {
                    worthSrc = new WorthSource();
                }
                if (null == worthSrc.Manager)
                {
                    worthSrc.Manager = NbManagerMgr.GetById(managerId);
                }
                if (null == worthSrc.Manager)
                {
                    return(val);
                }
                switch (worthType)
                {
                case EnumWorthType.Gold:
                    if (null == worthSrc.Account)
                    {
                        worthSrc.Account = GetPayAccount(worthSrc.Manager.Account);
                    }
                    return(worthSrc.Account.TotalPoint);

                case EnumWorthType.Coin:
                    return(worthSrc.Manager.Coin);

                case EnumWorthType.ManagerLevel:
                    return(worthSrc.Manager.Level);

                case EnumWorthType.VipLevel:
                    return(worthSrc.Manager.VipLevel);
                }
            }
            catch (Exception ex)
            {
                SystemlogMgr.Error("FrameConvert:GetWorthValue", ex);
            }
            return(val);
        }
Exemplo n.º 3
0
        public static long GetWorthValue(Guid managerId, EnumWorthType worthType)
        {
            var worthSrc = new WorthSource();

            return(GetWorthValue(managerId, worthSrc, worthType));
        }