예제 #1
0
        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();
        }
예제 #2
0
        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();
        }