//取消铜材正料 protected void Button_Clio(object sender, EventArgs e) { Panel_CopperIn.Visible = false; UpdatePanel_CopperIn.Update(); Panel_CopperInNew.Visible = false; UpdatePanel_CopperInNew.Update(); }
//新增铜材正料 protected void Button_lio(object sender, EventArgs e) { TextBox7.Enabled = true; TextBox8.Enabled = true; TextBox22.Enabled = true; Panel_CopperInNew.Visible = true; label_CopperIn.Text = "新增"; UpdatePanel_CopperInNew.Update(); }
//取消新增铜材正料 protected void Button_CRocky(object sender, EventArgs e) { TextBox7.Text = ""; TextBox8.Text = ""; TextBox9.Text = ""; TextBox11.Text = ""; TextBox12.Text = ""; TextBox10.Text = ""; TextBox22.Text = ""; DropDownList4.SelectedValue = "请选择"; Panel_CopperInNew.Visible = false; UpdatePanel_CopperInNew.Update(); }
//铜材正料--修改、删除 protected void Gridview2_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Merry")//修改 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Gridview2.SelectedIndex = row.RowIndex; label_CopperIn.Text = "修改"; label_CopperInID.Text = e.CommandArgument.ToString(); TextBox7.Text = Gridview2.Rows[Gridview2.SelectedIndex].Cells[2].Text.ToString(); TextBox8.Text = Gridview2.Rows[Gridview2.SelectedIndex].Cells[3].Text.ToString(); TextBox9.Text = Gridview2.Rows[Gridview2.SelectedIndex].Cells[4].Text.ToString(); TextBox11.Text = Gridview2.Rows[Gridview2.SelectedIndex].Cells[5].Text.ToString(); TextBox12.Text = Gridview2.Rows[Gridview2.SelectedIndex].Cells[7].Text.ToString(); DropDownList4.SelectedValue = Gridview2.Rows[Gridview2.SelectedIndex].Cells[9].Text.ToString(); TextBox10.Text = Gridview2.Rows[Gridview2.SelectedIndex].Cells[8].Text.ToString(); TextBox22.Text = Gridview2.Rows[Gridview2.SelectedIndex].Cells[1].Text.ToString(); TextBox7.Enabled = false; TextBox8.Enabled = false; TextBox22.Enabled = false; Panel_CopperInNew.Visible = true; UpdatePanel_CopperInNew.Update(); } if (e.CommandName == "Denol")//删除 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Gridview2.SelectedIndex = row.RowIndex; label_CopperInID.Text = e.CommandArgument.ToString(); PMCopperFoundryinfo.PMCI_ID = new Guid(e.CommandArgument.ToString()); PMCopperFoundryinfo.PMCF_ID = new Guid(label_CopperID.Text); PMCopperFoundryinfo.PMCI_ExpendNum = Convert.ToDecimal(Gridview2.Rows[Gridview2.SelectedIndex].Cells[6].Text.ToString()); pf.DeletePMCopperIn(PMCopperFoundryinfo); BindGridview2(PMCopperFoundryinfo); BindGridview1(""); UpdatePanel_Copper.Update(); Panel_CopperIn.Visible = true; UpdatePanel_CopperIn.Update(); ScriptManager.RegisterClientScriptBlock(UpdatePanel_CopperIn, GetType(), "aa", "alert('删除成功!')", true); return; } }
//检索 protected void Button1_Sh(object sender, EventArgs e) { string condition = GetCondition(); BindGridview1(condition); UpdatePanel_Copper.Update(); Panel_CopperNew.Visible = false; UpdatePanel_CopperNew.Update(); Panel_Supply.Visible = false; UpdatePanel_Supply.Update(); Panel_CopperIn.Visible = false; UpdatePanel_CopperIn.Update(); Panel1.Visible = false; UpdatePanel1.Update(); Panel2.Visible = false; UpdatePanel2.Update(); Panel_CopperInNew.Visible = false; UpdatePanel_CopperInNew.Update(); Panel_CopperReturn.Visible = false; UpdatePane_CopperReturn.Update(); Panel_CopperPrice.Visible = false; UpdatePanel_CopperPrice.Update(); }
//提交正料 protected void Button_Rocky(object sender, EventArgs e) { if (TextBox7.Text != "") { PMCopperFoundryinfo.PMCI_ProductNum = Convert.ToDecimal(TextBox7.Text.ToString()); } else { ScriptManager.RegisterClientScriptBlock(UpdatePanel_CopperInNew, GetType(), "aa", "alert('标记*的为必填项,请填写完整!')", true); return; } if (TextBox8.Text != "") { PMCopperFoundryinfo.PMCI_ProPrice = Convert.ToDecimal(TextBox8.Text.ToString()); } else { ScriptManager.RegisterClientScriptBlock(UpdatePanel_CopperInNew, GetType(), "aa", "alert('标记*的为必填项,请填写完整!')", true); return; } if (TextBox9.Text != "") { PMCopperFoundryinfo.PMCI_BillTotalPrice = Convert.ToDecimal(TextBox9.Text.ToString()); } else { ScriptManager.RegisterClientScriptBlock(UpdatePanel_CopperInNew, GetType(), "aa", "alert('标记*的为必填项,请填写完整!')", true); return; } if (TextBox11.Text != "") { PMCopperFoundryinfo.PMCI_AccountRate = Convert.ToDecimal(TextBox11.Text.ToString()); } else { ScriptManager.RegisterClientScriptBlock(UpdatePanel_CopperInNew, GetType(), "aa", "alert('标记*的为必填项,请填写完整!')", true); return; } if (TextBox12.Text != "") { PMCopperFoundryinfo.PMCI_BillNum = TextBox12.Text.ToString(); } else { ScriptManager.RegisterClientScriptBlock(UpdatePanel_CopperInNew, GetType(), "aa", "alert('标记*的为必填项,请填写完整!')", true); return; } if (DropDownList4.SelectedValue != "请选择") { PMCopperFoundryinfo.PMCI_Pay = DropDownList4.SelectedValue.ToString(); } else { ScriptManager.RegisterClientScriptBlock(UpdatePanel_CopperInNew, GetType(), "aa", "alert('标记*的为必填项,请填写完整!')", true); return; } if (TextBox10.Text != "") { PMCopperFoundryinfo.PMCI_Remark = TextBox10.Text.ToString(); } else { ScriptManager.RegisterClientScriptBlock(UpdatePanel_CopperInNew, GetType(), "aa", "alert('标记*的为必填项,请填写完整!')", true); return; } if (TextBox22.Text != "") { PMCopperFoundryinfo.PMCI_Model = TextBox22.Text.ToString(); } else { ScriptManager.RegisterClientScriptBlock(UpdatePanel_CopperInNew, GetType(), "aa", "alert('标记*的为必填项,请填写完整!')", true); return; } PMCopperFoundryinfo.PMCF_ID = new Guid(label_CopperID.Text.ToString()); if (label_CopperIn.Text == "新增") { pf.InsertPMCopperIn(PMCopperFoundryinfo); } if (label_CopperIn.Text == "修改") { PMCopperFoundryinfo.PMCI_ID = new Guid(label_CopperInID.Text.ToString()); pf.UpdatePMCopperIn(PMCopperFoundryinfo); } TextBox7.Text = ""; TextBox8.Text = ""; TextBox9.Text = ""; TextBox11.Text = ""; TextBox12.Text = ""; TextBox10.Text = ""; TextBox22.Text = ""; DropDownList4.SelectedValue = "请选择"; Panel_CopperInNew.Visible = false; UpdatePanel_CopperInNew.Update(); PMCopperFoundryinfo.PMCF_ID = new Guid(label_CopperID.Text); BindGridview2(PMCopperFoundryinfo); UpdatePanel_CopperIn.Update(); BindGridview1(""); UpdatePanel_Copper.Update(); }