Beispiel #1
0
 private static BaseReadOnlyModel GetSectionModel(Section entity, int languageId)
 {
     if (entity is HtmlContentSection)
     {
         var htmlContent = new HtmlContentSectionReadOnlyModel();
         htmlContent.Html       = ((HtmlContentSection)entity).GetLocalized(x => x.Html, languageId);
         htmlContent.Controller = "HtmlContent";
         return(htmlContent);
     }
     else if (entity is ContactFormSection)
     {
         var contactForm = new ContactFormSectionReadOnlyModel();
         contactForm.IntroText       = ((ContactFormSection)entity).IntroText;
         contactForm.NameEnabled     = ((ContactFormSection)entity).NameEnabled;
         contactForm.ExtendedEnabled = ((ContactFormSection)entity).ExtendedEnabled;
         contactForm.Controller      = "ContactForm";
         return(contactForm);
     }
     else if (entity is ResumeSection)
     {
         var resume = new ResumeSectionReadOnlyModel();
         resume.ApplicationUserName = ((ResumeSection)entity).ApplicationUserName;
         resume.Controller          = "Resume";
         return(resume);
     }
     return(null);
 }
Beispiel #2
0
 private static BaseReadOnlyModel GetSectionModel(Section entity)
 {
     if (entity is HtmlContentSection)
     {
         var htmlContent = new HtmlContentSectionReadOnlyModel();
         htmlContent.Html       = ((HtmlContentSection)entity).GetLocalized(x => x.Html);
         htmlContent.Controller = "HtmlContent";
         return(htmlContent);
     }
     else if (entity is WorkHistorySection)
     {
         var resume = new WorkHistorySectionReadOnlyModel();
         resume.ApplicationUserName = ((WorkHistorySection)entity).ApplicationUserName;
         resume.Controller          = "WorkHistory";
         return(resume);
     }
     return(null);
 }
 public ActionResult ReadOnly(HtmlContentSectionReadOnlyModel model)
 {
     return(PartialView("ReadOnly", model));
 }