public ActionResult FormFields(Guid id)
        {
            List<ViewModels.Forms.FormFieldMatterViewModel> vmList = new List<ViewModels.Forms.FormFieldMatterViewModel>();
            Common.Models.Matters.Matter matter;

            using (IDbConnection conn = Data.Database.Instance.GetConnection())
            {
                matter = Data.Matters.Matter.Get(id, conn, false);
                ViewBag.Matter = matter.Title;
                ViewBag.MatterId = matter.Id;

                Data.Forms.FormFieldMatter.ListForMatter(id, conn, false).ForEach(x =>
                {
                    ViewModels.Forms.FormFieldMatterViewModel vm = new ViewModels.Forms.FormFieldMatterViewModel();
                    x.FormField = Data.Forms.FormField.Get(x.FormField.Id.Value, conn, false);
                    if (x.Matter != null)
                        vm = Mapper.Map<ViewModels.Forms.FormFieldMatterViewModel>(x);
                    else
                        vm = new ViewModels.Forms.FormFieldMatterViewModel();
                    vm.FormField = Mapper.Map<ViewModels.Forms.FormFieldViewModel>(x.FormField);
                    vmList.Add(vm);
                });
            }

            return View(vmList);
        }
        public ActionResult FormFields(Guid id)
        {
            List<ViewModels.Forms.FormFieldMatterViewModel> vmList = new List<ViewModels.Forms.FormFieldMatterViewModel>();
            Common.Models.Matters.Matter matter;

            matter = Data.Matters.Matter.Get(id);
            ViewData["Matter"] = matter.Title;
            ViewData["MatterId"] = matter.Id;

            Data.Forms.FormFieldMatter.ListForMatter(id).ForEach(x =>
            {
                ViewModels.Forms.FormFieldMatterViewModel vm = new ViewModels.Forms.FormFieldMatterViewModel();
                x.FormField = Data.Forms.FormField.Get(x.FormField.Id.Value);
                if (x.Matter != null)
                    vm = Mapper.Map<ViewModels.Forms.FormFieldMatterViewModel>(x);
                else
                    vm = new ViewModels.Forms.FormFieldMatterViewModel();
                vm.FormField = Mapper.Map<ViewModels.Forms.FormFieldViewModel>(x.FormField);
                vmList.Add(vm);
            });

            return View(vmList);
        }