Exemplo n.º 1
0
        public ActionResult Edit(long id)
        {
            var frm = formService.GetForm(id);

            if (frm != null)
            {
                var formViewModel = new FormViewModel();
                formViewModel.Id                  = frm.Id;
                formViewModel.FormName            = frm.FormName;
                formViewModel.Description         = frm.Description;
                formViewModel.ClosingDescription  = frm.ClosingDescription;
                formViewModel.EmailTo             = frm.EmailTo;
                formViewModel.EmailCc             = frm.EmailCc;
                formViewModel.EmailBcc            = frm.EmailBcc;
                formViewModel.FormFields          = frm.FormFields;
                formViewModel.GoogleAnalyticsCode = frm.GoogleAnalyticsCode;
                formViewModel.IsPublished         = frm.IsPublished;
                formViewModel.AddedBy             = frm.AddedBy;
                formViewModel.AddedDate           = frm.AddedDate;
                formViewModel.ModifiedBy          = frm.ModifiedBy;
                formViewModel.ModifiedDate        = frm.ModifiedDate;
                ViewBag.Forms      = new SelectList(formService.GetForms(), "Id", "FormName");
                ViewBag.FormFields = new SelectList(formFieldService.GetFormFields(), "Id", "Name");
                return(View(formViewModel));
            }
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        public IActionResult Create(long id)
        {
            FormFieldViewModel formFieldVM = new FormFieldViewModel();

            formFieldVM.FormId  = id;
            ViewBag.Forms       = new SelectList(formService.GetForms(), "Id", "FormName");
            ViewBag.FormFieldId = new SelectList(formFieldService.GetFormFields(), "Id", "Description");
            return(View(formFieldVM));
        }