Example #1
0
        public FormOptionsSettingViewModel.FormOptionsListResult getFormOptionListResult(FormOptionsSettingViewModel.FormOptionsQueryParameter param)
        {
            FormOptionsSettingViewModel.FormOptionsListResult ret = new FormOptionsSettingViewModel.FormOptionsListResult();

            try {
                var list_ret = this.formOptionSettingDao.getFormOptionsSettingList(param);

                ret.success    = true;
                ret.list       = list_ret.Item1;
                ret.count      = list_ret.Item2;
                ret.resultCode = "200";
            } catch (Exception ex) {
                ret.success         = false;
                ret.resultCode      = "500";
                ret.resultException = ex.ToString();
            }

            return(ret);
        }
        protected void reload_options_list()
        {
            var select_value = this.ddl_fields.SelectedValue;

            if (string.IsNullOrEmpty(select_value))
            {
                this.rpt_formOption_list.DataSource = new List <FormOptionSetting>();
                this.rpt_formOption_list.DataBind();
                this.hid_select_field_type.Value = "";
                return;
            }
            var fields = this.formOptionSettingSvc.getFormOptionList().FirstOrDefault(x => x.formNo == this.ddl_forms.SelectedValue).fields;

            var f = fields.FirstOrDefault(x => x.fieldID == select_value);

            this.hid_select_field_type.Value = f.type;

            FormOptionsSettingViewModel.FormOptionsQueryParameter param = new FormOptionsSettingViewModel.FormOptionsQueryParameter()
            {
                desc       = false,
                fieldID    = select_value,
                formNo     = "",
                formOID    = "",
                orderField = "",
                pageIndex  = 0,
                pageSize   = 0
            };

            FormOptionsSettingViewModel.FormOptionsListResult ret = this.formOptionSettingSvc.getFormOptionListResult(param);

            if (ret.success)
            {
                this.options_list_index             = 1;
                this.rpt_formOption_list.DataSource = ret.list;
                this.rpt_formOption_list.DataBind();
            }
            return;
        }