Beispiel #1
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        int index = Convert.ToInt32(e.CommandArgument);

        //apply
        if (e.CommandName == "_apply")
        {
            MojoCube.Web.Site.Config config = new MojoCube.Web.Site.Config();
            config.GetData(1, MojoCube.Api.UI.Language.GetLanguage());

            config.SiteTheme = ((Label)GridView1.Rows[index].FindControl("lblFileName")).Text;
            config.UpdateData(config.pk_Config);

            AlertDiv.InnerHtml = MojoCube.Web.String.ShowAlert("success", "主题已修改成功");
        }
        //delete
        if (e.CommandName == "_delete")
        {
            string fileName = ((Label)GridView1.Rows[index].FindControl("lblFileName")).Text;
            bool   IsDelete = MojoCube.Api.File.IO.DeleteDirectory(Server.MapPath("../../Themes/" + fileName));
            if (IsDelete)
            {
                AlertDiv.InnerHtml = MojoCube.Web.String.ShowAlert("success", "主题已删除成功");
            }
            else
            {
                AlertDiv.InnerHtml = MojoCube.Web.String.ShowAlert("danger", "主题已删除失败");
            }
        }

        MojoCube.Web.Site.Cache cache = new MojoCube.Web.Site.Cache();
        cache.RemoveAllCache();
        GridBind();
    }
Beispiel #2
0
    protected void lnbDelAll_Click(object sender, EventArgs e)
    {
        HttpContext.Current.Session.Remove("MojoCube_Language");
        HttpContext.Current.Response.Cookies["MojoCube_Language"].Expires = DateTime.Now.AddDays(-1);

        MojoCube.Web.Site.Cache cache = new MojoCube.Web.Site.Cache();
        cache.RemoveAllCache();
        GridBind();
    }
Beispiel #3
0
    private void GridBind()
    {
        MojoCube.Web.Site.Cache cache = new MojoCube.Web.Site.Cache();
        DataSet ds = new DataSet();

        ds = cache.GetCacheDS();

        DataTable dt = new DataTable();

        dt = ds.Tables[0];
        dt.DefaultView.Sort = "CacheKey ASC";

        GridView1.DataSource = dt;
        GridView1.DataBind();
    }