コード例 #1
0
ファイル: Default.ascx.cs プロジェクト: liqueflies/pigeoncms
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        //rempoved 20130610 OnClientClick="MyObject.UpdateEditorFormValue();"
        LblErr.Text = "";
        LblOk.Text = "";

        try
        {
            Placeholder p1 = new Placeholder();
            if (TxtId.Text == string.Empty)
            {
                form2obj(p1);
                p1 = new PlaceholdersManager().Insert(p1);
            }
            else
            {
                p1 = new PlaceholdersManager().GetByName(TxtName.Text);//precarico i campi esistenti e nn gestiti dal form
                form2obj(p1);
                new PlaceholdersManager().Update(p1);
            }
            new CacheManager<Placeholder>("PigeonCms.Placeholder").Remove(p1.Name);

            Grid1.DataBind();
            LblOk.Text = RenderSuccess(Utility.GetLabel("RECORD_SAVED_MSG"));
            MultiView1.ActiveViewIndex = 0;
        }
        catch (Exception e1)
        {
            LblErr.Text = RenderError(Utility.GetLabel("RECORD_ERR_MSG") + "<br />" + e1.ToString());
        }
        finally
        {
        }
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        var obj1 = new PigeonCms.Placeholder();
        var cache = new CacheManager<PigeonCms.Placeholder>("PigeonCms.Placeholder");
        if (cache.IsEmpty(this.Name))
        {
            obj1 = new PlaceholdersManager().GetByName(this.Name);
            cache.Insert(this.Name, obj1);
        }
        else
        {
            obj1 = cache.GetValue(this.Name);
        }

        LitContent.Text = "";
        if (obj1.Visible)
        {
            LitContent.Text = obj1.Content;
        }
    }
コード例 #3
0
ファイル: Default.ascx.cs プロジェクト: liqueflies/pigeoncms
    private void edit(string name)
    {
        LblOk.Text = "";
        LblErr.Text = "";

        TxtName.Text = name;
        TxtName.Enabled = true;
        ChkVisibile.Checked = true;
        TxtId.Text = "";
        TxtContent.Text = "";
        if (name != "")
        {
            TxtId.Text = "1";
            TxtName.Enabled = false;
            Placeholder currObj = new Placeholder();
            currObj = new PlaceholdersManager().GetByName(name);
            obj2form(currObj);
        }
        MultiView1.ActiveViewIndex = 1;
    }