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 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_Batch_RowCommand(object sender, GridViewCommandEventArgs e) //材料批号信息表操作 { if (e.CommandName == "deleteBatch") //删除材料批号 { //try //{ GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; // GridView_BasicBatch.SelectedIndex = row.RowIndex; string[] al = e.CommandArgument.ToString().Split(new char[] { ',' }); string wOMBN_ID = al[0]; wol.D_WOMBatchNum(new Guid(wOMBN_ID)); ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "alert", "alert('删除成功!')", true); 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(); //} //catch (Exception) //{ // ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "alert", "alert('删除失败!')", true); // return; //} } }
protected void GridView_Batch_PageIndexChanging(object sender, GridViewPageEventArgs e) //随工单的批号表翻页 { GridView theGrid = sender as GridView; // refer to the GridView int newPageIndex = 0; GridView_Batch.SelectedIndex = -1; if (-2 == e.NewPageIndex) { TextBox txtNewPageIndex = null; GridViewRow pagerRow = GridView_Batch.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_Batch.PageCount ? GridView_Batch.PageCount - 1 : newPageIndex; GridView_Batch.PageIndex = newPageIndex; this.GridView_Batch.PageIndex = newPageIndex; 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(); }