/// <summary> /// 绑定列表 /// </summary> private void BindList() { using (PurProvider purProvider = new PurProvider()) { if (PRNo.Text.Trim().Length <= 0) { DataTable bomTable = purProvider.GetBOMList(ORDNO.Text.Trim(), this.BomType.SelectedValue.Trim()); List.DataSource = bomTable; List.DataBind(); if (bomTable != null && bomTable.Rows.Count > 0) { DRAWNO.Text = bomTable.Rows[0]["bommno"].ToString(); } ViewState["ViewDT"] = this.CreateTable(); BindTempData(); } else { List.DataSource = null; List.DataBind(); DataTable prTable = purProvider.GetPRDetailList(PRNo.Text.Trim()); ViewState["ViewDT"] = prTable; BindTempData(); //PRList.DataSource = prTable; //PRList.DataBind(); if (prTable != null && prTable.Rows.Count > 0) { ORDNO.Text = prTable.Rows[0]["PRHSORD"].ToString(); DRAWNO.Text = prTable.Rows[0]["prhmno"].ToString(); PRStatus.Text = prTable.Rows[0]["PRHSTAT"].ToString(); //默认全部勾选 for (int i = 0; i < PRList.Rows.Count; i++) { HtmlInputCheckBox rowCheckControl = (HtmlInputCheckBox)PRList.Rows[i].FindControl("RowCheck"); rowCheckControl.Checked = true; } } } } }