Esempio n. 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");
        }
    }
Esempio n. 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);
            }
        }
    }
Esempio n. 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            string txtAction  = "";
            string checklogin = new AdminBll().CheckLogin("1");
            if (checklogin != "true")
            {
                BasePage.Alertback(checklogin);
                Response.End();
            }

            int id = BasePage.GetRequestId(Request.QueryString["id"]);

            string type = Request.QueryString["type"];
            DrModelType.SelectedValue = type;
            if (type == "1")
            {
                modeltype = true;//产品模型
            }

            if (id != 0)
            {
                txtAction       = "修改模型信息";
                txtAction2.Text = "修改模型信息";
                Button1.Text    = "确认修改";
                ModelModel model = new ModelBll().GetModel(id);
                txtModelName.Text         = model.ModelName;
                txtModelTable.Text        = model.ModelTable;
                txtModelTable.Enabled     = false;
                txtItemName.Text          = model.ItemName;
                txtItemUnit.Text          = model.ItemUnit;
                RaModelLock.SelectedValue = model.ModelLock.ToString();
                DrModelType.SelectedValue = model.ModelType.ToString();
                txtclassnum.Text          = model.ModelClassLayer.ToString();
                if (model.ModelType == 1)//0文章1产品
                {
                    modeltype = true;
                }
                DrModelType.Enabled = false;
                if (!String.IsNullOrEmpty(model.ModeContent))
                {
                    //0模型内容可选字段`1模型栏目可选字段`2内容字段名称`3模型列表可选字段`4提示语`5发表审核选择
                    string[] aa   = model.ModeContent.Split('`');
                    string[] tips = aa[4].Split('|');
                    txt0.Text  = tips[0];
                    txt1.Text  = tips[1];
                    txt2.Text  = tips[2];
                    txt3.Text  = tips[3];
                    txt4.Text  = tips[4];
                    txt5.Text  = tips[5];
                    txt6.Text  = tips[6];
                    txt7.Text  = tips[7];
                    txt8.Text  = tips[8];
                    txt9.Text  = tips[9];
                    txt10.Text = tips[10];
                    if (!modeltype)                                                    //文章模型
                    {
                        SetCheckedBox.SetChecked(this.txtModeContent, aa[0], ",");     //模型内容可选
                        SetCheckedBox.SetChecked(this.txtmodelcheckclass, aa[1], ","); //栏目可选
                        txt25.Text = aa[2];
                        SetCheckedBox.SetChecked(this.txtchecklist, aa[3], ",");       //模型列表可选
                        txta11.Text             = tips[11];
                        ddlsendsh.SelectedValue = aa[5].ToString();
                    }
                    else
                    {                                                                  //0模型内容可选字段`1模型栏目可选字段`2内容字段名称`3模型列表可选字段`4提示语`5发表审核选择
                        SetCheckedBox.SetChecked(this.txtModeContent2, aa[0], ",");    //模型内容可选
                        SetCheckedBox.SetChecked(this.txtmodelcheckclass, aa[1], ","); //栏目可选
                        txt26.Text = aa[2];
                        SetCheckedBox.SetChecked(this.txtchecklist, aa[3], ",");       //模型列表可选

                        txtp11.Text             = tips[11];
                        txtp12.Text             = tips[12];
                        txtp13.Text             = tips[13];
                        txtp14.Text             = tips[14];
                        txtp15.Text             = tips[15];
                        ddlsendsh.SelectedValue = aa[5].ToString();
                    }
                }
            }
            else
            {
                txtAction       = "添加新模型";
                txtAction2.Text = "添加新模型";
            }

            ((Literal)Master.FindControl("breadcrumbs")).Text = "<span class=\"home\"></span>" + txtAction;
        }
    }
Esempio n. 4
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");
                }
            }
        }
    }
Esempio n. 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        shsiteconfig.Visible = false;

        if (!Page.IsPostBack)
        {
            ((Literal)Master.FindControl("breadcrumbs")).Text = "<span class=\"home\">系统基本设置</span>";
            string checklogin = new AdminBll().CheckLogin("0");
            if (checklogin != "true")
            {
                BasePage.Alertback(checklogin);
                Response.End();
            }
            if (BasePage.ArrayExist(Cookies.GetCookie("ModelPower"), "6"))
            {
                shsiteconfig.Visible = true;
            }
            WebConfigModel wm = new WebConfigBll().GetModel(1);
            txtSiteName.Text    = wm.SiteName;
            txtsitetitle.Text   = wm.SiteTitle;
            txtsitetitleen.Text = wm.SiteTitleEn;
            txtSiteUrl.Text     = wm.SiteUrl;
            txticp.Text         = wm.SiteICP;

            txtSiteKeyword.Text       = wm.SiteKeyword;
            txtSiteKeyworden.Text     = wm.SiteKeywordEn;
            txtSiteDescription.Text   = wm.SiteDescription;
            txtSiteDescriptionen.Text = wm.SiteDescriptionEn;
            txtsiteemail.Text         = wm.SiteMail;
            txtEmailsmtp.Text         = wm.EmailSMTP;
            txtSmtpName.Text          = wm.EmailName;
            txtsitecnzz.Text          = wm.Sitecnzz;
            txtfax.Text     = wm.SiteFax;
            txttel.Text     = wm.SiteTel;
            txtaddress.Text = wm.SiteAddress;
            txtqq.Text      = wm.SiteQQ;
            txtaddress.Text = wm.SiteAddress;
            txtother.Text   = wm.Other;
            txtSmtpPassword.Attributes.Add("value", wm.EmailPassword);
            txtidnum.Text = BasePage.SiteId();
            if (!String.IsNullOrEmpty(wm.SiteConfig))
            {
                string   siteconfig = wm.SiteConfig;
                string[] a          = siteconfig.Split('|');
                if (a.Length > 0)
                {
                    SetCheckedBox.SetChecked(this.CheckBoxList1, a[0], ","); //基本配置
                    SetCheckedBox.SetChecked(this.CheckBoxList2, a[1], ","); //留言内容
                    SetCheckedBox.SetChecked(this.CheckBoxList3, a[2], ","); //留言列表
                    RadioButtonList1.SelectedValue = a[3];                   //单页显示可选
                    showhide = a[0];
                }
            }
            //序列号
            //string word = GreateFiles.Read_File(Server.MapPath("~/id.txt"));
            //if (!String.IsNullOrEmpty(word))
            //{
            //    txtidnum.Text = word.Trim();
            //}
        }
    }
Esempio n. 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        showhide.Visible   = false;
        showddltid.Visible = false;
        id = BasePage.GetRequestId(Request.QueryString["id"]);
        if (!Page.IsPostBack)
        {
            string bx = "<a class=\"home\" href=\"DIYPage.aspx\">单页管理</a>";
            if (BasePage.ArrayExist(Cookies.GetCookie("ModelPower"), "91"))
            {
                bx += "<a href =\"?Ac=add&tid=" + Request.QueryString["tid"] + "\" class=\"add\">新建单页</a>";
            }
            ((Literal)Master.FindControl("breadcrumbs")).Text = bx;
            string checklogin = new AdminBll().CheckLogin("9");
            if (checklogin != "true")
            {
                BasePage.Alertback(checklogin);
                Response.End();
            }

            string siteconfig = new WebConfigBll().GetModel(1).SiteConfig;
            if (!String.IsNullOrEmpty(siteconfig))
            {
                string[] a = siteconfig.Split('|');
                if (a.Length > 0)
                {
                    if (a[3] == "0")
                    {
                        //隐藏
                        showhide.Visible = true;
                    }
                }
            }

            action = Request.QueryString["Ac"];
            int    tid      = BasePage.GetRequestId(Request.QueryString["tid"]);
            string strwhere = "Tid=" + tid;
            if (String.IsNullOrEmpty(action))
            {
                Repeater1.DataSource = new CommonBll().GetList("", datatable, strwhere, "PageType desc,px desc,id desc");
                Repeater1.DataBind();
            }
            else if (action == "add")
            {
                ddltid.DataSource     = new CommonBll().GetList("", datatable, "PageType=1", "id desc");
                ddltid.DataTextField  = "PageName";
                ddltid.DataValueField = "id";
                ddltid.DataBind();
                ddltid.Items.Insert(0, new ListItem("无上级栏目", "0"));
                if (id != 0)
                {
                    DiyPageModel dm = new DiyPageBll().GetModel(id);
                    txtPageName.Text     = dm.PageName;
                    ddltid.SelectedValue = dm.Tid.ToString();
                    // ddltid.Enabled = false;
                    txtpx.Text = dm.Px.ToString();

                    txtseotitle.Text       = dm.SeoTitle;
                    txtkeyword.Text        = dm.SeoKeyword;
                    txtSeoDescription.Text = dm.SeoDescription;
                    txtcontents.Text       = dm.PageContents;
                    txtPicUrl.Text         = dm.PagePicUrl;
                    Button1.Text           = "确认修改";
                    contentsfield          = dm.PageContentsField;
                    SetCheckedBox.SetChecked(this.txtpagecontentsfield, dm.PageContentsField, ",");
                }
                if (gethide("1"))
                {
                    showddltid.Visible = true;
                }
                if (tid != 0)//从栏目里点新建,则开启所属栏目
                {
                    showddltid.Visible   = true;
                    ddltid.SelectedValue = tid.ToString();
                    txtpagecontentsfield.SelectedValue = "1";
                }
            }
            else if (action == "clone")
            { //克隆数据
                if (BasePage.ArrayExist(Cookies.GetCookie("ModelPower"), "91"))
                {
                    string filename = "PageName,ModelName,PageFilename,PageContents,EditTime,SeoTitle,SeoKeyword,SeoDescription,PageType,Px,Tid,PageContentsField,PagePicUrl";
                    int    c        = new CommonBll().CloneData(filename, datatable, "id=" + id);
                    if (c > 0)
                    {
                        BasePage.JscriptPrint(Page, "克隆成功!", "diypage.aspx?tid=" + tid);
                    }
                }
            }
        }
    }