Exemplo n.º 1
0
        public static string CJBegin(int iUserID, string sGift, string sGameAbbre)
        {
            string sCJRes = string.Empty;
            int    iNum   = UserDWCJNum(iUserID);

            if (iNum > 0)
            {
                if (sGameAbbre.IndexOf("wssg") == 0)
                {
                    string sServerID = GetServerID(sGameAbbre);
                    int    iServerID = 1;
                    if (int.TryParse(sServerID, out iServerID))
                    {
                        //抽奖开始
                        Random rdObject   = new Random();
                        int    iRandomNum = rdObject.Next(1, 30);
                        string sGiftID    = string.Empty;
                        if (iRandomNum < 10)
                        {
                            sGiftID = string.Format("2930000{0}", iRandomNum);
                        }
                        else
                        {
                            sGiftID = string.Format("293000{0}", iRandomNum);
                        }
                        string sTranID = ProvideCommon.GenerateStringID();
                        string sRes    = RechargePrize(iUserID.ToString(), sGiftID, sTranID, sGameAbbre);
                        if (sRes == "1")
                        {
                            sCJRes = string.Format("0|{0}", iRandomNum.ToString());
                            GameGiftBLL.GameGiftAdd(iServerID, iUserID, sGift, "wssg", sGiftID, sTranID);
                        }
                        else if (sRes == "2")
                        {
                            sCJRes = "1";
                        }
                    }
                    else
                    {
                        sCJRes = "servererr";
                    }
                }
                else
                {
                    sCJRes = "gameerr";
                }
            }
            else
            {
                sCJRes = "numless";
            }
            return(sCJRes);
        }
Exemplo n.º 2
0
        public static int UserDWCJNum(int iUserID)
        {
            int      iNum    = 0;
            DateTime dtBegin = new DateTime(2013, 6, 9);
            DateTime dtEnd   = new DateTime(2013, 6, 17);
            int      iPoint  = GamePaySucBLL.UPointSelByGNTime("wssg", iUserID, dtBegin, dtEnd);

            if (iPoint > 999)
            {
                int iPayNum   = iPoint / 1000;
                int iPayedNum = GameGiftBLL.UCountSelByGift(iUserID, "wssg2013dw");
                iNum = iPayNum - iPayedNum;
            }
            return(iNum);
        }