//重置 protected void Button_Cancel2(object sender, EventArgs e) { foreach (GridViewRow item in Gridview1.Rows) { TextBox TBox = item.FindControl("TextBox3") as TextBox; TBox.Text = ""; } UpdatePanelApplyDetailSummary.Update(); }
//检索 protected void Button_Sh1(object sender, EventArgs e) { if (label_Title.Text == "芯片价格录入") { string condition = GetCondition() + " and a.IMMBD_MaterialName='" + "芯片" + "'"; BindGriview1(condition); } if (label_Title.Text == "原材料价格录入") { string condition = GetCondition() + " and a.IMMBD_MaterialName !='" + "芯片" + "'"; BindGriview1(condition); } PanelApplyDetailSummary.Visible = true; UpdatePanelApplyDetailSummary.Update(); }
//提交 protected void Button_Com2(object sender, EventArgs e) { int i = 0; foreach (GridViewRow item in Gridview1.Rows) { TextBox TBox = item.FindControl("TextBox3") as TextBox; if (TBox.Text != "") { PMPurchaseingApplyRuleinfo.IMMBD_MaterialID = new Guid(Gridview1.DataKeys[item.RowIndex].Value.ToString()); PMPurchaseingApplyRuleinfo.IMMBD_Price = Convert.ToDecimal(TBox.Text.ToString()); pl.UpdatePMPMaterial_Price(PMPurchaseingApplyRuleinfo); } TBox.Text = ""; } foreach (GridViewRow item in Gridview1.Rows) { TextBox TBox = item.FindControl("TextBox3") as TextBox; if (TBox.Text.ToString() == "") { i = i + 1; } } if (i == Gridview1.Rows.Count) { ScriptManager.RegisterClientScriptBlock(Page, GetType(), "alert", "alert('请填写物料价格!')", true); return; } if (label_Title.Text == "芯片价格录入") { string condition = GetCondition() + " and a.IMMBD_MaterialName='" + "芯片" + "'"; BindGriview1(condition); } if (label_Title.Text == "原材料价格录入") { string condition = GetCondition() + " and a.IMMBD_MaterialName !='" + "芯片" + "'"; BindGriview1(condition); } //this.labelcodition.Text = Convert.ToString(i); //this.label_IMMBD_MaterialID.Text = "剩余" + this.labelcodition.Text + "种物料没有填写价格!"; UpdatePanelApplyDetailSummary.Update(); }