Example #1
0
        public async Task ShowImpl(String Base, String id, HttpResponseBase Response, Action <ExpandoObject> setParams, String suffix)
        {
            try
            {
                var url = $"/_attachment{Base}/{id}";
                var ai  = await _baseController.DownloadAttachment(url, setParams, suffix);

                if (ai == null)
                {
                    throw new RequestModelException($"Attachment not found. (Id:{id})");
                }
                Response.ContentType = ai.Mime;
                Response.BinaryWrite(ai.Stream);
            }
            catch (Exception ex)
            {
                _baseController.WriteHtmlException(ex, Response.Output);
            }
        }
Example #2
0
 public void Index()
 {
     try
     {
         Response.ContentType = "text/html";
         var prms = new Dictionary <String, String>
         {
             { "$(RootUrl)", RootUrl },
             { "$(HelpUrl)", _baseController.Host.HelpUrl },
             { "$(PersonName)", Server.HtmlEncode(User.Identity.GetUserPersonName()) },
             { "$(Theme)", _baseController.Host.Theme },
             { "$(Build)", _baseController.Host.AppBuild },
             { "$(Locale)", _baseController.CurrentLang },
             { "$(Minify)", _baseController.IsDebugConfiguration ? String.Empty : "min." },
             { "$(Description)", _baseController.Host.AppDescription }
         };
         _baseController.Layout(Response.Output, prms);
     }
     catch (Exception ex)
     {
         _baseController.WriteHtmlException(ex, Response.Output);
     }
 }
Example #3
0
 public void Index()
 {
     try
     {
         Response.ContentType = "text/html";
         var prms = new Dictionary <String, String>
         {
             { "$(RootUrl)", RootUrl },
             { "$(PersonName)", GetUserPersonName() },
             { "$(ClientId)", GetUserClientId() },
             { "$(CompanyButton)", GetCompanyButton() },
             { "$(Locale)", _baseController.CurrentLang },
             { "$(Minify)", _baseController.IsDebugConfiguration ? String.Empty : "min." }
         };
         _baseController.Layout(Response.Output, prms);
     }
     catch (Exception ex)
     {
         _baseController.WriteHtmlException(ex, Response.Output);
     }
 }