Example #1
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        WebConfigModel wm = new WebConfigModel();

        wm.SiteName    = txtSiteName.Text;
        wm.SiteTitle   = txtsitetitle.Text;
        wm.SiteTitleEn = txtsitetitleen.Text;
        wm.SiteUrl     = txtSiteUrl.Text;
        wm.SiteICP     = txticp.Text;

        wm.SiteKeyword       = txtSiteKeyword.Text;
        wm.SiteKeywordEn     = txtSiteKeyworden.Text;
        wm.SiteDescription   = txtSiteDescription.Text;
        wm.SiteDescriptionEn = txtSiteDescriptionen.Text;
        wm.EmailSMTP         = txtEmailsmtp.Text;
        wm.EmailName         = txtSmtpName.Text;
        wm.EmailPassword     = txtSmtpPassword.Text;
        wm.Sitecnzz          = txtsitecnzz.Text;
        wm.SiteMail          = txtsiteemail.Text;
        wm.SiteFax           = txtfax.Text;
        wm.SiteTel           = txttel.Text;
        wm.SiteQQ            = txtqq.Text;
        wm.SiteAddress       = txtaddress.Text;
        wm.Other             = txtother.Text;
        //0基本配置,1留言内容,2留言列表,3单页勾选显示
        wm.SiteConfig = SetCheckedBox.GetChecked(this.CheckBoxList1, ",") + "|" + SetCheckedBox.GetChecked(this.CheckBoxList2, ",") + "|" + SetCheckedBox.GetChecked(this.CheckBoxList3, ",") + "|" + RadioButtonList1.SelectedValue;
        wm.id         = 1;

        bool b = new WebConfigBll().Update(wm);

        if (b)
        {
            BasePage.JscriptPrint(Page, "更新成功!", "WebConfig.aspx");
        }
    }
Example #2
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 #3
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        int id = BasePage.GetRequestId(Request.QueryString["id"]);

        ModelModel model = new ModelModel();

        model.ModelName       = txtModelName.Text;
        model.ModelTable      = txtModelTable.Text;
        model.ItemName        = txtItemName.Text;
        model.ItemUnit        = txtItemUnit.Text;
        model.ModelClassLayer = BasePage.GetRequestId(txtclassnum.Text);
        model.ModelLock       = int.Parse(RaModelLock.SelectedValue);
        StringBuilder modelcontents = new StringBuilder();
        string        tipstxt       = txt0.Text + "|" + txt1.Text + "|" + txt2.Text + "|" + txt3.Text + "|" + txt4.Text + "|" + txt5.Text + "|" + txt6.Text + "|" + txt7.Text + "|" + txt8.Text + "|" + txt9.Text + "|" + txt10.Text + "|";

        if (DrModelType.SelectedValue == "0")//文章模型
        {
            //0模型内容可选字段`1模型栏目可选字段`2内容字段名称`3模型列表可选字段`4提示语`5发表审核选择
            //tips提示语
            tipstxt += txta11.Text;
            modelcontents.Append(SetCheckedBox.GetChecked(this.txtModeContent, ",") + "`" + SetCheckedBox.GetChecked(this.txtmodelcheckclass, ",") + "`" + txt25.Text + "`" + SetCheckedBox.GetChecked(this.txtchecklist, ",") + "`" + tipstxt + "`" + ddlsendsh.SelectedValue);
        }
        else
        {
            // 0模型内容可选字段`1模型栏目可选字段`2内容字段名称`3模型列表可选字段`4提示语`5发表审核选择
            tipstxt += txtp11.Text + "|" + txtp12.Text + "|" + txtp13.Text + "|" + txtp14.Text + "|" + txtp15.Text;
            modelcontents.Append(SetCheckedBox.GetChecked(this.txtModeContent2, ",") + "`" + SetCheckedBox.GetChecked(this.txtmodelcheckclass, ",") + "`" + txt26.Text + "`" + SetCheckedBox.GetChecked(this.txtchecklist, ",") + "`" + tipstxt + "`" + ddlsendsh.SelectedValue);
        }
        model.ModeContent = modelcontents.ToString();
        model.ModelType   = BasePage.GetRequestId(DrModelType.SelectedValue);
        model.id          = id;



        if (id != 0)
        {
            bool b = new ModelBll().Update(model);
            if (b)
            {
                BasePage.JscriptPrint(Page, "模型修改成功!", "Model.aspx");
            }
        }
        else
        {
            bool b1 = new ModelBll().ExistsName(txtModelTable.Text, "ModelTable");
            if (b1)
            {
                BasePage.JscriptPrint(Page, "数据表名不能重复!", "##");
            }
            else
            {
                // bool jj = false;
                //创建数据表
                if ((DbHelperSQL.TabExists(txtModelTable.Text)))
                {
                    BasePage.JscriptPrint(Page, "添加失败,存在同名数据表!", "##");
                    return;
                }
                else
                {
                    string data = "GL_Article";
                    if (DrModelType.SelectedValue == "1")//产品模型
                    {
                        data = "GL_Products";
                    }
                    //复制表(只复制结构)
                    // string strsql = "select * into " + txtModelTable.Text + " from " + data + " where 1<>1";
                    string strsql = "CREATE TABLE " + txtModelTable.Text + " LIKE " + data + "";
                    object obj    = DbHelperSQL.GetSingle(strsql.ToString());
                }
                int i = new ModelBll().Add(model);
                if (i > 0)
                {
                    BasePage.JscriptPrint(Page, "模型添加成功!", "Model.aspx");
                }
            }
        }
    }