Ejemplo n.º 1
0
        public FormOptionsSettingViewModel.FormOptionFieldLightListResult getNotifyFieldListResultByFormID(string formID)
        {
            FormOptionsSettingViewModel.FormOptionFieldLightListResult ret = new FormOptionsSettingViewModel.FormOptionFieldLightListResult();
            try {
                List <FormFieldsSetting> fields = this.formOptionSettingDao.getCustomNotifyFormFieldsSettingListByFormID(formID);
                foreach (var f in fields)
                {
                    ret.fields.Add(new FormOptionsSettingViewModel.FormOptionFieldLight()
                    {
                        fieldID   = f.id.ToString(),
                        fieldName = f.name,
                        key       = f.key,
                        formNo    = f.formID,
                        formOID   = f.formID,
                        type      = f.type,
                        extData1  = f.extData1,
                        extData2  = f.extData2,
                        options   = new List <FormOptionsSettingViewModel.FormOptionFieldOptionLight>()
                    });
                }
                ret.success    = true;
                ret.resultCode = "200";
                //ret.fields =
            } catch (Exception ex) {
                ret.success         = false;
                ret.resultException = ex.ToString();
                ret.resultCode      = "500";
            }

            return(ret);
        }
Ejemplo n.º 2
0
        public FormOptionsSettingViewModel.FormOptionFieldLightListResult getOptionFieldListResultByFormID(string formID)
        {
            FormOptionsSettingViewModel.FormOptionFieldLightListResult ret = new FormOptionsSettingViewModel.FormOptionFieldLightListResult();

            try {
                ret.success    = true;
                ret.resultCode = "200";

                List <FormFieldsSetting> fields = this.formOptionSettingDao.getCustomFormFieldsSettingListByFormID(formID);

                foreach (var f in fields)
                {
                    FormOptionsSettingViewModel.FormOptionFieldLight f_l = new FormOptionsSettingViewModel.FormOptionFieldLight()
                    {
                        fieldID   = f.id.ToString(),
                        fieldName = f.name,
                        key       = f.key,
                        formNo    = f.formID,
                        formOID   = f.formID,
                        type      = f.type,
                        extData1  = f.extData1,
                        extData2  = f.extData2,
                        options   = new List <FormOptionsSettingViewModel.FormOptionFieldOptionLight>()
                    };

                    //get options by fieldsID
                    List <FormOptionsSetting> options = this.formOptionSettingDao.getFormOptionsSettingListByFieldID(f.id);
                    foreach (var o in options)
                    {
                        FormOptionsSettingViewModel.FormOptionFieldOptionLight ol = new FormOptionsSettingViewModel.FormOptionFieldOptionLight()
                        {
                            needKeyIn = o.needKeyIn,
                            sort      = (o.sort.HasValue ? o.sort.Value : 0),
                            text      = o.text,
                            value     = o.value
                        };
                        f_l.options.Add(ol);
                    }
                    ret.fields.Add(f_l);
                }

                ret.count     = ret.fields.Count;
                ret.pageIndex = 1;
                ret.pageSize  = 1;
            } catch (Exception ex) {
                ret.success         = false;
                ret.resultCode      = "500";
                ret.resultException = ex.ToString();
            }


            return(ret);
        }
Ejemplo n.º 3
0
 public FormOptionsSettingViewModel.FormOptionFieldLightListResult getNotifyFormFieldListResult(string formID)
 {
     FormOptionsSettingViewModel.FormOptionFieldLightListResult ret = new FormOptionsSettingViewModel.FormOptionFieldLightListResult();
     ret = this.formOptionSvc.getNotifyFieldListResultByFormID(formID);
     return(ret);
 }