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); }
public static string ConfigFilter(String formGuid) { FormState state = FormState.Approved; Range range = Range.Day; Show show = Show.five; if (HttpContext.Current.Session["State"] != null && !string.IsNullOrEmpty(HttpContext.Current.Session["State"].ToString())) state = (FormState)Enum.Parse(typeof(FormState), HttpContext.Current.Session["State"].ToString()); if (HttpContext.Current.Session["Range"] != null && !string.IsNullOrEmpty(HttpContext.Current.Session["Range"].ToString())) range = (Range)Enum.Parse(typeof(Range), HttpContext.Current.Session["Range"].ToString()); if (HttpContext.Current.Session["Show"] != null && !string.IsNullOrEmpty(HttpContext.Current.Session["Show"].ToString())) show = (Show)Enum.Parse(typeof(Show), HttpContext.Current.Session["Show"].ToString()); lecoati.uMobile.umComponents.Form form = new lecoati.uMobile.umComponents.Form(); form.primary = new Button("Refresh", new Call("ListRecord", new string[] { formGuid, "1" })); FormFieldset fieldSet = new FormFieldset(title: "Filter by"); form.AddFieldset(fieldSet); SelectField selectFilter = new SelectField("State", "State", state.ToString()); foreach (FormState stateIndex in Enum.GetValues(typeof(FormState))) selectFilter.AddOption(stateIndex.ToString(), stateIndex.ToString()); fieldSet.AddFormItem(selectFilter); SelectField selectRange = new SelectField("Range", "Range", range.ToString()); foreach (Range rangeIndex in Enum.GetValues(typeof(Range))) selectRange.AddOption(rangeIndex.ToString(), rangeIndex.ToString()); fieldSet.AddFormItem(selectRange); FormFieldset fieldSetEntries = new FormFieldset(title: "Entries"); form.AddFieldset(fieldSetEntries); SelectField selecShow = new SelectField("Show", "Show", ((int)show).ToString()); foreach (Show showIndex in Enum.GetValues(typeof(Show))) selecShow.AddOption(((int)showIndex).ToString(), showIndex.ToString()); fieldSetEntries.AddFormItem(selecShow); return form.UmGo(); }
public static string EmailRecordForm(String recordId) { TextField tFEmail = new TextField("email", "Email"); lecoati.uMobile.umComponents.Form form = new lecoati.uMobile.umComponents.Form(); form.primary = new Button("Send", new Call("EmailRecord", new string[] { recordId })); FormFieldset fieldSet = new FormFieldset(title: "Email record"); form.AddFieldset(fieldSet); fieldSet.AddFormItem(tFEmail); return form.UmGo(); }