Exemplo n.º 1
0
        public ActionResult Edit(int?id = null)
        {
            var vm = id.HasValue
                ? Mapper.Map <EditFormViewModel>(_formFieldService.Get(id.Value))
                : new EditFormViewModel();

            vm.Fields = ViewModelHelper.CreateFieldsListViewModel(_fieldService);
            return(View(vm));
        }
Exemplo n.º 2
0
        public ActionResult Form(int formId)
        {
            var form = _formFieldService.Get(formId);

            var userInfo = new UserInfo();

            var vm = new PreviewFormViewModel <UserInfo> {
                Form = form, Data = userInfo
            };

            return(View(vm));
        }