Пример #1
0
    public static void SetCultureInfo(string CultureCode)
    {
        AppErazer.ClearSysCache();
        PageBase.SetCultureInfo(CultureCode, CultureCode);

        HttpContext.Current.Session["IsCultureChange"] = 1;
    }
Пример #2
0
    private static void ClearOptimizationCache(int PortalID)
    {
        AppErazer.ClearSysHash(ApplicationKeys.ActivePagePreset + "_" + PortalID);
        AppErazer.ClearSysHash(ApplicationKeys.ActiveTemplate + "_" + PortalID);
        AppErazer.ClearSysHash(ApplicationKeys.ActivePagePreset + "_" + PortalID);
        AppErazer.ClearSysCache();
        string optimized_path = HttpContext.Current.Server.MapPath(SageFrameConstants.OptimizedResourcePath);

        IOHelper.DeleteDirectoryFiles(optimized_path, ".js,.css");
        if (File.Exists(HttpContext.Current.Server.MapPath(SageFrameConstants.OptimizedCssMap)))
        {
            SageFrame.Web.XmlHelper.DeleteNodes(HttpContext.Current.Server.MapPath(SageFrameConstants.OptimizedCssMap), "resourcemap/resourcemap");
        }
        if (File.Exists(HttpContext.Current.Server.MapPath(SageFrameConstants.OptimizedJsMap)))
        {
            SageFrame.Web.XmlHelper.DeleteNodes(HttpContext.Current.Server.MapPath(SageFrameConstants.OptimizedJsMap), "resourcemap/resourcemap");
        }
    }
 protected void imgSave_Click(object sender, ImageClickEventArgs e)
 {
     try
     {
         bool status = false;
         foreach (GridViewRow row in gdvPortal.Rows)
         {
             LinkButton lnkPortal = row.FindControl("lnkUsername") as LinkButton;
             if (gdvPortal.DataKeys[row.RowIndex]["PortalID"].ToString() != hdnPortalIndex.Value)
             {
                 if (lnkPortal.Text.ToLower().Equals(txtPortalName.Text.ToLower()))
                 {
                     status = true;
                 }
             }
         }
         if (!(string.IsNullOrEmpty(txtPortalName.Text)))
         {
             if (!status)
             {
                 SaveProtal();
                 BindPortalSetting();
                 HttpRuntime.Cache.Remove(CacheKeys.Portals);
                 SageFrameConfig sf = new SageFrameConfig();
                 sf.ResetSettingKeys(int.Parse(this.hdnPortalID.Value.ToString()));
                 HttpContext.Current.Session.Remove(SessionKeys.SageFrame_PortalSEOName);
                 AppErazer.ClearSysCache();
                 BindPortal();
                 BindSitePortal();
                 PanelVisibility(false, true);
                 Redirect(GetPortalID);
             }
             else
             {
                 ShowMessage("", GetSageMessage("PortalSettings", "PortalAlreadyExists"), "", SageMessageType.Alert);
             }
         }
     }
     catch (Exception ex)
     {
         ProcessException(ex);
     }
 }