protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Panel4.Visible = false; Panel3.Visible = false; Panel5.Visible = false; Panel6.Visible = false; Panel7.Visible = false; Panel8.Visible = false; Panel9.Visible = false; Panel10.Visible = false; GridView1.DataSource = pmc.Query_Copper(); GridView1.DataBind(); UpdatePanel2.Update(); UpdatePanel3.Update(); UpdatePanel4.Update(); UpdatePanel5.Update(); UpdatePanel6.Update(); UpdatePanel7.Update(); UpdatePanel8.Update(); UpdatePanel9.Update(); UpdatePanel10.Update(); } }
private void limpiarFormularioSalida() { LbMensajeSalida.Text = string.Empty; TxBusqueda.Text = string.Empty; LbAprobacion.Text = string.Empty; LbIdEntrada.Text = string.Empty; LbNombreEntrada.Text = string.Empty; LbArticuloEntrada.Text = string.Empty; LbSerieEntrada.Text = string.Empty; LbInventarioEntrada.Text = string.Empty; LbFechaEntrada.Text = string.Empty; DivEntradas.Visible = false; TxNombreSalida.Text = string.Empty; DDLArticuloSalida.SelectedIndex = -1; TxSerieSalida.Text = string.Empty; TxInventarioSalida.Text = string.Empty; DDLMotivoSalida.SelectedIndex = -1; TxObservacionesSalida.Text = string.Empty; //DDLAutorizado.SelectedIndex = -1; UpdatePanel6.Update(); UpdatePanel7.Update(); UpdatePanel8.Update(); UpdatePanel10.Update(); }
protected void Button4_Click(object sender, EventArgs e) { if (RadioButtonList3.SelectedIndex < 0) { errorDiv3.InnerText = "Please select an answer"; } else if (RadioButtonList3.SelectedIndex == 0) { score++; questionsAnswered++; Button4.Enabled = false; RadioButtonList3.Items.FindByValue("correct").Attributes.Add("class", "right"); monster.Visible = true; monsterA.Visible = true; monsterA.Text = "Correct! Who doesn't love a good Pixar film. This is, of course, BIlly Crystal as Mike Wazowski."; UpdatePanel9.Update(); UpdatePanel10.Update(); UpdatePanel11.Update(); } else { questionsAnswered++; Button4.Enabled = false; RadioButtonList3.SelectedItem.Attributes.Add("class", "wrong"); RadioButtonList3.Items.FindByValue("correct").Attributes.Add("class", "right"); monster.Visible = true; monsterA.Visible = true; monsterA.Text = "I know it's a kids film, but it's a great one. This is, of course, Billy Crystal as Mike Wazowski in Monsters, inc."; UpdatePanel9.Update(); UpdatePanel10.Update(); UpdatePanel11.Update(); } }
protected void SearchWorkOrder_Click(object sender, EventArgs e) { string name = TextBox20.Text; GridView5.DataSource = dp.Query_WorkOrder(name); GridView5.DataBind(); UpdatePanel10.Update(); }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; if (e.CommandName == "Return") { Panel5.Visible = true; CopperID.Text = e.CommandArgument.ToString(); GridView3.DataSource = pmc.Query_CopperReturn(new Guid(CopperID.Text)); GridView3.DataBind(); Debug.Assert(row != null, "Oh My LadyGaga!"); Label16.Text = row.Cells[2].Text; Label20.Text = row.Cells[10].Text; UpdatePanel5.Update(); } if (e.CommandName == "NG") { Panel7.Visible = true; CopperID.Text = e.CommandArgument.ToString(); GridView4.DataSource = pmc.Query_CopperNG(new Guid(CopperID.Text)); GridView4.DataBind(); Label15.Text = row.Cells[2].Text; Label17.Text = row.Cells[10].Text; UpdatePanel7.Update(); } if (e.CommandName == "Modi") { CopperID.Text = e.CommandArgument.ToString(); Label4.Text = "修改"; LabelUsage.Visible = true; TextBox47.Visible = true; TextBox47.Text = row.Cells[12].Text; Panel3.Visible = true; UpdatePanel3.Update(); Type.Text = row.Cells[3].Text; Mid.Text = row.Cells[11].Text; TextBox3.Text = row.Cells[5].Text; TextBox6.Text = row.Cells[4].Text; TextBox46.Text = row.Cells[9].Text; ProviderName.Text = row.Cells[2].Text; ProviderID.Text = row.Cells[10].Text; CopperRate.Text = row.Cells[12].Text; } if (e.CommandName == "OEM") { Panel10.Visible = true; CopperID.Text = e.CommandArgument.ToString(); GridView6.DataSource = pmc.Query_CopperOEM(new Guid(CopperID.Text)); GridView6.DataBind(); UpdatePanel10.Update(); } }
protected void GridView5_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Choose") { Guid wo = new Guid(e.CommandArgument.ToString()); Guid pp = new Guid(PPID.Text); dp.Insert_WorkOrder(wo, pp); GridView4.DataSource = dp.Query_ConnectedWorkOrder(new Guid(PPID.Text)); GridView4.DataBind(); UpdatePanel9.Update(); UpdatePanel10.Update(); } }
protected void lbtnHistorialGestiones_Click(object sender, EventArgs e) { try { buscarHistorialGestiones(); ScriptManager.RegisterStartupScript(UpdatePanel10, UpdatePanel10.GetType(), "show", "$(function () { $('#" + Panel9.ClientID + "').modal('show'); });", true); UpdatePanel10.Update(); } catch (Exception ex) { divAlerta.Visible = true; lblInfo.Text = ex.Message; } }
protected void SummitWorkOrder_Click(object sender, EventArgs e) { int a = dp.Update_State_Setup(new Guid(PPID.Text)); ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", a == 1 ? "alert('提交成功!')" : "alert('提交失败!')", true); Panel9.Visible = false; Panel10.Visible = false; GridView1.DataSource = dp.Query_DefectProduct(new Guid(PPID.Text)); GridView1.DataBind(); Panel2.Visible = true; UpdatePanel2.Update(); UpdatePanel9.Update(); UpdatePanel10.Update(); GridView1.Enabled = true; }
protected void GridView6_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Choose") { var row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView6.SelectedIndex = row.RowIndex; int a = hd.CopyReport(new Guid(VersionID.Text), new Guid(e.CommandArgument.ToString()), Session["UserName"].ToString()); if (a > 0) { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('报告添加成功!')", true); Panel10.Visible = false; UpdatePanel10.Update(); } else { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('失败了诶...')", true); Panel10.Visible = false; UpdatePanel10.Update(); } Bindgrid2(); } }
protected void CloseOEM_Click(object sender, EventArgs e) { Panel10.Visible = false; UpdatePanel10.Update(); }
protected void SearchCopy_Click(object sender, EventArgs e) { GridView6.DataSource = hd.QueryReportDue(TextBox60.Text, TextBox61.Text, TextBox62.Text); GridView6.DataBind(); UpdatePanel10.Update(); }
protected void GridView2_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "ED") { var row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView2.SelectedIndex = row.RowIndex; VersionID.Text = e.CommandArgument.ToString(); addedit.Text = "修改"; TextBox4.Text = row.Cells[1].Text; TextBox10.Text = row.Cells[3].Text; Panel7.Visible = true; UpdatePanel7.Update(); UpdatePanel2.Update(); UpdatePanel3.Update(); } if (e.CommandName == "Copy") { var row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView2.SelectedIndex = row.RowIndex; VersionID.Text = e.CommandArgument.ToString(); GridView6.DataSource = hd.QueryReportDue(TextBox60.Text, TextBox61.Text, TextBox62.Text); GridView6.DataBind(); Panel10.Visible = true; UpdatePanel10.Update(); } if (e.CommandName == "De") { int a = hd.DeleteVersion(new Guid(e.CommandArgument.ToString())); if (a > 0) { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('删除成功!');", true); } else { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('失败了诶...');", true); } GridView2.DataSource = hd.QueryVersion(new Guid(e.CommandArgument.ToString())); GridView2.DataBind(); UpdatePanel3.Update(); } if (e.CommandName == "up") { var row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView2.SelectedIndex = row.RowIndex; Console.Write(""); Label1.Text = "新增"; VersionID.Text = e.CommandArgument.ToString(); Panel8.Visible = true; UpdatePanel8.Update(); UpdatePanel2.Update(); UpdatePanel3.Update(); } if (e.CommandName == "report") { var row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView2.SelectedIndex = row.RowIndex; VersionID.Text = e.CommandArgument.ToString(); GridView3.DataSource = hd.QueryReport(new Guid(VersionID.Text)); GridView3.DataBind(); Panel4.Visible = true; UpdatePanel4.Update(); } if (e.CommandName == "detail") { var row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView2.SelectedIndex = row.RowIndex; VersionID.Text = e.CommandArgument.ToString(); GridView5.DataSource = hd.QueryDetail(new Guid(VersionID.Text), Guid.Empty); GridView5.DataBind(); Panel6.Visible = true; UpdatePanel6.Update(); } }
protected void ChooseWorkOrder_Click(object sender, EventArgs e) { if (TextBox9.Text == "" || TextBox11.Text == "") { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('标记*的为必填项,请填写完整!')", true); return; } if (Label1.Text != "未选择" && Label3.Text != "未选择" && Label5.Text != "未选择" && Label27.Text != "未选择") { var num = Decimal.Parse(TextBox9.Text); var description = TextBox11.Text; var type = new Guid(typeid.Text); var cra = new Guid(craid.Text); var po = new Guid(poid.Text); var dep = depid.Text; if (switchlabel.Text == "新增") { try { var ppidGuid = dp.Insert_DefectProduct(type, cra, po, dep, num, description, Session["UserName"].ToString()); Panel9.Visible = true; Panel10.Visible = true; Panel3.Visible = false; string[] depart = dep.Split(','); foreach (string s in depart) { dp.Insert_DefectDep(ppidGuid, s); } PPID.Text = ppidGuid.ToString(); Panel9.Visible = true; Panel10.Visible = true; GridView5.DataSource = dp.Query_WorkOrder(TextBox20.Text); GridView5.DataBind(); UpdatePanel9.Update(); UpdatePanel10.Update(); GridView1.Enabled = false; } catch (Exception exception) { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('新增失败!')", true); } } else { try { Guid pp = new Guid(PPID.Text); dp.Update_DefectProduct(pp, type, cra, po, dep, num, description, Session["UserName"].ToString()); Panel9.Visible = true; Panel10.Visible = true; Panel3.Visible = false; string[] depart = dep.Split(','); int a = dp.ClearDefectDep(pp); foreach (string s in depart) { dp.Insert_DefectDep(pp, s); } PPID.Text = pp.ToString(); Panel9.Visible = true; Panel10.Visible = true; GridView5.DataSource = dp.Query_WorkOrder(TextBox20.Text); GridView5.DataBind(); UpdatePanel9.Update(); UpdatePanel10.Update(); GridView1.Enabled = false; } catch (Exception exception) { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('更新失败!')", true); } } } else { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('还有未选择的项目呢!')", true); } }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "setorder") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView1.SelectedIndex = row.RowIndex; PPID.Text = e.CommandArgument.ToString(); Panel9.Visible = true; Panel10.Visible = true; GridView4.DataSource = dp.Query_ConnectedWorkOrder(new Guid(PPID.Text)); GridView4.DataBind(); GridView5.DataSource = dp.Query_WorkOrder(TextBox20.Text); GridView5.DataBind(); UpdatePanel9.Update(); UpdatePanel10.Update(); } if (e.CommandName == "getorder") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView1.SelectedIndex = row.RowIndex; PPID.Text = e.CommandArgument.ToString(); Panel9.Visible = false; Panel10.Visible = false; Panel12.Visible = true; GridView9.DataSource = dp.Query_ConnectedWorkOrder(new Guid(PPID.Text)); GridView9.DataBind(); UpdatePanel12.Update(); UpdatePanel10.Update(); UpdatePanel9.Update(); } if (e.CommandName == "setview") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView1.SelectedIndex = row.RowIndex; PPID.Text = e.CommandArgument.ToString(); DropDownList3.Items.Clear(); SqlDataReader myReader = dp.Query_CapableDep(new Guid(PPID.Text)); SqlDataReader myReader2 = dp.Query_CapableDepDone(new Guid(PPID.Text)); while (myReader.Read()) { string a = myReader["BDOS_Name"].ToString(); if (Session["Department"].ToString().Contains(myReader["BDOS_Name"].ToString())) { DropDownList3.Items.Add(new ListItem(myReader["BDOS_Name"].ToString(), myReader["PPDS_ID"].ToString()));//增加Item } } while (myReader2.Read()) { ListItem li = DropDownList3.Items.FindByText(myReader2["BDOS_Name"].ToString()); DropDownList3.Items.Remove(li); } if (DropDownList3.Items.Count > 0) { Panel11.Visible = true; UpdatePanel11.Update(); } else { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('处理意见已填写或您没有相应的权限!')", true); } } if (e.CommandName == "getview") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView1.SelectedIndex = row.RowIndex; PPID.Text = e.CommandArgument.ToString(); GridView10.DataSource = dp.GetAuditSuggest(new Guid(PPID.Text)); GridView10.DataBind(); Panel15.Visible = true; UpdatePanel15.Update(); } if (e.CommandName == "track") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView1.SelectedIndex = row.RowIndex; PPID.Text = e.CommandArgument.ToString(); Panel13.Visible = true; Panel14.Visible = false; Panel15.Visible = false; UpdatePanel13.Update(); UpdatePanel14.Update(); UpdatePanel15.Update(); } if (e.CommandName == "audit") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView1.SelectedIndex = row.RowIndex; PPID.Text = e.CommandArgument.ToString(); GridView8.DataSource = dp.GetAuditSuggest(new Guid(PPID.Text)); GridView8.DataBind(); Panel14.Visible = true; UpdatePanel14.Update(); } if (e.CommandName == "mod") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView1.SelectedIndex = row.RowIndex; switchlabel.Text = "修改"; PPID.Text = e.CommandArgument.ToString(); Panel3.Visible = true; UpdatePanel3.Update(); UpdatePanel4.Update(); } if (e.CommandName == "del") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView1.SelectedIndex = row.RowIndex; PPID.Text = e.CommandArgument.ToString(); dp.Delete_DefectProduct(new Guid(PPID.Text)); GridView1.DataSource = dp.Query_DefectProduct(); GridView1.DataBind(); Panel4.Visible = false; Panel10.Visible = false; Panel14.Visible = false; UpdatePanel2.Update(); UpdatePanel3.Update(); UpdatePanel4.Update(); UpdatePanel10.Update(); UpdatePanel14.Update(); } }
protected void GridView3_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Modify") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView3.SelectedIndex = row.RowIndex; Guid bdid = new Guid(e.CommandArgument.ToString()); Label32.Text = Label4.Text; Label34.Text = row.Cells[12].Text; Label35.Text = row.Cells[3].Text; Label36.Text = row.Cells[1].Text; Label37.Text = row.Cells[2].Text; Label38.Text = row.Cells[11].Text; Label33.Text = bdid.ToString(); TextBox14.Text = row.Cells[4].Text; TextBox15.Text = row.Cells[5].Text; DropDownList3.Items.Clear(); FuseText.Visible = false; DropDownList4.Visible = false; SqlDataReader myReader = bom.Query_MUnit(new Guid(Label38.Text)); UnitCheck.Visible = true; while (myReader.Read()) { DropDownList3.Items.Add(new ListItem(myReader["UnitName"].ToString(), myReader["UnitID"].ToString()));//增加Item } DropDownList3.SelectedIndex = DropDownList3.Items.IndexOf(DropDownList3.Items.FindByText(row.Cells[6].Text)); TextBox17.Text = row.Cells[9].Text; try { Guid CraID = bom.Query_PBCID(row.Cells[3].Text); Label34.Text = CraID.ToString(); Label35.Text = row.Cells[3].Text; } catch { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('工序名有重复,请手动选择工序!')", true); } Label31.Text = "修改"; Panel41.Visible = true; Panel5.Visible = false; Panel51.Visible = false; Panel52.Visible = false; Panel53.Visible = false; Panel6.Visible = false; Panel8.Visible = false; UpdatePanel8.Update(); UpdatePanel6.Update(); UpdatePanel5.Update(); UpdatePanel4.Update(); } if (e.CommandName == "AddMate") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView3.SelectedIndex = row.RowIndex; Guid bdid = new Guid(e.CommandArgument.ToString()); Label33.Text = bdid.ToString(); Label34.Text = row.Cells[12].Text; Label35.Text = row.Cells[3].Text; Label36.Text = "请选择物料"; Label37.Text = "请选择物料"; TextBox14.Text = ""; TextBox15.Text = ""; TextBox17.Text = ""; TextBox21.Text = row.Cells[1].Text; FuseText.Visible = true; DropDownList4.Visible = true; DropDownList4.SelectedIndex = DropDownList4.Items.IndexOf(DropDownList4.Items.FindByText("否")); DropDownList4.Enabled = true; DropDownList3.SelectedIndex = DropDownList3.Items.IndexOf(DropDownList3.Items.FindByText(row.Cells[6].Text)); Label31.Text = "新增可替用物料"; Panel41.Visible = true; Panel5.Visible = false; Panel51.Visible = false; Panel52.Visible = false; Panel53.Visible = false; Panel6.Visible = false; Panel8.Visible = false; UpdatePanel8.Update(); UpdatePanel6.Update(); UpdatePanel5.Update(); UpdatePanel4.Update(); } if (e.CommandName == "AddFuse") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView3.SelectedIndex = row.RowIndex; FuseText.Visible = true; DropDownList4.Visible = true; DropDownList4.SelectedIndex = DropDownList4.Items.IndexOf(DropDownList4.Items.FindByText("是")); DropDownList4.Enabled = false; Guid bdid = new Guid(e.CommandArgument.ToString()); Label33.Text = bdid.ToString(); Label34.Text = row.Cells[12].Text; Label35.Text = row.Cells[3].Text; Label36.Text = "请选择物料"; Label37.Text = "请选择物料"; TextBox14.Text = ""; TextBox15.Text = ""; TextBox17.Text = ""; TextBox21.Text = row.Cells[1].Text; FuseID.Text = row.Cells[14].ToolTip; MateID.Text = row.Cells[19].Text; DropDownList3.SelectedIndex = DropDownList3.Items.IndexOf(DropDownList3.Items.FindByText(row.Cells[6].Text)); Label31.Text = "新增组合物料成员"; Panel41.Visible = true; Panel5.Visible = false; Panel51.Visible = false; Panel52.Visible = false; Panel53.Visible = false; Panel6.Visible = false; Panel8.Visible = false; UpdatePanel8.Update(); UpdatePanel6.Update(); UpdatePanel5.Update(); UpdatePanel4.Update(); } if (e.CommandName == "Delete") { Guid id = new Guid(e.CommandArgument.ToString()); bom.Delete_BOMDetail(id); Guid BOM_ID = new Guid(Label3.Text); GridView3.DataSource = bom.Query_BOMDetail(BOM_ID); GridView3.DataBind(); Panel41.Visible = false; Panel5.Visible = false; Panel51.Visible = false; Panel6.Visible = false; Panel8.Visible = false; UpdatePanel8.Update(); UpdatePanel6.Update(); UpdatePanel5.Update(); UpdatePanel4.Update(); } if (e.CommandName == "AddPercent") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView3.SelectedIndex = row.RowIndex; Panel8.Visible = true; GridView8.DataSource = bom.Query_MatePercent(new Guid(e.CommandArgument.ToString())); GridView8.DataBind(); Panel41.Visible = false; Panel5.Visible = false; Panel51.Visible = false; Panel52.Visible = false; Panel53.Visible = false; Panel6.Visible = false; UpdatePanel6.Update(); UpdatePanel5.Update(); UpdatePanel4.Update(); UpdatePanel8.Update(); } if (e.CommandName == "history") { GridView10.DataSource = bom.Query_BOMDetailHistory(new Guid(e.CommandArgument.ToString())); GridView10.DataBind(); Panel10.Visible = true; UpdatePanel10.Update(); } }
protected void closehistory_Click(object sender, EventArgs e) { Panel10.Visible = false; UpdatePanel10.Update(); }