protected void Page_Load(object sender, EventArgs e) { if (!int.TryParse(Request.QueryString["LookupListId"], out lookupListId)) { GotoResourceNotFound(); } else { btnSave.Click += new EventHandler(btnSave_Click); if (!IsPostBack) { OrderLookupListInfo orderLookupList = OrderHelper.GetOrderLookupList(lookupListId); if (orderLookupList == null) { GotoResourceNotFound(); } else { Globals.EntityCoding(orderLookupList, false); txtListName.Text = orderLookupList.Name; dropSelectMode.SelectedValue = orderLookupList.SelectMode; txtDescription.Text = orderLookupList.Description; } } } }
private OrderLookupListInfo GetOrderLookupList() { OrderLookupListInfo orderLookupListInfo = new OrderLookupListInfo(); orderLookupListInfo.Name = txtListName.Text.Trim(); orderLookupListInfo.SelectMode = dropSelectMode.SelectedValue; orderLookupListInfo.Description = txtDescription.Text.Trim(); return(orderLookupListInfo); }
private bool ValidationOrderLookupList(OrderLookupListInfo lookupList) { ValidationResults results = Hishop.Components.Validation.Validation.Validate <OrderLookupListInfo>(lookupList, new string[] { "ValOrderLookupListInfo" }); string msg = string.Empty; if (!results.IsValid) { foreach (ValidationResult result in (IEnumerable <ValidationResult>)results) { msg = msg + Formatter.FormatErrorMessage(result.Message); } ShowMsg(msg, false); } return(results.IsValid); }
protected void Page_Load(object sender, EventArgs e) { btnCreate.Click += new EventHandler(btnCreate_Click); grdOrderLookupItems.RowDeleting += new GridViewDeleteEventHandler(grdOrderLookupItems_RowDeleting); grdOrderLookupItems.DataBound += new EventHandler(grdOrderLookupItems_DataBound); lkOver.Click += new EventHandler(lkOver_Click); if (!int.TryParse(base.Request.QueryString["LookupListId"], out lookupListId)) { base.GotoResourceNotFound(); } else if (!base.IsPostBack) { OrderLookupListInfo orderLookupList = OrderHelper.GetOrderLookupList(lookupListId); litName.Text = orderLookupList.Name; } }
private void btnSave_Click(object sender, EventArgs e) { OrderLookupListInfo orderLookupList = GetOrderLookupList(); orderLookupList.LookupListId = lookupListId; if (ValidationOrderLookupList(orderLookupList)) { if (!OrderHelper.UpdateOrderLookupList(orderLookupList)) { ShowMsg("未知错误", false); } else { ShowMsg("修改可选项成功", true); } } }
private void btnCreate_Click(object sender, EventArgs e) { OrderLookupListInfo orderLookupList = GetOrderLookupList(); if (ValidationOrderLookupList(orderLookupList)) { int lookupListId = OrderHelper.CreateOrderLookupList(orderLookupList); if (lookupListId < 0) { ShowMsg("未知错误", false); } else { base.Response.Redirect("AddOrderLookupItem.aspx?LookupListId=" + lookupListId); } } }
void FillOrderOptions(OrderInfo orderInfo) { orderInfo.OrderOptions.Clear(); IList <OrderLookupItemInfo> selectedOptions = orderOptionList.SelectedOptions; if ((selectedOptions != null) && (selectedOptions.Count > 0)) { foreach (OrderLookupItemInfo info in selectedOptions) { OrderOptionInfo item = new OrderOptionInfo(); item.AdjustedPrice = 0M; if (info.AppendMoney.HasValue) { if (info.CalculateMode.Value == 1) { item.AdjustedPrice = info.AppendMoney.Value; } else { item.AdjustedPrice = orderInfo.GetDiscountedAmount() * (info.AppendMoney.Value / 100M); } } item.CustomerDescription = info.UserInputContent; item.CustomerTitle = info.UserInputTitle; item.ItemDescription = info.Name; OrderLookupListInfo orderLookupList = ShoppingProcessor.GetOrderLookupList(info.LookupListId); if (orderLookupList != null) { item.ListDescription = orderLookupList.Name; } item.LookupItemId = info.LookupItemId; item.LookupListId = info.LookupListId; item.OrderId = orderInfo.OrderId; orderInfo.OrderOptions.Add(item); } } }
public static bool UpdateOrderLookupList(OrderLookupListInfo orderLookupList) { Globals.EntityCoding(orderLookupList, true); return(SalesProvider.Instance().UpdateOrderLookupList(orderLookupList)); }
public abstract int AddOrderLookupList(OrderLookupListInfo orderLookupList);
public abstract bool UpdateOrderLookupList(OrderLookupListInfo orderLookupList);