Exemple #1
0
        /// <summary>
        /// 新增PRList临时行
        /// </summary>
        protected void CreateButton_Click(object sender, EventArgs e)
        {
            var table = ViewState["ViewDT"] as DataTable;

            foreach (GridViewRow row in List.Rows)
            {
                HtmlInputCheckBox rowCheckControl = (HtmlInputCheckBox)row.FindControl("RowCheck");
                if (rowCheckControl.Checked)
                {
                    var newRow = table.NewRow();
                    newRow["prlnedm"]  = "N";
                    newRow["prltno"]   = row.Cells[2].Text.Trim();
                    newRow["bomnam"]   = row.Cells[3].Text.Trim();
                    newRow["bommat"]   = row.Cells[4].Text.Trim();
                    newRow["prlrule"]  = row.Cells[5].Text.Trim();
                    newRow["prlsoseq"] = row.Cells[1].Text.Trim();
                    newRow["bomreq"]   = row.Cells[6].Text.Trim();
                    newRow["prlum"]    = row.Cells[7].Text.Trim();
                    newRow["PRLQTY"]   = Util.ToInt(row.Cells[6].Text.Trim()) - LocalGlobal.GetBomQty(ORDNO.Text.Trim(), row.Cells[1].Text.Trim(), "F");

                    //保存临时数据后重新绑定gridview
                    table.Rows.Add(newRow);
                }
            }

            ViewState["ViewDT"] = table;
            BindTempData();
        }