public static BL.Models.DocumentTemplate ConvertToBlModel(DocumentTemplate template)
        {
            Mapper.CreateMap<DocumentTemplate, BL.Models.DocumentTemplate>();
            Mapper.CreateMap<Models.DocumentType, DocumentType>();

            return Mapper.Map<DocumentTemplate, BL.Models.DocumentTemplate>(template);
        }
        public ActionResult ConvertView(DocumentTemplate template)
        {
            var userName = new MainController().GetUserName();

            var newTemplate =
                new HtmlDocumentHandler(userName)
                    .ConvertView(DocumentTemplateController.ConvertToBlModel(template));

            return View(DocumentTemplateController.ConvertToModel(newTemplate));
        }
        public ActionResult ConvertView(DocumentTemplate template)
        {
            _documentRepositoryHandler =
                new HtmlDocumentHandler(GetUserName());
            DocumentTemplate newTemplate = null;
            if (template.Text != null)
            {
                newTemplate = ConvertToModel
                    (_documentRepositoryHandler.ConvertView(ConvertToBlModel(template)));
            }

            return View("Preview", newTemplate);
        }
 public ActionResult Convert(DocumentTemplate template)
 {
     template.Text = ReplaceBy(template.Text, BuildDictionary());
     return View(template);
 }
 public ActionResult EditTemplate(DocumentTemplate template)
 {
     _templatesHandler.Update(ConvertToBlModel(template));
     return RedirectToAction("DocumentTemplates");
 }