示例#1
0
        public void ShowAProduct()
        {
            int       id = int.Parse(Request.QueryString["id"]);
            DataTable dt = new DataTable();

            dt = bus.ShowAProduct(id);

            foreach (DataRow dr in dt.Rows)
            {
                txtProductID.Text           = dr["ProductID"].ToString();
                DropDownList1.SelectedValue = dr["VendorID"].ToString();
                DropDownList2.SelectedValue = dr["CategoryID"].ToString();
                txtName.Text        = dr["ProductName"].ToString();
                txtDescription.Text = dr["Description"].ToString();
                string[] imagelist = (dr["Photo"].ToString()).Split('/');
                lbImage.Text     = imagelist[4];
                txtQuantity.Text = dr["Quantity"].ToString();
                txtCost.Text     = dr["Cost"].ToString();
                if (dr["ProductState"].ToString() == "True")
                {
                    chbState.Checked = true;
                }
            }
        }