private void BindCancelStatusesDropDown() { ddlCancelStatus.DataSource = OrderStatusManager.GetOrderStatus(); ddlCancelStatus.DataBind(); if (ddlCancelStatus.Items.Count == 0) { ddlCancelStatus.Items.Clear(); ddlCancelStatus.Items.Add(new ListItem(Mediachase.Ibn.Web.UI.WebControls.UtilHelper.GetResFileString("{OrderStrings:RecurringPayment_Select_CancelStatus}"), "")); } }
/// <summary> /// Binds the root. /// </summary> private void BindRoot() { List <JsonTreeNode> nodes = new List <JsonTreeNode>(); nodes.Add(JsonTreeNode.CreateNode("OrderSearch", String.Empty, "Order Search", ModuleName, "OrderSearch-List", String.Empty, TreeListType.OrderSearch.ToString(), true)); // PurchaseOrders node JsonTreeNode poNode = JsonTreeNode.CreateNode("PurchaseOrders", String.Empty, "Purchase Orders", ModuleName, "Orders-List", String.Empty, TreeListType.PurchaseOrders.ToString()); poNode.icon = Mediachase.Commerce.Shared.CommerceHelper.GetAbsolutePath("~/Apps/Order/images/PurchaseOrders.png"); poNode.children = new List <JsonTreeNode>(); poNode.children.Add(JsonTreeNode.CreateNode("PO-TodayOrders", "Today", ModuleName, "Orders-List", "filter=today&class=PurchaseOrder", true)); poNode.children.Add(JsonTreeNode.CreateNode("PO-WeekOrders", "This Week", ModuleName, "Orders-List", "filter=thisweek&class=PurchaseOrder", true)); poNode.children.Add(JsonTreeNode.CreateNode("PO-MonthOrders", "This Month", ModuleName, "Orders-List", "filter=thismonth&class=PurchaseOrder", true)); poNode.children.Add(JsonTreeNode.CreateNode("PO-AllOrders", "All", ModuleName, "Orders-List", "filter=all&class=PurchaseOrder", true)); nodes.Add(poNode); // PurchaseOrdersByStatus node JsonTreeNode posNode = JsonTreeNode.CreateNode("PurchaseOrdersByStatus", String.Empty, "Purchase Orders By Status", ModuleName, "Orders-List", String.Empty, TreeListType.PurchaseOrdersByStatus.ToString()); posNode.children = new List <JsonTreeNode>(); OrderStatusDto statusDto = OrderStatusManager.GetOrderStatus(); foreach (OrderStatusDto.OrderStatusRow statusRow in statusDto.OrderStatus.Rows) { posNode.children.Add(JsonTreeNode.CreateNode("PO-Status-" + statusRow.OrderStatusId, statusRow.Name, ModuleName, "Orders-List", String.Format("status={0}", statusRow.Name), true)); } nodes.Add(posNode); // Carts node JsonTreeNode cartsNode = JsonTreeNode.CreateNode("Carts", "Carts", ModuleName, "Orders-List", "filter=all&class=ShoppingCart", false); cartsNode.children = new List <JsonTreeNode>(); cartsNode.children.Add(JsonTreeNode.CreateNode("CART-TodayOrders", "Today", ModuleName, "Orders-List", "filter=today&class=ShoppingCart", true)); cartsNode.children.Add(JsonTreeNode.CreateNode("CART-WeekOrders", "This Week", ModuleName, "Orders-List", "filter=thisweek&class=ShoppingCart", true)); cartsNode.children.Add(JsonTreeNode.CreateNode("CART-MonthOrders", "This Month", ModuleName, "Orders-List", "filter=thismonth&class=ShoppingCart", true)); cartsNode.children.Add(JsonTreeNode.CreateNode("CART-AllOrders", "All", ModuleName, "Orders-List", "filter=all&class=ShoppingCart", true)); nodes.Add(cartsNode); // PaymentPlans node JsonTreeNode ppNode = JsonTreeNode.CreateNode("PaymentPlans", "Payment Plans (recurring)", ModuleName, "Orders-List", "filter=all&class=PaymentPlan", false); ppNode.children = new List <JsonTreeNode>(); ppNode.children.Add(JsonTreeNode.CreateNode("PP-TodayOrders", "Today", ModuleName, "Orders-List", "filter=today&class=PaymentPlan", true)); ppNode.children.Add(JsonTreeNode.CreateNode("PP-WeekOrders", "This Week", ModuleName, "Orders-List", "filter=thisweek&class=PaymentPlan", true)); ppNode.children.Add(JsonTreeNode.CreateNode("PP-MonthOrders", "This Month", ModuleName, "Orders-List", "filter=thismonth&class=PaymentPlan", true)); ppNode.children.Add(JsonTreeNode.CreateNode("PP-AllOrders", "All", ModuleName, "Orders-List", "filter=all&class=PaymentPlan", true)); nodes.Add(ppNode); WriteArray(nodes); }
/// <summary> /// Binds the purchase orders by status. /// </summary> private void BindPurchaseOrdersByStatus() { List <JsonTreeNode> nodes = new List <JsonTreeNode>(); // PurchaseOrdersByStatus node OrderStatusDto statusDto = OrderStatusManager.GetOrderStatus(); foreach (OrderStatusDto.OrderStatusRow statusRow in statusDto.OrderStatus.Rows) { nodes.Add(JsonTreeNode.CreateNode("PO-Status-" + statusRow.OrderStatusId, statusRow.Name, ModuleName, "Orders-List", String.Format("status={0}", statusRow.Name), true)); } WriteArray(nodes); }
/// <summary> /// Loads the data and data bind. /// </summary> private void LoadDataAndDataBind() { OrderStatusDto statusDto = OrderStatusManager.GetOrderStatus(); OrderStatus.DataValueField = "Name"; OrderStatus.DataSource = statusDto.OrderStatus; OrderStatus.DataBind(); OrderStatus.Items.Insert(0, new ListItem("any", "")); DataRange.Items.Clear(); DataRange.Items.Add(new ListItem(SharedStrings.All, "")); DataRange.Items.Add(new ListItem(SharedStrings.Today, "today")); DataRange.Items.Add(new ListItem(SharedStrings.This_Week, "thisweek")); DataRange.Items.Add(new ListItem(SharedStrings.This_Month, "thismonth")); StringBuilder script = new StringBuilder("this.disabled = true;\r\n"); script.AppendFormat("__doPostBack('{0}', '');", btnSearch.UniqueID); btnSearch.OnClientClick = script.ToString(); }
/// <summary> /// Binds the form. /// </summary> private void BindForm() { /* * WorkflowList.DataSource = WorkflowConfiguration.Instance.Workflows; * WorkflowList.DataBind(); * */ // Bind Status OrderStatusList.DataSource = OrderStatusManager.GetOrderStatus(); OrderStatusList.DataBind(); // Bind Currency OrderCurrencyList.DataSource = CatalogContext.Current.GetCurrencyDto(); OrderCurrencyList.DataBind(); OrderGroup order = _order; if (order != null) { LoadAddresses(); ComboBoxItem item = CustomerName.Items.FindByValue(order.CustomerId.ToString()); if (item != null) { CustomerName.SelectedItem = item; } else { ComboBoxItem newItem = new ComboBoxItem(); newItem.Text = order.CustomerName; newItem.Value = order.CustomerId.ToString(); CustomerName.Items.Add(newItem); CustomerName.SelectedItem = newItem; } CustomerName.Text = order.CustomerName; //TrackingNo.Text = order.TrackingNumber; OrderSubTotal.Text = CurrencyFormatter.FormatCurrency(order.SubTotal, order.BillingCurrency); OrderTaxTotal.Text = CurrencyFormatter.FormatCurrency(order.TaxTotal, order.BillingCurrency); OrderShippingTotal.Text = CurrencyFormatter.FormatCurrency(order.ShippingTotal, order.BillingCurrency); OrderHandlingTotal.Text = CurrencyFormatter.FormatCurrency(order.HandlingTotal, order.BillingCurrency); OrderTotal.Text = CurrencyFormatter.FormatCurrency(order.Total, order.BillingCurrency); //OrderExpires.Value = order.ExpirationDate; if (_order.OrderForms.Count > 0) { if (AddressesList.Items.Count > 0) { ManagementHelper.SelectListItem(AddressesList, _order.OrderForms[0].BillingAddressId); } DiscountTotal.Text = CurrencyFormatter.FormatCurrency(order.OrderForms[0].DiscountAmount, order.BillingCurrency); } ManagementHelper.SelectListItem(OrderStatusList, order.Status); ManagementHelper.SelectListItem(OrderCurrencyList, order.BillingCurrency); /* * if (po.Status == OrderConfiguration.Instance.NewOrderStatus) * { * WorkflowDisabledDescription.Visible = false; * RunWorkflowButton.Enabled = true; * } * else * { * RunWorkflowButton.Enabled = false; * WorkflowDisabledDescription.Visible = true; * WorkflowDisabledDescription.Text = String.Format("Can only run workflow for orders with \"{0}\" status", OrderConfiguration.Instance.NewOrderStatus); * } * */ } else { ManagementHelper.SelectListItem(OrderCurrencyList, CommonSettingsManager.GetDefaultCurrency()); } }