//领料工单号改变时
        protected void DropDownList_issue_wo_no_SelectedIndexChanged(object sender, EventArgs e)
        {
            //领料工单号与料号的的二级联动
            try
            {
                DropDownList_item_name.Items.Clear();

                string  text         = DropDownList_issue_wo_no.SelectedValue.ToString();
                DataSet ds_item_name = invoiceDC.getItem_nameByIssue_wo_no(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;
            }

            //根据工单号,和料号。拿需求量和发料量
            try
            {
                if (invoice_no.Value == "")
                {
                    PageUtil.showToast(this, "请输入领料单号再操作");
                    return;
                }

                //检测是否为工单领料,如果是,则需求量,发料量从工单物料需求表中带出
                DataSet ds = invoiceDC.getIssueHeaderBySome(invoice_no.Value, "", "");
                if (ds == null)
                {
                    PageUtil.showToast(this, "该领料单号不存在,请重新输入(确保已经申请成功)");
                    return;
                }

                if (ds.Tables[0].Rows[0]["issue_type"].ToString() == "工单领料")
                {
                    DataSet ds2 = invoiceDC.getRequirement(DropDownList_issue_wo_no.SelectedValue.ToString(), DropDownList_item_name.SelectedValue.ToString());

                    required_qty.Value  = ds2.Tables[0].Rows[0]["required_qty"].ToString();
                    simulated_qty.Value = ds2.Tables[0].Rows[0]["issued_qty"].ToString();
                }
                else
                {
                    required_qty.Value  = "0";
                    simulated_qty.Value = "0";
                }
            }
            catch (Exception ex)
            {
                PageUtil.showToast(this, "获取需求量,发料量失败,请检查工单物料需求表");
                return;
            }

            ////料号与料架的二级联动,去库存明细表中找有此料号的料架
            //try
            //{
            //    DropDownList_frame_key.Items.Clear();

            //    string text = DropDownList_item_name.SelectedValue.ToString();
            //    DataSet ds_frame_key = invoiceDC.getFrameByItem_name(text);
            //    if (ds_frame_key != null)
            //    {
            //        DropDownList_frame_key.DataSource = ds_frame_key.Tables[0].DefaultView;
            //        DropDownList_frame_key.DataValueField = "frame_name";
            //        DropDownList_frame_key.DataTextField = "frame_name";
            //        DropDownList_frame_key.DataBind();
            //    }

            //    DropDownList_frame_key.Items.Insert(0, "--选择料架--");
            //    DropDownList_frame_key.SelectedIndex = 1;
            //}
            //catch (Exception e2)
            //{
            //    PageUtil.showToast(this, "小料号与料架二级联动失败,请检查库存明细表");
            //    return;
            //}

            ////料架与库别的二级联动
            //try
            //{
            //    DropDownList_issue_sub_key.Items.Clear();

            //    string text = DropDownList_frame_key.SelectedValue.ToString();
            //    DataSet ds_issue_sub_key = invoiceDC.getSubinventoryByFrame(text);
            //    if (ds_issue_sub_key != null)
            //    {
            //        DropDownList_issue_sub_key.DataSource = ds_issue_sub_key.Tables[0].DefaultView;
            //        DropDownList_issue_sub_key.DataValueField = "subinventory_name";
            //        DropDownList_issue_sub_key.DataTextField = "subinventory_name";
            //        DropDownList_issue_sub_key.DataBind();
            //    }

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


            //料号与库别的二级联动,去库存总表中找有此料号的库别
            try
            {
                DropDownList_issue_sub_key.Items.Clear();

                string  text             = DropDownList_item_name.SelectedValue.ToString();
                DataSet ds_issue_sub_key = invoiceDC.getSubinventoryByItem_name(text);
                if (ds_issue_sub_key != null)
                {
                    DropDownList_issue_sub_key.DataSource     = ds_issue_sub_key.Tables[0].DefaultView;
                    DropDownList_issue_sub_key.DataValueField = "subinventory";
                    DropDownList_issue_sub_key.DataTextField  = "subinventory";
                    DropDownList_issue_sub_key.DataBind();

                    DropDownList_issue_sub_key.Items.Insert(0, "--选择库别--");
                    DropDownList_issue_sub_key.SelectedIndex = 1;
                }
                else
                {
                    PageUtil.showToast(this, "料号与库别二级联动失败,请检查库存总表");
                    return;
                }
            }
            catch (Exception e2)
            {
                PageUtil.showToast(this, "料号与库别二级联动失败,请检查库存总表");
                return;
            }
        }