⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 orderprocess.ascx.cs

📁 网上书店
💻 CS
字号:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class DefaultControl_OrderProcess : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
             if (Session["OrderID"] != null)
            {
                string orderID = Session["OrderID"].ToString();
                GennerateShippingInfo(orderID);
            }
        }
    }

    protected void GennerateShippingInfo(string orderID)
    {
        customerShippingInfo info = OrderListAccess.GetOrderShippingInfo(orderID);
        txtUserName.Text = info.realName;
        txtPhone.Text = info.telPhone;
        txtEmail.Text = info.Email;
        txtPost.Text = info.post;
        txtAddress.Text = info.address;
    }

    protected void btnConfirm_Click(object sender, EventArgs e)
    {
        lblType.Text = ddlShippingType.SelectedItem.Text;
        lblName.Text = txtUserName.Text;
        lblPhone.Text = txtPhone.Text;
        lblEmail.Text = txtEmail.Text;
        lblPost.Text = txtPost.Text;
        lblAddress.Text = txtAddress.Text;
        lblOtherRequest.Text = txtCommont.Text;
        Panel1.Visible = false;
        Panel2.Visible = true;
        Panel3.Visible = false;
    }
    protected void btnSubmitOrder_Click(object sender, EventArgs e)
    {
        if (OrderListAccess.ModefiyShippingDetails(Session["OrderID"].ToString(),lblPhone.Text, lblEmail.Text, lblPost.Text, lblAddress.Text, lblName.Text,lblType.Text))
        {
            orderDateAndMoney order = OrderListAccess.GetOrdersAmountAndDate(Session["orderID"].ToString());
            lblOrderID.Text = Session["OrderID"].ToString();
            lblDate.Text = order.dateCreated;
            lblSum.Text = order.subtotal;
            OrderListAccess.ModifyOrderStatus(Session["OrderID"].ToString(), 1.ToString());
            Panel3.Visible = true;
            Panel2.Visible = false;
            Panel1.Visible = false;
        }
    }

    protected void btnPayOnline_Click(object sender, EventArgs e)
    {
        if (OrderListAccess.ModifyOrderStatus(Session["OrderID"].ToString(), 3.ToString()))
        {
            Message.ShowMsgBox(Page, "支付成功!");
        }
        else
        {
            Message.ShowMsgBox(Page, "支付失败");
        }
    }

    protected void btnPayOnBank_Click(object sender, EventArgs e)
    {
        if (OrderListAccess.ModifyOrderStatus  (Session["OrderID"].ToString(), 3.ToString()))
        {
            Message.ShowMsgBox(Page, "支付成功!");
        }
        else
        {
            Message.ShowMsgBox(Page, "支付失败");
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -