Example #1
0
        public ActionResult AddSection(int pageId, IFormCollection collection)
        {
            var selectedValue = collection["selectedSection"];
            var page          = _webPageService.GetById(pageId);

            Section section = null;

            switch (selectedValue.ToString().ToLower())
            {
            case "html":
                section = new HtmlContentSection();
                break;

            case "contactform":
                section = new ContactFormSection {
                    EmailTo = "*****@*****.**"
                };
                break;

            case "resume":
                section = new WorkHistorySection {
                    ApplicationUserName = HttpContext.User.Identity.Name
                };
                break;
            }

            section.WebPage = page;
            _sectionService.Insert(section);


            return(Redirect(GetBasePath() + page.VirtualPath));
        }
Example #2
0
 public static WorkHistorySection ToEntity(this WorkHistorySectionModels model, WorkHistorySection destination)
 {
     return(model.MapTo(destination));
 }
Example #3
0
 public static WorkHistorySectionModels ToModel(this WorkHistorySection entity)
 {
     return(entity.MapTo <WorkHistorySection, WorkHistorySectionModels>());
 }