public IActionResult ValueEditPopup(string btnId, string formId, string form, string aId, InteractiveFormAttributeValueModel model)
        {
            var fo = _interactiveFormService.GetFormById(form);

            if (fo == null)
            {
                return(RedirectToAction("List"));
            }
            var attribute = fo.FormAttributes.FirstOrDefault(x => x.Id == aId);

            if (attribute == null)
            {
                return(RedirectToAction("List"));
            }

            var vaf = attribute.FormAttributeValues.Where(x => x.Id == model.Id).FirstOrDefault();

            if (vaf == null)
            {
                return(RedirectToAction("List"));
            }

            if (ModelState.IsValid)
            {
                vaf = model.ToEntity();
                _interactiveFormService.UpdateForm(fo);
                _customerActivityService.InsertActivity("InteractiveFormEdit", vaf.Id, _localizationService.GetResource("ActivityLog.InteractiveFormUpdateAttributeValue"), vaf.Name);
                ViewBag.RefreshPage = true;
                ViewBag.btnId       = btnId;
                ViewBag.formId      = formId;
                return(View(model));
            }

            return(View(model));
        }
        public async Task <IActionResult> ValueCreatePopup(string btnId, string formId, string form, string aId, InteractiveFormAttributeValueModel model)
        {
            var fo = await _interactiveFormService.GetFormById(form);

            if (fo == null)
            {
                return(RedirectToAction("List"));
            }
            var attribute = fo.FormAttributes.FirstOrDefault(x => x.Id == aId);

            if (attribute == null)
            {
                return(RedirectToAction("List"));
            }

            if (ModelState.IsValid)
            {
                var vaf = model.ToEntity();
                attribute.FormAttributeValues.Add(vaf);
                await _interactiveFormService.UpdateForm(fo);

                await _customerActivityService.InsertActivity("InteractiveFormEdit", vaf.Id, _translationService.GetResource("ActivityLog.InteractiveFormAddAttributeValue"), vaf.Name);

                ViewBag.RefreshPage = true;
                ViewBag.btnId       = btnId;
                ViewBag.formId      = formId;
                return(View(model));
            }

            return(View(model));
        }