Example #1
0
    //add or edit
    protected void Button1_Click(object sender, EventArgs e)
    {
        DiyPageModel model = new DiyPageModel();

        model.PageName = txtPageName.Text;

        model.PageContents = txtcontents.Text;
        model.EditTime     = DateTime.Now;
        if (!String.IsNullOrEmpty(txtseotitle.Text))
        {
            model.SeoTitle = txtseotitle.Text;
        }
        else
        {
            model.SeoTitle = txtPageName.Text;
        }
        model.SeoKeyword     = txtkeyword.Text;
        model.SeoDescription = txtSeoDescription.Text;
        model.Px             = BasePage.GetRequestId(txtpx.Text);
        model.Tid            = BasePage.GetRequestId(ddltid.SelectedValue);
        model.PageType       = 0;
        model.PagePicUrl     = txtPicUrl.Text;

        model.PageContentsField = SetCheckedBox.GetChecked(this.txtpagecontentsfield, ",");

        model.id = id;
        if (id == 0)
        {
            if (!BasePage.ArrayExist(Cookies.GetCookie("ModelPower"), "91"))
            {
                BasePage.Alertback("您没有添加新单页的权限!");
                Response.End();
            }
            int i = new DiyPageBll().Add(model);
            if (i > 0)
            {
                BasePage.JscriptPrint(Page, "添加成功!", "DiyPage.aspx?tid=" + ddltid.SelectedValue);
            }
        }
        else
        {
            bool b = new DiyPageBll().Update(model);
            if (b)
            {
                BasePage.JscriptPrint(Page, "修改成功!", "DiyPage.aspx?tid=" + ddltid.SelectedValue);
            }
        }
    }
Example #2
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        bool b = false;

        foreach (RepeaterItem Item in Repeater2.Items)
        {
            TextBox      txtSeoTitle2       = (TextBox)Item.FindControl("txtSeoTitle2");
            TextBox      txtKeyWord2        = (TextBox)Item.FindControl("txtKeyWord2");
            TextBox      txtSeoDescription2 = (TextBox)Item.FindControl("txtSeoDescription2");
            HiddenField  txtid2             = (HiddenField)Item.FindControl("HiddenField2");
            DiyPageModel dm = new DiyPageModel();
            dm.SeoTitle       = txtSeoTitle2.Text;
            dm.SeoKeyword     = txtKeyWord2.Text;
            dm.SeoDescription = txtSeoDescription2.Text;
            dm.id             = int.Parse(txtid2.Value);
            b = new DiyPageBll().Updateseo(dm);
        }
        if (b)
        {
            BasePage.JscriptPrint(Page, "批量保存成功!", "SeoAll.aspx?action=" + Request.QueryString["action"]);
        }
    }
Example #3
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        DiyPageModel model = new DiyPageModel();

        model.PageName = txtpagename1.Text;
        model.PageType = 1;
        model.EditTime = DateTime.Now;
        int i = new DiyPageBll().Add(model);

        if (!BasePage.ArrayExist(Cookies.GetCookie("ModelPower"), "91"))
        {
            BasePage.Alertback("您没有添加新单页的权限!");
            Response.End();
        }
        else
        {
            if (i > 0)
            {
                BasePage.JscriptPrint(Page, "添加成功!", "DiyPage.aspx");
            }
        }
    }