Exemplo n.º 1
0
        //调出库别发生改变时
        protected void DropDownList_out_subinventory_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (invoice_no.Value == "")
            {
                PageUtil.showToast(this, "请输入调拨单号再操作");
                return;
            }
            DataSet ds = invoiceDC.getExchangeHeaderBySome(invoice_no.Value, "");

            if (ds == null)
            {
                PageUtil.showToast(this, "请确保该调拨单号存在,再操作");
                return;
            }

            //调出库别与料号的二级联动
            try
            {
                DropDownList_item_name.Items.Clear();

                int     text         = int.Parse(DropDownList_out_subinventory.SelectedValue.ToString());
                DataSet ds_item_name = invoiceDC.getItem_nameBySubinventory(text);
                if (ds_item_name != null)
                {
                    DropDownList_item_name.DataSource     = ds_item_name.Tables[0].DefaultView;
                    DropDownList_item_name.DataValueField = "item_name";
                    DropDownList_item_name.DataTextField  = "item_name";
                    DropDownList_item_name.DataBind();
                }

                DropDownList_item_name.Items.Insert(0, "--选择料号--");
                DropDownList_item_name.SelectedIndex = 1;
            }
            catch (Exception e2)
            {
                PageUtil.showToast(this, "调出库别与料号二级联动失败,请检查库存总表是否有关联数据");
                return;
            }
        }