Ejemplo n.º 1
0
        public static string ChangeOrderStatus(string storeId, string orderId)
        {
            Order order = TC.GetOrder(Convert.ToInt32(storeId), new Guid(orderId));
            Store store = TC.GetStore(Convert.ToInt32(storeId));

            Form orderForm = new Form();
            FormFieldset statusFieldset = new FormFieldset();
            orderForm.AddFieldset(statusFieldset);

            SelectField status = new SelectField("status", "Status", order.OrderStatusId.ToString());

            foreach (KeyValuePair<int, OrderStatus> orderStatus in TCExtensions.GetOrderStatuses()) {
                status.AddOption(orderStatus.Value.Name, orderStatus.Key.ToString());
            }

            statusFieldset.AddFormItem(status);

            orderForm.primary = new Button("Save", new Call("OrderSave", new string[] { order.StoreId.ToString(), order.Id.ToString() }));

            return orderForm.UmGo(order.OrderNumber);
        }