示例#1
0
    protected void BindData()
    {
        WebconfigInfo webconfigInfo = WebconfigInfo.Read(1);

        this.name.Text      = webconfigInfo.Name;
        this.gonggao.Value  = webconfigInfo.Gonggao;
        this.chengnuo.Value = webconfigInfo.Chengnuo;
        this.contact.Value  = webconfigInfo.Contact;
        this.jianjie.Value  = webconfigInfo.Jianjie;
        this.foot.Value     = webconfigInfo.Foot;
    }
    public static List <WebconfigInfo> ReadList(string whereStr)
    {
        List <WebconfigInfo> list        = new List <WebconfigInfo>();
        Database             database    = new Database();
        DataView             defaultView = database.RunProc("select * from Webconfig " + whereStr).Tables[0].DefaultView;

        for (int i = 0; i < defaultView.Count; i++)
        {
            list.Add(WebconfigInfo.Read(int.Parse(defaultView[i]["id"].ToString())));
        }
        database.Dispose();
        return(list);
    }
示例#3
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        WebconfigInfo webconfigInfo = WebconfigInfo.Read(1);

        webconfigInfo.Name     = this.name.Text;
        webconfigInfo.Gonggao  = this.gonggao.Value;
        webconfigInfo.Chengnuo = this.chengnuo.Value;
        webconfigInfo.Contact  = this.contact.Value;
        webconfigInfo.Foot     = this.foot.Value;
        webconfigInfo.Jianjie  = this.jianjie.Value;
        webconfigInfo.Update();
        base.Response.Write("<script>alert('修改成功!');location.href='" + base.Request.RawUrl + "';</script>");
    }
示例#4
0
    public void BindData()
    {
        this.webconfig = WebconfigInfo.Read(1);
        //this.repeater1.DataSource = this.db.RunProcGetDataView("select * from ChanPin limit 10");
        //this.repeater1.DataBind();
        //this.repeater2.DataSource = this.db.RunProcGetDataView("select * from Article where sortId=26 limit 5");
        //this.repeater2.DataBind();
        // this.repeater3.DataSource = this.db.RunProcGetDataView("select * from Article where sortId=27 limit 5");
        //this.repeater3.DataBind();
        DataView dataView = this.db.RunProcGetDataView("select * from ChanPin limit 10");

        for (int i = 0; i < dataView.Count; i++)
        {
            this.sb_pic.Append(dataView[i]["picture"].ToString() + "|");
            this.sb_link.Append("ProductView.aspx?id=" + dataView[i]["id"].ToString() + "|");
        }
        this.db.Dispose();
    }
示例#5
0
    public void BindData()
    {
        MySqlDataReader mySqlDataReader = this.db.RunProcGetReader("select B.moduleTableName as moduleName, A.* from infosort as A,moduleList as B where A.moduleId=B.id and A.pid=0 order by A.sortOrder");

        while (mySqlDataReader.Read())
        {
            if (mySqlDataReader["sortType"].ToString() == "1")
            {
                this.sb.AppendLine(string.Concat(new string[]
                {
                    "<li><a href='",
                    mySqlDataReader["moduleName"].ToString(),
                    "List.aspx?id=",
                    mySqlDataReader["Id"].ToString(),
                    "'>",
                    mySqlDataReader["SortName"].ToString(),
                    "</a></li>"
                }));
                this.sb1.AppendLine(string.Concat(new string[]
                {
                    "<a href='",
                    mySqlDataReader["moduleName"].ToString(),
                    "List.aspx?id=",
                    mySqlDataReader["Id"].ToString(),
                    "'>",
                    mySqlDataReader["SortName"].ToString(),
                    "</a>"
                }));
            }
            else
            {
                if (mySqlDataReader["sortType"].ToString() == "2")
                {
                    this.sb.AppendLine(string.Concat(new string[]
                    {
                        "<li><a href='",
                        mySqlDataReader["moduleName"].ToString(),
                        "View.aspx?sortId=",
                        mySqlDataReader["Id"].ToString(),
                        "''>",
                        mySqlDataReader["SortName"].ToString(),
                        "</a></li>"
                    }));
                    this.sb1.AppendLine(string.Concat(new string[]
                    {
                        "<a href='",
                        mySqlDataReader["moduleName"].ToString(),
                        "View.aspx?sortId=",
                        mySqlDataReader["Id"].ToString(),
                        "''>",
                        mySqlDataReader["SortName"].ToString(),
                        "</a>"
                    }));
                }
                else
                {
                    if (mySqlDataReader["sortType"].ToString() == "3")
                    {
                        this.sb.AppendLine(string.Concat(new string[]
                        {
                            "<li><a href='",
                            mySqlDataReader["sortUrl"].ToString(),
                            "'>",
                            mySqlDataReader["SortName"].ToString(),
                            "</a></li>"
                        }));
                        this.sb1.AppendLine(string.Concat(new string[]
                        {
                            "<a href='",
                            mySqlDataReader["sortUrl"].ToString(),
                            "'>",
                            mySqlDataReader["SortName"].ToString(),
                            "</a>"
                        }));
                    }
                }
            }
        }
        mySqlDataReader.Close();
        this.db.Dispose();
        this.webconfig  = WebconfigInfo.Read(1);
        this.Page.Title = this.Page.Title.Replace("无标题页", "") + " - " + this.webconfig.Name;
    }