using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using CY.BLL.EC; using CY.Model; using CY.BLL.Sys; namespace CY.WebForm.Pages.membermanage { public partial class OnOrUnFreezeOrder : MainPage { EC_OrderBasicBLL _eC_OrderBasicBLL = new EC_OrderBasicBLL(); Sys_DictionaryBLL _dictionaryBLL = new Sys_DictionaryBLL(); public int KeyId { get { return Request.Params["KeyId"] == null ? 0 : int.Parse(Request.Params["KeyId"].ToString()); } } public string UserType { get { return Request.Params["UserType"] == null ? string.Empty : Request.Params["UserType"].ToString(); } } public string PageTitle; protected void Page_Load(object sender, EventArgs e) { PageTitle = "冻结订单"; if (!IsPostBack) { BindPage(); } } private void BindPage() { EC_OrderBasic model = _eC_OrderBasicBLL.SelectModelById(KeyId); if (model != null) { if (UserType == "1") { this.lblOrderId.Text = model.SellerOrderId; } else { this.lblOrderId.Text = model.ShowCode; } this.lblOrderName.Text = model.DocumentName; this.lblBuyName.Text = model.BuyerName; this.lblSellerName.Text = model.SellerName; int orderState = model.OrderState.Value; string orderStateName = _dictionaryBLL.GetNameByMeanValue(orderState, "EC_订单状态"); this.lblOrderStateName.Text = orderStateName; //如果已冻结 if (orderState == -2) { this.PageTitle = "解冻订单"; this.btnSave.Text = "确定解冻"; } else { this.PageTitle = "冻结订单"; this.btnSave.Text = "确定冻结"; } } } protected void btnSave_Click(object sender, EventArgs e) { bool isSuccess = false; EC_OrderOperate orderOperate = null; if (this.btnSave.Text == "确定冻结") { orderOperate = new EC_OrderOperate() { OperateType = -2, OrderId = KeyId, Operator = CurrentUser.ShortName, LastUpdateTime=DateTime.Now, Remark = "冻结订单" }; } else { EC_OrderOperate operate = _eC_OrderBasicBLL.GetSecondOrderOperateByDEC(KeyId); orderOperate = new EC_OrderOperate() { OperateType = operate.OperateType.Value, OrderId = KeyId, Operator = CurrentUser.ShortName, LastUpdateTime = DateTime.Now, Remark = "解冻订单" }; } isSuccess = _eC_OrderBasicBLL.UpdateOrderState(orderOperate); if (isSuccess) { Response.Write(""); } else { JavaScript.MessageBox("操作失败", this); } } } }