Esempio n. 1
0
 protected void RadDropDownList1_SelectedIndexChanged(object sender, DropDownListEventArgs e)
 {
     RadDropDownListSon.Items.Clear();
     RadDropDownListSon.Items.Add(new DropDownListItem("请选择", ""));
     RadDropDownListSon.DataSource     = CommoditySon_Bll.GetList(" CommodityFatherID ='" + RadDropDownListFather.SelectedValue + "'  ");
     RadDropDownListSon.DataTextField  = "CommoditySonName";
     RadDropDownListSon.DataValueField = "CommoditySonID";
     RadDropDownListSon.DataBind();
     RadDropDownListSon.SelectedText = "请选择";
 }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (UsersInfo.UserID == "")
            {
                Response.Write("<script> alert('请先登录!'); window.location.href='/BackLogin.aspx' </script>");
                return;
            }
            if (!IsPostBack)
            {
                if (Request.QueryString["ID"] != null)
                {
                    Session["GoodsID"] = Request.QueryString["ID"].ToString();
                    Maticsoft.Model.Commodity modelgoods = Commodity_Bll.GetModel(Session["GoodsID"].ToString());
                    if (modelgoods == null)
                    {
                        Response.Write("<script>window.location.href='Backspxxgl.aspx'</script>");
                    }
                    RadTextBox1.Text        = modelgoods.CommodityName;
                    RadTextBox2.Text        = modelgoods.CommodityType;
                    imgPic.ImageUrl         = modelgoods.CommodityImage;
                    RadNumericTextBox1.Text = modelgoods.MarketPrice.ToString();
                    RadNumericTextBox2.Text = modelgoods.VIPPrice.ToString();
                    RadNumericTextBox3.Text = modelgoods.BuyScore;
                    RadNumericTextBox4.Text = modelgoods.Stock.ToString();
                    if (modelgoods.Recommend == "推荐")
                    {
                        RadioButton1.Checked = true;
                    }
                    if (modelgoods.Recommend == "不推荐")
                    {
                        RadioButton4.Checked = true;
                    }
                    if (modelgoods.CommodityState == "上架")
                    {
                        RadioButton2.Checked = true;
                    }
                    if (modelgoods.CommodityState == "下架")
                    {
                        RadioButton3.Checked = true;
                    }
                    myEditor.Value = modelgoods.Introduce;

                    RadDropDownListFather.Items.Clear();
                    RadDropDownListSon.Items.Clear();
                    RadDropDownListFather.Items.Add(new DropDownListItem("请选择", ""));
                    RadDropDownListSon.Items.Add(new DropDownListItem("请选择", ""));

                    RadDropDownListFather.DataSource     = CommodityFather_BLL.GetList("");
                    RadDropDownListFather.DataTextField  = "CommodityFatherName";
                    RadDropDownListFather.DataValueField = "CommodityFatherID";
                    RadDropDownListFather.DataBind();
                    RadDropDownListFather.SelectedValue = modelgoods.CommodityFatherID;

                    RadDropDownListSon.DataSource     = CommoditySon_Bll.GetList(" CommodityFatherID ='" + RadDropDownListFather.SelectedValue + "'  ");
                    RadDropDownListSon.DataTextField  = "CommoditySonName";
                    RadDropDownListSon.DataValueField = "CommoditySonID";
                    RadDropDownListSon.DataBind();
                    RadDropDownListSon.SelectedValue = modelgoods.CommoditySonID;
                }

                else
                {
                    Response.Write("<script>window.location.href='Backspxxgl.aspx'</script>");
                }
            }
        }