Пример #1
0
 /// <summary>
 /// 更新一条数据
 /// 过户币增加抽奖入口---姚志光
 /// </summary>
 public void Update(BCW.Model.Transfer model)
 {
     dal.Update(model);
     try
     {
         string xmlPath            = "/Controls/winners.xml";
         string TextForUbb         = (ub.GetSub("TextForUbb", xmlPath));         //设置内线提示的文字
         string WinnersStatus      = (ub.GetSub("WinnersStatus", xmlPath));      //状态1维护2测试0正常
         string WinnersOpenOrClose = (ub.GetSub("WinnersOpenOrClose", xmlPath)); //0|停止放送机会|1|开启放送机会
         string WinnersOpenChoose  = (ub.GetSub("WinnersOpenChoose", xmlPath));  //1全社区2社区3仅游戏
         string WinnersGuessOpen   = (ub.GetSub("WinnersGuessOpen", xmlPath));   //1发内线2不发内线
         int    usid     = model.FromId;
         string username = model.FromName;
         string Notes    = "过户";
         int    id       = new BCW.BLL.Action().GetMaxId();
         int    isHit    = new BCW.winners.winners().CheckActionForAll(0, 0, usid, username, Notes, id);
         if (isHit == 1)
         {
             if (WinnersGuessOpen == "1")
             {
                 new BCW.BLL.Guest().Add(0, usid, username, TextForUbb);//发内线到该ID
             }
         }
     }
     catch {  }
 }
Пример #2
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(BCW.Model.Transfer model)
 {
     return(dal.Add(model));
 }
Пример #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //执行分析
        string ym   = "kb288.com";
        string keys = Request["keys"];

        #region 支付宝掉线提示
        //支付宝掉线提示
        if (Request["act"] == "lostAli")
        {
            if (DESEncrypt.Decrypt(keys, "bg_rdzfb") != ym)
            {
                Response.Write("500");//提交非法
            }
            else
            {
                string userid = Request["userid"];
                string mename = new BCW.BLL.User().GetUsName(int.Parse(userid));

                new BCW.BLL.Guest().Add(int.Parse(userid), mename, "您的支付宝过币程序掉线了,如非本人操作,请检查过币程序。" + DateTime.Now.ToString());
            }
        }
        #endregion

        #region 自动过币
        if (Request["act"] == "zfb")
        {
            string userid   = Request["userid"];
            string userpass = Request["userpass"];
            string cent     = Request["cent"];
            string toid     = Request["toid"];
            string zfbNo    = Request["zfbNo"];


            if (DESEncrypt.Decrypt(keys, "bg_rdzfb") != ym)
            {
                Response.Write("500");//提交非法
            }
            else
            {
                try
                {
                    int meid = Convert.ToInt32(userid);
                    if (!new BCW.BLL.User().Exists(meid))
                    {
                        Response.Write("300");//自己ID不存在
                    }
                    else
                    {
                        BCW.Model.User modellogin = new BCW.Model.User();
                        modellogin.UsPwd = Utils.MD5Str(userpass);
                        modellogin.ID    = meid;
                        string mename       = new BCW.BLL.User().GetUsName(meid);
                        int    rowsAffected = new BCW.BLL.User().GetRowByID(modellogin);
                        int    ToId         = Convert.ToInt32(toid);

                        if (rowsAffected > 0)
                        {
                            long mycent  = new BCW.BLL.User().GetGold(meid);
                            long outcent = Convert.ToInt64(cent);
                            if (outcent > mycent)
                            {
                                Response.Write("201");//币币不足
                                new BCW.BLL.Guest().Add(meid, mename, "帐户币值不足以过币给ID" + ToId + ",转币失败(支," + zfbNo + ")");
                            }
                            else
                            {
                                if (!new BCW.BLL.User().Exists(ToId))
                                {
                                    Response.Write("202");//对方ID不存在
                                    //开始过币

                                    new BCW.BLL.Guest().Add(meid, mename, "ID" + ToId + "不存在,转币失败(支," + zfbNo + ")");
                                }
                                else
                                {
                                    //检查订单号是否重复
                                    zfbNo = Out.UBB(zfbNo);
                                    if (new BCW.BLL.Transfer().Exists(meid, zfbNo))
                                    {
                                        Response.Write("203");//订单重复提交
                                    }
                                    else
                                    {
                                        //开始过币
                                        string toname = new BCW.BLL.User().GetUsName(ToId);

                                        new BCW.BLL.User().UpdateiGold(meid, mename, -outcent, "过户给ID" + ToId + "(支付宝自动)");
                                        new BCW.BLL.User().UpdateiGold(ToId, toname, outcent, "来自ID" + meid + "过户(支付宝自动)");


                                        BCW.Model.Transfer model = new BCW.Model.Transfer();
                                        model.Types    = 0;
                                        model.FromId   = meid;
                                        model.FromName = mename;
                                        model.ToId     = ToId;
                                        model.ToName   = toname;
                                        model.AcCent   = outcent;
                                        model.AddTime  = DateTime.Now;
                                        model.zfbNo    = zfbNo;
                                        new BCW.BLL.Transfer().Add(model);

                                        //系统内线消息
                                        new BCW.BLL.Guest().Add(ToId, toname, "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]过户" + outcent + "" + ub.Get("SiteBz") + "给您(支," + zfbNo + ")");
                                        new BCW.BLL.Guest().Add(meid, mename, "您过户" + outcent + "" + ub.Get("SiteBz") + "给[url=/bbs/uinfo.aspx?uid=" + ToId + "] " + toname + " [/url]成功(支," + zfbNo + ")");

                                        Response.Write("200");//成功
                                    }
                                }
                            }
                        }
                        else
                        {
                            Response.Write("301");//密码错
                        }
                    }
                }
                catch
                {
                    Response.Write("400");//未知错误
                }
            }
        }
        #endregion
    }