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)); }
public static WorkHistorySection ToEntity(this WorkHistorySectionModels model, WorkHistorySection destination) { return(model.MapTo(destination)); }
public static WorkHistorySectionModels ToModel(this WorkHistorySection entity) { return(entity.MapTo <WorkHistorySection, WorkHistorySectionModels>()); }