예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            int orderId = PageTools.GetSavedId("OrderId", Request.QueryString["id"]);
            if ( orderId==0 )
                Response.Redirect("OrderList.aspx");

            lnkPrint.NavigateUrl = "PrintTicket.aspx" + Request.Url.Query;

            AdminOrderBiz biz = new AdminOrderBiz();
            int scheduleId = biz.GetOrderScheduleId(orderId);

            OrderInfoCtl1.OrderId = orderId;
            OrderInfoCtl1.DataBind();

            OrdersCCListDataset.SelectParameters["orderId"].DefaultValue = orderId.ToString();
            lstOrdersCCList.DataBind();

            OplogList1.OpType = 4;
            OplogList1.RelateID = orderId;

            VoucherDataset.SelectParameters["orderID"].DefaultValue = orderId.ToString();

            lnkBusSeats.NavigateUrl = "~/BusSeats.aspx?id="+ scheduleId.ToString();

            // OrderEdit权限检查
            int status = biz.GetOrderStatus(orderId);
            int orderType = biz.GetOrderType(orderId);
            if (orderType > 0)
            {
                // is ticket
                lnkOrderEdit.NavigateUrl = "TicketEdit.aspx";
                lnkPrint.NavigateUrl = "PrintQTicket.aspx" + Request.Url.Query;
            }
            if (PageLogic.CheckPageAuth("OrderEdit.aspx"))
            {
                if (status >= 3 && status<7)
                {
                    if (!PageLogic.CheckActionAuth("EditFullPaidOrder"))
                    {
                        lnkOrderEdit.Attributes.Add("onclick", "alert('You have not authorization to edit orders in this status.\\n\\n您没有授权修改此状态下的订单。');return false;");
                    }
                }
                if (status >= 7)
                {
                    lnkOrderEdit.Attributes.Add("onclick", "alert('Order been closed.\\n订单已完成。');return false;");
                }
            }
            else
            {
                lnkOrderEdit.Enabled = false;
            }

            if (status ==0 || status >= 3)
            {
                lnkPayment.Enabled = false;
            }
            if (status < 2)
            {
                lnkRefund.Enabled = lnkPrint.Enabled = false;
            }
        }
    }
예제 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            int orderId = PageTools.GetSavedId("OrderId", Request.QueryString["id"]);
            if (orderId == 0)
                Response.Redirect("OrderActive.aspx");

            AdminOrderBiz biz = new AdminOrderBiz();
            int status = biz.GetOrderStatus(orderId);
            if (status != 2)
            {
                PageLogic.ShowError("Order's status incorrect. Please check.", "OrderDetail.aspx");
                return;
            }

            int scheduleId = biz.GetOrderScheduleId(orderId);

            OrderInfoCtl1.OrderId = orderId;
            OrderInfoCtl1.DataBind();

            CompareValidator rv = fvCreditCard.FindControl("CompareValidator1") as CompareValidator;
            if (rv != null)
            {
                rv.ValueToCompare = biz.GetBalance(orderId).ToString();
            }
        }
    }