Exemplo n.º 1
0
    //开始抽奖
    public string Lottery1()
    {
        string  type = Common.FilterString(Common.GetStringOfUrl("method"));
        Lottery lo   = new Lottery();
        //判断玩家是否被指定中奖
        int speAwardid = lo.GetAwardSpecial(UiCommon.UserLoginInfo.UserID);
        //   int speAwardid = lo.GetAwardSpecial("207");
        int result = 0;

        if (speAwardid != 0)
        {
            //玩家指定中奖
            result = lo.AddAwardLog(UiCommon.UserLoginInfo.UserID, speAwardid.ToString(), type, "0");
            // lo.AddAwardLog("207", speAwardid.ToString(), type);
        }
        else
        {
            //抽取随机奖品id
            int awradid = Convert.ToInt32(GetAwardId(type));

            //获得奖品
            //if (awradid > 0)
            //{
            //抽中奖品

            result = lo.AddAwardLog(UiCommon.UserLoginInfo.UserID, awradid.ToString(), type, "1");

            if (result == -2 || result == 1)
            {
                speAwardid = 0;
            }
            if (result == 0)
            {
                speAwardid = awradid;
            }
        }

        //返回奖品的排序号
        return(GetAwardOrder(speAwardid));
    }
Exemplo n.º 2
0
    //开始抽奖
    public string Lottery1()
    {
        string type = Common.FilterString(Common.GetStringOfUrl("method"));
        Lottery lo = new Lottery();
        //判断玩家是否被指定中奖
        int speAwardid = lo.GetAwardSpecial(UiCommon.UserLoginInfo.UserID);
        //   int speAwardid = lo.GetAwardSpecial("207");
        int result = 0;

        if (speAwardid != 0)
        {
            //玩家指定中奖
            result = lo.AddAwardLog(UiCommon.UserLoginInfo.UserID, speAwardid.ToString(), type, "0");
            // lo.AddAwardLog("207", speAwardid.ToString(), type);

        }
        else
        {
            //抽取随机奖品id
            int awradid = Convert.ToInt32(GetAwardId(type));

            //获得奖品
            //if (awradid > 0)
            //{
            //抽中奖品

            result = lo.AddAwardLog(UiCommon.UserLoginInfo.UserID, awradid.ToString(), type, "1");

            if (result == -2 || result == 1)
                speAwardid = 0;
            if (result == 0)
                speAwardid = awradid;

        }

        //返回奖品的排序号
        return GetAwardOrder(speAwardid);
    }