示例#1
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();
            //}
        }
    }
示例#2
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;
        }
    }
示例#3
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);
                    }
                }
            }
        }
    }