예제 #1
0
        public ActionResult GetTemplateDocuments()
        {
            //var domain = Request.Url.Host;
            //ErrorManager.WriteToErrorLog("FileUploadController", "Domain", domain);

            var model = new FileUploadViewModels.FileUploadViewModel();

            try
            {
                var mallar = _filesHelper.GetAllTemplateFiles().ToList();
                model.Mallar = ConvertFileInfoToVM(mallar);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                ErrorManager.WriteToErrorLog("FileUploadController", "GetTemplateDocuments", e.ToString(), e.HResult, User.Identity.Name);
                var errorModel = new CustomErrorPageModel
                {
                    Information  = "Ett fel inträffade vid hämtning av mallar.",
                    ContactEmail = ConfigurationManager.AppSettings["ContactEmail"],
                };
                return(View("CustomError", errorModel));
            }
            return(View("HandleTemplates", model));
        }