예제 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Int32 ID = Convert.ToInt32(Request.QueryString["ID"]);
     Int32 addTime = Convert.ToInt32(Request.QueryString["timeAdd"]);
     //更新竞投时间
     try
     {
       Auction auction = Auction.FindByID(ID);
       if (auction.AuctionSatus != 3 && auction.EndTime <= DateTime.Now && auction.MinPrice <= auction.BiddingPriceNow)
       {
     auction.AuctionSatus = 3;
       }
       auction.EndTime = auction.EndTime.AddSeconds(addTime);
       auction.BiddingPriceNow += auction.EveryAddPrice;
       auction.WinningBidder = member.Current.ID;
       auction.UpdateTime = DateTime.Now;
       auction.BidCount += 1;
       auction.Update();
       //花费积分 竞投
       member.Current.point = member.Current.point - auction.EveryNeedPoint;
       member.Current.Update();
       AuctionHistory history = new AuctionHistory();
       history.MemberID = member.Current.ID;
       history.AuctionID = auction.ID;
       history.BidDate = DateTime.Now;
       history.BidEyuan = auction.BiddingPriceNow;
       history.Insert();
       PointHistory pointhistory = new PointHistory();
       pointhistory.UseTime = DateTime.Now;
       pointhistory.MemberId = member.Current.ID;
       pointhistory.Point = -1 * auction.EveryNeedPoint;
       pointhistory.ItemName = "参与竞投";
       pointhistory.CurrentPointCount = member.Current.point;
       pointhistory.Save();
       msgStr = "success";
     }
     catch (Exception ex)
     {
       msgStr = "fail";
       HmTrace.WriteException(ex.Message);
       //Response.Write(ex.Message);
     }
     Response.Write(msgStr);
 }
예제 #2
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            int newPoint = Convert.ToInt32(frmpoint.Value);
            int oldPoint = newmember.point;
            newmember.point = newPoint;
          newmember.Update();
            if (newPoint != oldPoint)
            {
                PointHistory pointhistory = new PointHistory();
                pointhistory.UseTime = DateTime.Now;
                pointhistory.MemberId = id;
                pointhistory.Point = newmember.point - Point;
                pointhistory.CurrentPointCount = newmember.point;
                pointhistory.ItemName = "后台会员管理修改积分";
                pointhistory.Save();

            }
            Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", @"alert('成功!');
        (function(){
        var load=window.onload;
        window.onload=function(){
        try{
            if(load) load();
            parent.Dialog.CloseAndRefresh(frameElement);
        }catch(e){};
        };
        })();
        ", true);

        }
        catch (Exception ex)
        {
        }
    }
예제 #3
0
파일: IPN.aspx.cs 프로젝트: hillterry/Jetso
    protected void Page_Load(object sender, EventArgs e)
    {
        if (VerifyIPN())
        {
          string ppTx = Request.Form["txn_id"].ToString();
          string ppreceiver_email = Request.Form["receiver_email"].ToString();
          string ppmc_gross = Request.Form["mc_gross"].ToString();
          string ppmc_currency = Request.Form["mc_currency"].ToString();
          string pppayment_status = Request.Form["payment_status"].ToString();
          string pppitem_name = Request.Form["item_name"].ToString();
          HmTrace.WriteInfo("No.:" + ppTx);
          HmTrace.WriteInfo("Email:" + ppreceiver_email);
          HmTrace.WriteInfo("gross:" + ppmc_gross);
          HmTrace.WriteInfo("currency:" + ppmc_currency);
          HmTrace.WriteInfo("status:" + pppayment_status);
          HmTrace.WriteInfo("item_name:" + pppitem_name );

          try
          {
        Order order = Order.FindByItemName(pppitem_name);
        if (order != null)
        {
          order.McCurrency = ppmc_currency;
          order.McGross = Convert.ToDecimal(ppmc_gross);
          order.OrderNo = ppTx;
          order.PaymentStatus = pppayment_status;
          order.ReceiverEmail = ppreceiver_email;
          order.Save();
          if (pppayment_status == "Completed")
          {
            member ordermember = member.FindByID(order.MemberId);
            if (ordermember != null)
            {
              var newpoint = PointType.FindByGross(Convert.ToDecimal(ppmc_gross)).Point;
              HmTrace.WriteInfo("会员:" + order.memberName + "新增积分:" + newpoint);
              ordermember.point = ordermember.point + newpoint;
              ordermember.Save();
              PointHistory pointhistory = new PointHistory();
              pointhistory.UseTime = DateTime.Now;
              pointhistory.MemberId = ordermember.ID;
              pointhistory.Point = newpoint;
              pointhistory.ItemName = "购买积分";
              pointhistory.CurrentPointCount = ordermember.point;
              pointhistory.Save();
              HmTrace.WriteInfo("会员:" + order.memberName + "积分:" + ordermember.point);
            }
            else
            {
              HmTrace.WriteInfo(""+Convert.ToDecimal(ppmc_gross)+"");
            }
          }
        }
        else
        {
          HmTrace.WriteInfo("找不到此itemName");
        }
          }
          catch (Exception ex)
          {
        HmTrace.WriteDebug(ex.Message);
          }
        }
    }