尽量把操作提示做成静态文本(弹出框很不友好)

 /// <summary>
        /// 构造订单列表的操作按钮组
        /// </summary>
        /// <param name="status"></param>
        /// <param name="orderID"></param>
        /// <returns></returns>
        private string BuildActionButton(int status,string orderID) {
            string actionBtns = "";
            if (status == (int)OrderStatus.WaitPay)
            {
                string cancelBtn = string.Format("<a href='{0}'>取消订单</a>", "/Order/Cancel?orderId=" + orderID);
                actionBtns += "  "+cancelBtn;
                string viewBtn = string.Format("<a href='{0}'>订单详情</a>", "/Order/View?orderId=" + orderID);
                actionBtns += "  " + viewBtn;
                string payBtn = string.Format("<a href='{0}'>付款</a>", "/Order/Pay?orderId=" + orderID);
                actionBtns += "  " + payBtn;
            }
            else if (status == (int)OrderStatus.Canceled) {
                string viewBtn = string.Format("<a href='{0}'>订单详情</a>", "/Order/View?orderId=" + orderID);
                actionBtns += "  " + viewBtn;
                string delBtn = string.Format("<a href='{0}'>删除</a>", "/Order/Delete?orderId=" + orderID);
                actionBtns += "  " + delBtn;
            }

            return actionBtns;
        }
public ActionResult Delete(string orderId)
        {
            if (!string.IsNullOrWhiteSpace(orderId))
            {
                Order modelForDel = new Order();
                modelForDel.OrderID = orderId;
                modelForDel.UserID = new Guid(base.CurrentLoginUserID);
                string msgReturn = this.orderBO.DeleteOrder(modelForDel);
                return RedirectToAction("Index", "Order", new { msg = msgReturn });
            }

            return RedirectToAction("Index", "Order");
        }

public ActionResult Index(string msg)
        {
            GetOrderList();           
            ViewData["ActionMsgInfo"] = string.IsNullOrWhiteSpace(msg) == false ? msg.ToString() : "";          
            return View();
        }
<p><font color="red">@ViewData["ActionMsgInfo"].ToString()</font></p>



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值