protected void Btn_Close_ChooseBatch_Click(object sender, EventArgs e) { Panel_Batch.Visible = false; Panel_MBatch.Visible = false; UpdatePanel_Batch.Update(); UpdatePanel_MBatch.Update(); }
protected void GridView_BasicBatch_RowCommand(object sender, GridViewCommandEventArgs e) //选择库存中的批号至随工单批号表 { if (e.CommandName == "ChoseBatchToWO") //选择订单号 { try { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; // GridView_BasicBatch.SelectedIndex = row.RowIndex; string[] al = e.CommandArgument.ToString().Split(new char[] { ',' }); string iMID_BatchNum = al[1]; wol.I_WOMBatchNum(new Guid(this.Label_iMMBD_MaterialID.Text), new Guid(this.Label_WOID.Text), iMID_BatchNum); ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "alert", "alert('批号添加成功!')", true); Panel_MBatch.Visible = false; UpdatePanel_MBatch.Update(); GridView_Batch.DataSource = wol.S_WOMBatchNum(new Guid(this.Label_iMMBD_MaterialID.Text), new Guid(this.Label_WOID.Text)); GridView_Batch.DataBind(); UpdatePanel_Batch.Update(); databind(); } catch (Exception) { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "alert", "alert('批号添加失败!')", true); return; } } }
protected void Button_SearchBatch_Click(object sender, EventArgs e) { string condition = this.TextBox_MBatch.Text.Trim() == "" ? " and 1=1 " : " and IMID_BatchNum like '%" + this.TextBox_MBatch.Text.Trim() + "%' "; GridView_BasicBatch.DataSource = wol.S_WOMBatchNum_IMInventoryDetail(" and c.IMMBD_MaterialID='" + this.Label_iMMBD_MaterialID.Text + "' and IMID_BatchNum not in ( select WOMBN_BN from WOMBatchNum d where d.WO_ID='" + this.Label_WOID.Text + "' and d.IMMBD_MaterialID ='" + this.Label_iMMBD_MaterialID.Text + "')" + condition); GridView_BasicBatch.DataBind(); UpdatePanel_MBatch.Update(); }
protected void Button_ChooseBatch_Click(object sender, EventArgs e) { TextBox_MBatch.Text = ""; Panel_MBatch.Visible = true; GridView_BasicBatch.DataSource = wol.S_WOMBatchNum_IMInventoryDetail(" and c.IMMBD_MaterialID='" + this.Label_iMMBD_MaterialID.Text + "' and IMID_BatchNum not in ( select WOMBN_BN from WOMBatchNum d where d.WO_ID='" + this.Label_WOID.Text + "' and d.IMMBD_MaterialID ='" + this.Label_iMMBD_MaterialID.Text + "')"); GridView_BasicBatch.DataBind(); UpdatePanel_MBatch.Update(); }
protected void Btn_AddWO_Click(object sender, EventArgs e) { string firstday = "26"; Label_OT.Text = ""; DataSet ds = ppd.S_WorkOrder_WO_Time(); DataView dv = ds.Tables[0].DefaultView; if (ds.Tables[0].Rows.Count == 0) { firstday = "26"; } foreach (DataRowView datav in dv) { firstday = datav["WO_FirstDay"].ToString().Trim() == "" ? "26" : datav["WO_FirstDay"].ToString().Trim(); } DropDownList4.SelectedValue = firstday; DropDownList2.SelectedIndex = 0; DropDownList3.SelectedIndex = 0; DropDownList_Add_WO_Type.SelectedIndex = 0; TextBox_AddPT.Text = ""; TextBox_Add_PNum.Text = ""; TextBox_Add_Order.Text = ""; TextBox_Add_SN.Text = ""; TextBox_AddNote.Text = ""; DropDownList1.SelectedIndex = 0; Panel_AddWorkOrder.Visible = true; UpdatePanel_AddWorkOrder.Update(); Panel_basic.Visible = false; UpdatePanel_basic.Update(); this.Panel_Product_Search.Visible = false; this.Panel_Product.Visible = false; this.UpdatePanel_Product.Update(); //无关隐藏 this.TextBox_Series.Text = ""; this.TextBox_ProductName.Text = ""; this.Panel_Product_Search.Visible = false; this.Panel_Product.Visible = false; this.UpdatePanel_Product.Update(); TextBox_ComOrderNum.Text = ""; TextBox_CustOrder.Text = ""; Panel_SelectOrder.Visible = false; UpdatePanel_SelectOrder.Update(); Panel_basic.Visible = false; UpdatePanel_basic.Update(); TextBox_MBatch.Text = ""; Panel_MBatch.Visible = false; UpdatePanel_MBatch.Update(); Panel_Batch.Visible = false; UpdatePanel_Batch.Update(); }
protected void GridView_WOmain_PageIndexChanging(object sender, GridViewPageEventArgs e) //随工单主表分页 { GridView theGrid = sender as GridView; // refer to the GridView int newPageIndex = 0; GridView_WOmain.SelectedIndex = -1; if (-2 == e.NewPageIndex) { TextBox txtNewPageIndex = null; GridViewRow pagerRow = GridView_WOmain.BottomPagerRow; if (null != pagerRow) { txtNewPageIndex = (TextBox)pagerRow.FindControl("textbox"); } if (null != txtNewPageIndex && txtNewPageIndex.Text != "") { newPageIndex = int.Parse(txtNewPageIndex.Text) - 1; } } else { newPageIndex = e.NewPageIndex; } newPageIndex = newPageIndex < 0 ? 0 : newPageIndex; newPageIndex = newPageIndex >= GridView_WOmain.PageCount ? GridView_WOmain.PageCount - 1 : newPageIndex; GridView_WOmain.PageIndex = newPageIndex; this.GridView_WOmain.PageIndex = newPageIndex; databind(); this.TextBox_Series.Text = ""; this.TextBox_ProductName.Text = ""; this.Panel_Product_Search.Visible = false; this.Panel_Product.Visible = false; this.UpdatePanel_Product.Update(); TextBox_ComOrderNum.Text = ""; TextBox_CustOrder.Text = ""; Panel_SelectOrder.Visible = false; UpdatePanel_SelectOrder.Update(); Panel_basic.Visible = false; UpdatePanel_basic.Update(); TextBox_MBatch.Text = ""; Panel_MBatch.Visible = false; UpdatePanel_MBatch.Update(); Panel_Batch.Visible = false; UpdatePanel_Batch.Update(); }
protected void Btn_Close_ChooseBatch0_Click(object sender, EventArgs e) { Panel_basic.Visible = false; UpdatePanel_basic.Update(); TextBox_MBatch.Text = ""; Panel_MBatch.Visible = false; UpdatePanel_MBatch.Update(); Panel_Batch.Visible = false; UpdatePanel_Batch.Update(); }
protected void GridView_bom_RowCommand(object sender, GridViewCommandEventArgs e) //BOM查看批号 { if (e.CommandName == "Batch_Num") //查看批号 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView_bom.SelectedIndex = row.RowIndex; string[] al = e.CommandArgument.ToString().Split(new char[] { ',' }); Guid iMMBD_MaterialID = new Guid(al[1]); this.Label_iMMBD_MaterialID.Text = al[1]; Guid woid = new Guid(this.Label_WOID.Text.Trim()); Panel_Batch.Visible = true; Panel_MBatch.Visible = false; UpdatePanel_MBatch.Update(); GridView_Batch.DataSource = wol.S_WOMBatchNum(iMMBD_MaterialID, woid); GridView_Batch.DataBind(); UpdatePanel_Batch.Update(); } }
protected void GridView_BasicBatch_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView theGrid = sender as GridView; // refer to the GridView int newPageIndex = 0; GridView_BasicBatch.SelectedIndex = -1; if (-2 == e.NewPageIndex) { TextBox txtNewPageIndex = null; GridViewRow pagerRow = GridView_BasicBatch.BottomPagerRow; if (null != pagerRow) { txtNewPageIndex = (TextBox)pagerRow.FindControl("textbox"); } if (null != txtNewPageIndex && txtNewPageIndex.Text != "") { newPageIndex = int.Parse(txtNewPageIndex.Text) - 1; } } else { newPageIndex = e.NewPageIndex; } newPageIndex = newPageIndex < 0 ? 0 : newPageIndex; newPageIndex = newPageIndex >= GridView_BasicBatch.PageCount ? GridView_BasicBatch.PageCount - 1 : newPageIndex; GridView_BasicBatch.PageIndex = newPageIndex; string condition = this.TextBox_MBatch.Text.Trim() == "" ? " and 1=1 " : " and IMID_BatchNum like '%" + this.TextBox_MBatch.Text.Trim() + "%' "; GridView_BasicBatch.DataSource = wol.S_WOMBatchNum_IMInventoryDetail(" and c.IMMBD_MaterialID='" + this.Label_iMMBD_MaterialID.Text + "' and IMID_BatchNum not in ( select WOMBN_BN from WOMBatchNum d where d.WO_ID='" + this.Label_WOID.Text + "' and d.IMMBD_MaterialID ='" + this.Label_iMMBD_MaterialID.Text + "')" + condition); GridView_BasicBatch.DataBind(); UpdatePanel_MBatch.Update(); }
protected void GridView_WOmain_RowCommand(object sender, GridViewCommandEventArgs e) //随工单主表行命令 { if (e.CommandName == "BasicInfo") //查看产品基础信息,包括BOM、工艺路线等 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView_WOmain.SelectedIndex = row.RowIndex; GridView_WOmain.SelectedIndex = -1; string[] al = e.CommandArgument.ToString().Split(new char[] { ',' }); this.Label_WOID.Text = al[0]; string ptname = al[1]; Label_Type.Text = al[2]; if (al[2].Trim() == "检验") { this.GridView_Pr.DataSource = wol.S_WO_ProType_ProcessRoute(ptname, 1); this.GridView_Pr.DataBind(); // this.GridView_Pr.Columns[2].Visible = false; Label20.Text = "以下为检验随工单的工艺路线,与常规产品路线不同,蓝色表示需要认证的工序,认证合格后才能进行非蓝色工序"; } else { this.GridView_Pr.DataSource = wol.S_WO_ProType_ProcessRoute(ptname, 0); this.GridView_Pr.DataBind(); this.GridView_Pr.Columns[3].Visible = false; this.GridView_Pr.Columns[4].Visible = false; Label20.Text = ""; } this.Label_PT.Text = ptname; Panel_basic.Visible = true; this.GridView_bom.DataSource = wol.S_ProType_BOM(ptname); this.GridView_bom.DataBind(); DataSet ds1 = wol.S_ProType_TestParameter(ptname); DataView dv1 = ds1.Tables[0].DefaultView; foreach (DataRowView datav in dv1) { this.TextBox_TestParameter.Text = datav["PT_Parameters"].ToString().Trim(); } UpdatePanel_basic.Update(); //无关信息隐藏 this.TextBox_Series.Text = ""; this.TextBox_ProductName.Text = ""; this.Panel_Product_Search.Visible = false; this.Panel_Product.Visible = false; this.UpdatePanel_Product.Update(); Panel_MBatch.Visible = false; UpdatePanel_MBatch.Update(); Panel_Batch.Visible = false; UpdatePanel_Batch.Update(); } if (e.CommandName == "Deleted")//删除主表 { try { wol.D_WorkOrder(new Guid(e.CommandArgument.ToString().Trim())); } catch { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "alert", "alert('随工单失败,原因可能是由于已经制定了该随工单更进一步的信息!')", true); return; } // this.DropDownList_level.SelectedIndex = 0; this.DropDownList_WO_Type.SelectedIndex = 0; this.DropDownList_WoState.SelectedIndex = 0; this.TextBox_chipnum.Text = ""; this.TextBox_OrderNum.Text = ""; this.TextBox_WO_Num.Text = ""; this.TextBox_WO_People.Text = ""; this.TextBox_WO_ProType.Text = ""; this.TextBox_WO_Time1.Text = ""; this.TextBox_WO_Time2.Text = ""; this.TextBox_WOSN.Text = ""; Panel_basic.Visible = false; UpdatePanel_basic.Update(); Panel_MBatch.Visible = false; UpdatePanel_MBatch.Update(); Panel_Batch.Visible = false; UpdatePanel_Batch.Update(); string condition = " and 1=1"; this.GridView_WOmain.DataSource = wol.S_WorkOrder(condition); this.GridView_WOmain.DataBind(); this.UpdatePanel_WOmain.Update(); } if (e.CommandName == "materialsheet")//查看产品基础信息,包括BOM、工艺路线等 { string[] al = e.CommandArgument.ToString().Split(new char[] { ',' }); Response.Redirect("./materialsheet.aspx?WO_ID=" + al[0] + "&WO_Num=" + al[1] + "&SMSO_ComOrderNum=" + al[2] + "&WO_ProType=" + al[3] + "&WO_PNum=" + al[4] + "&WO_Level=" + al[5] + "&WO_Type=" + al[6] + "&WO_People=" + al[7] + "&WO_Time=" + al[8]); } if (e.CommandName == "editWorkWorder")//修改主表 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView_WOmain.SelectedIndex = row.RowIndex; string[] al = e.CommandArgument.ToString().Split(new char[] { ',' }); this.Label_EditWOID.Text = al[0]; this.TextBox_EditNum.Text = al[1]; this.Label_EditWONum.Text = al[1]; this.Label_EditPTID.Text = al[6]; this.Label_EditOrderNum.Text = al[7]; this.TextBox_EditProType.Text = al[2]; this.TextBox_EditOrderNum.Text = al[3]; this.TextBox_EditNote.Text = al[4]; this.TextBox_EditSN.Text = al[5]; this.Panel_EditWorkOrder.Visible = true; this.UpdatePanel_EditWorkOrder.Update(); } if (e.CommandName == "printpreview")//打印 { string[] al = e.CommandArgument.ToString().Split(new char[] { ',' }); //if (al[5].Contains("SMSC")) //{ Response.Redirect("../ProductionProcess/SMSCWOPrint.aspx?" + "&WO_Num=" + al[1] + "&WO_Type=" + al[2] + "&SMSO_CusOrderNum=" + al[3] + "&SMSO_PlaceOrderTime=" + al[4] + "&WO_SN=" + al[6] + "&CB=" + al[7] + "&PS=" + al[5] + "&WO_ProType=" + al[8] ); //} //else //{ // ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "alert", "alert('系统试用阶段仅支持SMSC系统产品的打印!')", true); //} } }