예제 #1
0
        //
        // GET: /Fields/
        public ActionResult MultiSelectTemplate(ClaimFieldTemplate claimField, FieldMode FieldMode)
        {
            ViewBag.FieldMode = FieldMode;
            var claimFieldTemplateController      = new Claims.Controllers.ClaimFieldTemplateController();
            ClaimFieldTemplate claimFieldTemplate = claimFieldTemplateController.GetClaimFieldTemplate((int)claimField.ClaimFieldTemplateID);

            if (claimFieldTemplate.MultiChoiceDefaultValue != null)
            {
                string[] multiChoiceDefaultValues = claimFieldTemplate.MultiChoiceDefaultValue.Split('\n');

                List <SelectListItem> list = new List <SelectListItem>();

                foreach (string choice in multiChoiceDefaultValues)
                {
                    SelectListItem selectListItem = new SelectListItem()
                    {
                        Text = choice, Value = choice
                    };

                    list.Add(selectListItem);
                }

                ViewBag.MultiChoiceList = list;
                ViewBag.claimField      = claimField;
            }
            return(View());
        }
예제 #2
0
        public ActionResult DropDownListTemplate(ClaimFieldTemplate claimFieldTemplate, ClaimField claimField)
        {
            Claims.Controllers.ClaimFieldTemplateController claimFieldTemplateController = new Claims.Controllers.ClaimFieldTemplateController();
            List <SelectListItem> list = new List <SelectListItem>();

            ViewBag.claimField = claimField;

            if (claimField != null || claimFieldTemplate != null)
            {
                if (claimField.ClaimFieldID > 0)
                {
                    claimFieldTemplate = claimFieldTemplateController.GetClaimFieldTemplate((int)claimField.ClaimFieldTemplateID);
                }

                list.Add(new SelectListItem()
                {
                    Text = " ", Value = ""
                });

                if (claimFieldTemplate.DropDownDefaultValue != null)
                {
                    string[] multiChoiceDefaultValues = claimFieldTemplate.DropDownDefaultValue.Split('\n');



                    foreach (string choice in multiChoiceDefaultValues)
                    {
                        SelectListItem selectListItem = new SelectListItem()
                        {
                            Text = choice, Value = choice
                        };

                        list.Add(selectListItem);
                    }
                }
            }
            ViewBag.claimFieldCode          = claimFieldTemplate.Code;
            ViewBag.claimFieldDropDownValue = claimFieldTemplate.DropDownDefaultValue;
            ViewBag.DropDownList            = list;
            return(View());
        }