Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         M_UserInfo mu      = buser.GetLogin();
         DataRow    dr      = ExOrder.SelReturnModel(Mid);
         int        user    = DataConvert.CLng(dr["status_user"]);
         int        teacher = DataConvert.CLng(dr["status_teacher"]);
         if (mu.IsNull)
         {
             function.WriteErrMsg("用户未登录");
         }
         if (DataConvert.CLng(dr["status_money"]) == 1)
         {
             function.WriteErrMsg("订单已支付过佣金");
         }
         if (teacher != (int)ExConast.Order_Teacher.签约成功)
         {
             function.WriteErrMsg("订单状态不正确");
         }
         //-----------------生成支付单
         //检测是否已有支付单
         DataTable payDT = DBCenter.Sel(payBll.TbName, "code='" + Mid + "'", "PaymentID DESC");
         if (payDT.Rows.Count > 0)
         {
             M_Payment payMod = payBll.SelReturnModel(Convert.ToInt32(payDT.Rows[0]["PaymentID"]));
             if (payMod.Status == (int)M_Payment.PayStatus.HasPayed)
             {
                 function.WriteErrMsg("支付单已付过款");
             }
             Response.Redirect("/Payonline/OrderPay.aspx?payno=" + payMod.PayNo);
         }
         else
         {
             M_OrderList orderMod = orderBll.NewOrder(mu, M_OrderList.OrderEnum.Normal);
             orderMod.Ordersamount   = PlugConfig.Instance.Order_YJ;
             orderMod.Specifiedprice = PlugConfig.Instance.Order_YJ;
             orderMod.Balance_price  = PlugConfig.Instance.Order_YJ;
             orderMod.Money_code     = Mid.ToString();
             orderMod.id             = orderBll.insert(orderMod);
             M_CartPro cpMod = new M_CartPro();
             cpMod.Orderlistid = orderMod.id;
             cpMod.Proname     = "佣金";
             cpMod.Pronum      = 1;
             cpMod.Shijia      = orderMod.Ordersamount;
             cpMod.UserID      = mu.UserID;
             cpMod.Username    = mu.UserName;
             cpMod.ID          = cpBll.GetInsert(cpMod);
             M_Payment payMod = payBll.CreateByOrder(orderMod);
             payMod.code      = Mid.ToString();
             payMod.PaymentID = payBll.Add(payMod);
             //进去支付界面
             Response.Redirect("/Payonline/OrderPay.aspx?payno=" + payMod.PayNo);
         }
     }
 }
        private void MyBind()
        {
            M_Payment   payMod   = payBll.SelReturnModel(Mid);
            M_OrderList orderMod = orderBll.SelModelByOrderNo(payMod.PaymentNum);
            M_UserInfo  mu       = buser.GetSelect(orderMod.Userid);

            PayNo_L.Text     = payMod.PayNo;
            OrderNo_L.Text   = "<a href='../Shop/OrderListinfo.aspx?id=" + orderMod.id + "'>" + orderMod.OrderNo + "</href>";
            AddTime_L.Text   = orderMod.AddTime.ToString();
            MoneyPay_L.Text  = payMod.MoneyPay.ToString("f2");
            PayStatus_L.Text = OrderHelper.GetPayStatus(orderMod.Paymentstatus);
            CStatus_L.Text   = payMod.CStatus ? "<span style='color:green;'>已处理</span>" : "<span style='color:red;'>未处理</span>";
            Remark_L.Text    = payMod.Remark;
            if (payMod.Status == 3)//已支付
            {
                MoneyTrue_L.Text = payMod.MoneyTrue.ToString("f2");
                PayedTime_L.Text = payMod.SuccessTime.ToString();
                if (payMod.PayPlatID > 0)
                {
                    M_PayPlat platMod = platBll.SelReturnModel(payMod.PayPlatID);
                    PayPlat_L.Text = platMod.PayPlatName;
                }
            }
            else
            {
                ForceSucc_B.Visible = true;
            }
            UserName_L.Text = "<a href='javascript:;' onclick='showuser(" + mu.UserID + ");' title='查看用户'>" + mu.UserName + "</a>";
            //UserName_L.Text += "<span> (现有余额:<span style='color:red;'>" + mu.Purse.ToString("f2") + "</span>)</span>";
            if (ZType.Equals("pay"))
            {
                Return_L.Text = "<a href='../Shop/PayList.aspx' class='btn btn-primary'>返回列表</a>";
            }
            else
            {
                Return_L.Text = "<a href='PaymentList.aspx' class='btn btn-primary'>返回列表</a>";
            }
        }
Exemplo n.º 3
0
        public IActionResult PaymentInfo()
        {
            M_Payment payMod = payBll.SelReturnModel(Mid);

            if (payMod == null)
            {
                return(WriteErr("支付单不存在")); return(null);
            }

            M_OrderList orderMod = orderBll.SelModelByOrderNo(payMod.PaymentNum);
            M_UserInfo  mu       = buser.SelReturnModel(orderMod.Userid);
            M_PayPlat   platMod  = new M_PayPlat();

            if (payMod.Status == 3 && payMod.PayPlatID > 0)
            {
                platMod = platBll.SelReturnModel(payMod.PayPlatID);
            }
            ViewBag.platMod  = platMod;
            ViewBag.orderMod = orderMod;
            ViewBag.mu       = mu;
            return(View(payMod));
        }