Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            db = new Database();
            db.Init_database();
            DataTable mytable = db.get_Table("ManagerList");
            if (!this.IsPostBack)
            {
                this.GridView1.DataSource = db.get_DataSet("ManagerList");
                this.GridView1.DataBind();
            }

            for (int i = 0; i < GridView1.Rows.Count; i++)
            {
                TableCell cell = new TableCell();

                LinkButton link = new LinkButton();
                link.ID = GridView1.Rows[i].Cells[1].Text+"change";
                link.Text = "编辑";
                link.Click += new EventHandler(Button2_Click);

                Label lb = new Label();
                lb.Text = "&nbsp;";

                LinkButton link2 = new LinkButton();
                link2.Text = "删除";
                link2.ID = GridView1.Rows[i].Cells[1].Text+"del";
                link2.Click += new EventHandler(Button3_Click);

                cell.Controls.Add(link);
                cell.Controls.Add(lb);
                cell.Controls.Add(link2);
                GridView1.Rows[i].Cells.Add(cell);
            }
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            db = new Database();
            db.Init_database();
            this.GridView1.DataSource = db.get_DataSet("ManagerList");
            this.GridView1.DataBind();

            this.GridView3.DataSource = db.get_DataSet("UserList");
            this.GridView3.DataBind();
        }
Exemple #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     int i;
     db = new Database();
     db.Init_database();
     mytable = db.get_Table("HomePage");
     pics = null;
     for (i = 0; i < mytable.Rows.Count-1; i++)
     {
         pics += "'" + mytable.Rows[i]["HoIMAGE"].ToString().Trim() + "'" + "+ '|' +";
     }
     pics += "'" + mytable.Rows[i]["HoIMAGE"].ToString().Trim() + "'";
 }
Exemple #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     db = new Database();
     db.Init_database();
     mytable = new DataTable();
     mytable = db.get_Table("VegetableList");
     foreach (DataRow myRow in mytable.Rows)
     {
         if (myRow["FCATEGORY"].ToString().Trim() == "1")
         {
             Panel p1 = new Panel();
             p1.Width = 250;
             p1.Height = 230;
             p1.Style.Value = "float:left";
             ImageButton im = new ImageButton();
             im.ImageUrl = myRow["VIMAGE"].ToString();
             im.ID = myRow["VNO"].ToString();
             im.Width = 250;
             im.Height = 200;
             im.Click += new ImageClickEventHandler(Button3_Click);
             Label la = new Label();
             la.Text = "购买数量:";
             TextBox tt = new TextBox();
             tt.Width = 40;
             tt.ID = myRow["VNAME"].ToString();
             Label la2 = new Label();
             la2.Text = "   ";
             Button bt = new Button();
             bt.Height = 30;
             bt.ID = myRow["VNAME"].ToString() + "?" + myRow["VIMAGE"].ToString();
             bt.Click += new EventHandler(Button2_Click);
             bt.Text = "加入购物车";
             p1.Controls.Add(im);
             p1.Controls.Add(la);
             p1.Controls.Add(tt);
             p1.Controls.Add(la2);
             p1.Controls.Add(bt);
             Panel1.Controls.Add(p1);
         }
     }
 }
Exemple #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     db = new Database();
     db.Init_database();
     mytable = new DataTable();
     mytable = db.get_Table("VegetableList");
     string temp = Request.QueryString.Get("id").ToString();
     Label2.Text = temp;
     foreach (DataRow myRow in mytable.Rows)
     {
         if (myRow["VNO"].ToString().Trim().Equals(Label2.Text.Trim()))
         {
             Label4.Text = myRow["VNAME"].ToString();
             Image1.ImageUrl = myRow["VIMAGE"].ToString();
             Label5.Text = myRow["VSOLD"].ToString();
         }
     }
     mytable2 = db.get_Table("UserEvaluation");
     DataTable table = new DataTable();
     table.Columns.Add(new DataColumn("用户"));
     table.Columns.Add(new DataColumn("评论"));
     for (int i = 0; i < mytable2.Rows.Count; i++)
     {
         if (mytable2.Rows[i]["BNO"].ToString().Trim().Equals(Label2.Text))
         {
             TableRow tr = new TableRow();
             TableCell tc = new TableCell();
             tc.Text = mytable2.Rows[i]["Evaluation"].ToString();
             TableCell tc2 = new TableCell();
             tc2.Text = "                        ";
             TableCell tc3 = new TableCell();
             tc3.Text = getName(mytable2.Rows[i]["UNO"].ToString());
             tc3.Attributes.Add("style", "text-align:right");
             tr.Cells.Add(tc);
             tr.Cells.Add(tc2);
             tr.Cells.Add(tc3);
             Table1.Rows.Add(tr);
         }
     }
 }
Exemple #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string temp = Request.QueryString.Get("id").ToString();
                Label1.Text = temp;
                db = new Database();
                db.Init_database();
                mytable = db.get_Table("UserList");
            xd = new XmlDocument();
            xd.Load(Server.MapPath("gouwuche.xml"));
            root = xd.DocumentElement;
            items = root.ChildNodes;

            foreach (XmlNode item in items)
            {
                TableRow tr = new TableRow();
                TableCell tc = new TableCell();
                foreach (XmlNode p in item)
                {
                    if (p.InnerText.StartsWith("~"))
                    {
                        Image im = new Image();
                        im.Width = 60;
                        im.Height = 50;
                        im.ImageUrl = p.InnerText;
                        tc.Controls.Add(im);
                        tr.Cells.Add(tc);
                        tc = new TableCell();

                    }
                    else
                    {
                        TableCell tc2 = new TableCell();
                        tc2.Text = p.InnerText;
                        tr.Cells.Add(tc2);
                    }
                    Table1.Rows.Add(tr);
                }
            }
        }
Exemple #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     db = new Database();
     db.Init_database();
     mytable = new DataTable();
     if (Request.QueryString.Get("id") != null)
     {
         string temp = Request.QueryString.Get("id").ToString();
         Label5.Text = temp;
          mytable = db.get_Table("UserList");
          foreach (DataRow myRow in mytable.Rows)
          {
              if (myRow["UNO"].ToString().Trim().Equals(temp))
              {
                  temp = myRow["UNAME"].ToString();
              }
          }
         Label2.Text = temp;
         Label2.Visible = true;
         LinkButton1.Visible = false;
     }
 }
Exemple #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            db = new Database();
            db.Init_database();
            if (!this.IsPostBack)
            {
                this.GridView1.DataSource = db.get_DataSet("VegetableList");
                this.GridView1.DataBind();

                this.GridView2.DataSource = db.get_DataSet("MeatList");
                this.GridView2.DataBind();

                this.GridView3.DataSource = db.get_DataSet("FisheryList");
                this.GridView3.DataBind();

                this.GridView4.DataSource = db.get_DataSet("CondimentList");
                this.GridView4.DataBind();

                this.GridView5.DataSource = db.get_DataSet("FruitList");
                this.GridView5.DataBind();

            }
            this.GridView1.ID = "VegetableList";
            this.GridView2.ID = "MeatList";
            this.GridView3.ID = "FisheryList";
            this.GridView4.ID = "CondimentList";
            this.GridView5.ID = "FruitList";
            set(GridView1);
            set(GridView2);
            set(GridView3);
            set(GridView4);
            set(GridView5);
        }
Exemple #9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     db = new Database();
     db.Init_database();
     DataTable mytable = db.get_Table("UserList");
 }
Exemple #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string temp = Request.QueryString.Get("id").ToString();
            Label1.Text = temp;
            db = new Database();
            db.Init_database();
            mytable = db.get_Table("OrderForm");
            mytable2 = db.get_Table("UserList");
            DataTable table = new DataTable();
            table.Columns.Add(new DataColumn("ONO"));
            table.Columns.Add(new DataColumn("ID"));
            table.Columns.Add(new DataColumn("Name"));
            table.Columns.Add(new DataColumn("ADDRESS"));
            table.Columns.Add(new DataColumn("EMAIL"));
            table.Columns.Add(new DataColumn("COUNT"));
            if (!this.IsPostBack)
            {
                for(int i=0;i<mytable.Rows.Count;i++)
                {
                    if (mytable.Rows[i]["UNO"].ToString().Trim().Equals(Label1.Text))
                    {
                        DataRow sourseRow = table.NewRow();
                        sourseRow["ONO"] = mytable.Rows[i]["ONO"];
                        sourseRow["ID"] = mytable.Rows[i]["UNO"];
                        sourseRow["Name"] = mytable.Rows[i]["ONAME"];
                        sourseRow["ADDRESS"] = mytable.Rows[i]["OADDRESS"];
                        sourseRow["EMAIL"] = mytable.Rows[i]["OEMAIL"];
                        sourseRow["COUNT"] = mytable.Rows[i]["COUNT"];
                        table.Rows.Add(sourseRow);
                    }
                }
                for (int i = 0; i < mytable2.Rows.Count; i++)
                {
                    if (mytable2.Rows[i]["UNO"].ToString().Trim().Equals(Label1.Text))
                    {
                        Label16.Text = mytable2.Rows[i]["UNAME"].ToString();
                        Label17.Text = mytable2.Rows[i]["UPASSWORD"].ToString();
                        Label18.Text = mytable2.Rows[i]["UADDRESS"].ToString();
                        Label19.Text = mytable2.Rows[i]["UEMAIL"].ToString();
                    }
                }
                GridView1.DataSource = table;
                GridView1.DataBind();
            }
            for (int i = 0; i < GridView1.Rows.Count; i++)
            {
                TableCell cell = new TableCell();

                LinkButton link = new LinkButton();
                link.ID = GridView1.Rows[i].Cells[0].Text + "check";
                link.Text = "查看";
                link.Click += new EventHandler(Button2_Click);

                Label lb = new Label();
                lb.Text = "&nbsp;";

                LinkButton link2 = new LinkButton();
                link2.Text = "删除";
                link2.ID = GridView1.Rows[i].Cells[0].Text + "del";
                link2.Click += new EventHandler(Button3_Click);

                Label lb2 = new Label();
                lb2.Text = "&nbsp;";

                LinkButton link3 = new LinkButton();
                link3.Text = "评论";
                link3.ID = GridView1.Rows[i].Cells[0].Text + "pinglun";
                link3.Click += new EventHandler(Button6_Click);

                cell.Controls.Add(link);
                cell.Controls.Add(lb);
                cell.Controls.Add(link2);
                cell.Controls.Add(lb2);
                cell.Controls.Add(link3);
                GridView1.Rows[i].Cells.Add(cell);
            }
        }