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; GridView_WOmain.PageIndex = newPageIndex; databind(); //以下pannel隐藏 Panel_ErrorList.Visible = false; UpdatePanel_ErrorList.Update(); Panel_M.Visible = false; UpdatePanel_M.Update(); Panel_Error.Visible = false; UpdatePanel_Error.Update(); Panel_Track.Visible = false; UpdatePanel_Track.Update(); Panel_C.Visible = false; UpdatePanel_C.Update(); Panel_Recover.Visible = false; UpdatePanel_Recover.Update(); Panel_Review.Visible = false; UpdatePanel_Review.Update(); Panel_ReWork.Visible = false; UpdatePanel_ReWork.Update(); }
protected void GridView_WOmain_RowCommand(object sender, GridViewCommandEventArgs e) //随工单表行按钮 { if (e.CommandName == "ErrorInfo") // { 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[] { ',' }); label_wodid.Text = al[1]; Panel_ErrorList.Visible = true; string id; if (al[1].Trim() == "") { id = "00000000-0000-0000-0000-000000000000"; } else { id = al[1]; } GridView_Error.DataSource = erl.S_WorkOrderDetail_ErrorCheck(new Guid(id)); GridView_Error.DataBind(); UpdatePanel_ErrorList.Update(); //以下pannel隐藏 // Panel_ErrorList.Visible = false; // UpdatePanel_ErrorList.Update(); Panel_M.Visible = false; UpdatePanel_M.Update(); Panel_Error.Visible = false; UpdatePanel_Error.Update(); Panel_Track.Visible = false; UpdatePanel_Track.Update(); Panel_C.Visible = false; UpdatePanel_C.Update(); Panel_Recover.Visible = false; UpdatePanel_Recover.Update(); Panel_Review.Visible = false; UpdatePanel_Review.Update(); } }
protected void Button_Cancel_Click(object sender, EventArgs e)//重置 { DropDownList_level.SelectedIndex = 0; DropDownList_WO_Type.SelectedIndex = 0; DropDownList_WoState.SelectedIndex = 0; TextBox_chipnum.Text = ""; TextBox_OrderNum.Text = ""; TextBox_wonum.Text = ""; TextBox_PBC.Text = ""; TextBox_pt.Text = ""; TextBox_WO_Time1.Text = ""; TextBox_WO_Time2.Text = ""; TextBox_WOSN.Text = ""; string condition = " and 1=1"; GridView_WOmain.DataSource = erl.S_WorkOrder_Check(condition); GridView_WOmain.DataBind(); UpdatePanel_WOmain.Update(); GridView_WOmain.SelectedIndex = -1; GridView_Error.SelectedIndex = -1; //以下pannel隐藏 Panel_ErrorList.Visible = false; UpdatePanel_ErrorList.Update(); Panel_M.Visible = false; UpdatePanel_M.Update(); Panel_Error.Visible = false; UpdatePanel_Error.Update(); Panel_Track.Visible = false; UpdatePanel_Track.Update(); Panel_C.Visible = false; UpdatePanel_C.Update(); Panel_Recover.Visible = false; UpdatePanel_Recover.Update(); Panel_Review.Visible = false; UpdatePanel_Review.Update(); Panel_ReWork.Visible = false; UpdatePanel_ReWork.Update(); }
protected void GridView_Error_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "cailiao")//材料检验 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView_Error.SelectedIndex = row.RowIndex; label_M_WOEID.Text = e.CommandArgument.ToString(); Panel_M.Visible = true; DataSet ds1 = erl.S_WOError(new Guid(label_M_WOEID.Text.Trim())); DataView dv1 = ds1.Tables[0].DefaultView; foreach (DataRowView datav in dv1) { TextBox_MM.Text = datav["WOE_MQCPeople"].ToString().Trim(); TextBox_MT.Text = datav["WOE_MQCTime"].ToString().Trim() == "" ? "" : Convert.ToDateTime(datav["WOE_MQCTime"].ToString().Trim()).ToString("yyyy-MM-dd HH:mm"); TextBox_MR.Text = datav["WOE_MQCResult"].ToString().Trim(); } UpdatePanel_M.Update(); //以下pannel隐藏 // Panel_ErrorList.Visible = false; // UpdatePanel_ErrorList.Update(); // Panel_M.Visible = false; // UpdatePanel_M.Update(); Panel_Error.Visible = false; UpdatePanel_Error.Update(); Panel_Track.Visible = false; UpdatePanel_Track.Update(); Panel_C.Visible = false; UpdatePanel_C.Update(); Panel_Recover.Visible = false; UpdatePanel_Recover.Update(); Panel_Review.Visible = false; UpdatePanel_Review.Update(); Panel_ReWork.Visible = false; UpdatePanel_ReWork.Update(); } if (e.CommandName == "chuli")//处理 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView_Error.SelectedIndex = row.RowIndex; label_ED_WOEID.Text = e.CommandArgument.ToString(); Panel_Error.Visible = true; DataSet ds2 = erl.S_WOError(new Guid(label_ED_WOEID.Text.Trim())); DataView dv2 = ds2.Tables[0].DefaultView; foreach (DataRowView datav in dv2) { TextBox_DealMan.Text = datav["WOE_DealMan"].ToString().Trim(); TextBox_DealTime.Text = datav["WOE_DealTime"].ToString().Trim() == "" ? "" : Convert.ToDateTime(datav["WOE_DealTime"].ToString().Trim()).ToString("yyyy-MM-dd HH:mm"); TextBox_ReaAnalysis.Text = datav["WOE_ReaAnalysis"].ToString().Trim(); TextBox_ProDeal.Text = datav["WOE_ProDeal"].ToString().Trim(); TextBox_LongTimeMeasure.Text = datav["WOE_LongTimeMeasure"].ToString().Trim(); } UpdatePanel_Error.Update(); //以下pannel隐藏 // Panel_ErrorList.Visible = false; // UpdatePanel_ErrorList.Update(); Panel_M.Visible = false; UpdatePanel_M.Update(); // Panel_Error.Visible = false; // UpdatePanel_Error.Update(); Panel_Track.Visible = false; UpdatePanel_Track.Update(); Panel_C.Visible = false; UpdatePanel_C.Update(); Panel_Recover.Visible = false; UpdatePanel_Recover.Update(); Panel_Review.Visible = false; UpdatePanel_Review.Update(); Panel_ReWork.Visible = false; UpdatePanel_ReWork.Update(); } if (e.CommandName == "genzhong")//跟踪 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView_Error.SelectedIndex = row.RowIndex; label_Track_WOEID.Text = e.CommandArgument.ToString(); Panel_Track.Visible = true; DataSet ds3 = erl.S_WOError(new Guid(label_Track_WOEID.Text.Trim())); DataView dv3 = ds3.Tables[0].DefaultView; foreach (DataRowView datav in dv3) { TextBox_TrackMan.Text = datav["WOE_TrackMan"].ToString().Trim(); TextBox_TrackTime.Text = datav["WOE_TrackTime"].ToString().Trim() == "" ? "" : Convert.ToDateTime(datav["WOE_TrackTime"].ToString().Trim()).ToString("yyyy-MM-dd HH:mm"); TextBox_TrackResult.Text = datav["WOE_TrackResult"].ToString().Trim(); } UpdatePanel_Track.Update(); //以下pannel隐藏 // Panel_ErrorList.Visible = false; // UpdatePanel_ErrorList.Update(); Panel_M.Visible = false; UpdatePanel_M.Update(); Panel_Error.Visible = false; UpdatePanel_Error.Update(); // Panel_Track.Visible = false; // UpdatePanel_Track.Update(); Panel_C.Visible = false; UpdatePanel_C.Update(); Panel_Recover.Visible = false; UpdatePanel_Recover.Update(); Panel_Review.Visible = false; UpdatePanel_Review.Update(); Panel_ReWork.Visible = false; UpdatePanel_ReWork.Update(); } if (e.CommandName == "sh")//审核 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView_Error.SelectedIndex = row.RowIndex; string[] al = e.CommandArgument.ToString().Split(new char[] { ',' }); string zl = al[1]; if (zl.Trim() == "一级质量问题") { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('一级质量问题不需要审核!')", true); //以下pannel隐藏 // Panel_ErrorList.Visible = false; // UpdatePanel_ErrorList.Update(); Panel_M.Visible = false; UpdatePanel_M.Update(); Panel_Error.Visible = false; UpdatePanel_Error.Update(); Panel_Track.Visible = false; UpdatePanel_Track.Update(); Panel_C.Visible = false; UpdatePanel_C.Update(); Panel_Recover.Visible = false; UpdatePanel_Recover.Update(); // Panel_Review.Visible = false; // UpdatePanel_Review.Update(); return; } label_SH_WOEID.Text = al[0]; Panel_Review.Visible = true; DataSet ds4 = erl.S_WOError(new Guid(al[0].Trim())); DataView dv4 = ds4.Tables[0].DefaultView; foreach (DataRowView datav in dv4) { TextBox_ReviewMan.Text = datav["WOE_ReviewMan"].ToString().Trim(); TextBox_ReviewTime.Text = datav["WOE_ReviewTime"].ToString().Trim() == "" ? "" : Convert.ToDateTime(datav["WOE_ReviewTime"].ToString().Trim()).ToString("yyyy-MM-dd HH:mm"); TextBox_ReviewSuggestion.Text = datav["WOE_ReviewSuggestion"].ToString().Trim(); if (datav["WOE_RResult"].ToString().Trim() == "") { DropDownList_RResult.SelectedIndex = 0; } else { DropDownList_RResult.SelectedValue = datav["WOE_RResult"].ToString().Trim(); } } UpdatePanel_Review.Update(); //以下pannel隐藏 // Panel_ErrorList.Visible = false; // UpdatePanel_ErrorList.Update(); Panel_M.Visible = false; UpdatePanel_M.Update(); Panel_Error.Visible = false; UpdatePanel_Error.Update(); Panel_Track.Visible = false; UpdatePanel_Track.Update(); Panel_C.Visible = false; UpdatePanel_C.Update(); Panel_Recover.Visible = false; UpdatePanel_Recover.Update(); // Panel_Review.Visible = false; // UpdatePanel_Review.Update(); Panel_ReWork.Visible = false; UpdatePanel_ReWork.Update(); } if (e.CommandName == "cs")//会签 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView_Error.SelectedIndex = row.RowIndex; string[] al = e.CommandArgument.ToString().Split(new char[] { ',' }); string zl = al[1]; if (zl.Trim() != "三级质量问题") { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('一二级质量问题不需要会签!')", true); //以下pannel隐藏 // Panel_ErrorList.Visible = false; // UpdatePanel_ErrorList.Update(); Panel_M.Visible = false; UpdatePanel_M.Update(); Panel_Error.Visible = false; UpdatePanel_Error.Update(); Panel_Track.Visible = false; UpdatePanel_Track.Update(); // Panel_C.Visible = false; // UpdatePanel_C.Update(); Panel_Recover.Visible = false; UpdatePanel_Recover.Update(); Panel_Review.Visible = false; UpdatePanel_Review.Update(); return; } label_CS_WOEID.Text = al[0]; Panel_C.Visible = true; UpdatePanel_C.Update(); //以下pannel隐藏 // Panel_ErrorList.Visible = false; // UpdatePanel_ErrorList.Update(); Panel_M.Visible = false; UpdatePanel_M.Update(); Panel_Error.Visible = false; UpdatePanel_Error.Update(); Panel_Track.Visible = false; UpdatePanel_Track.Update(); // Panel_C.Visible = false; // UpdatePanel_C.Update(); Panel_Recover.Visible = false; UpdatePanel_Recover.Update(); Panel_Review.Visible = false; UpdatePanel_Review.Update(); Panel_ReWork.Visible = false; UpdatePanel_ReWork.Update(); } if (e.CommandName == "recover")//结案 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView_Error.SelectedIndex = row.RowIndex; string[] al = e.CommandArgument.ToString().Split(new char[] { ',' }); label_Recover_WOEID.Text = al[0]; Panel_Recover.Visible = true; DataSet ds5 = erl.S_WOError(new Guid(al[0].Trim())); DataView dv5 = ds5.Tables[0].DefaultView; foreach (DataRowView datav in dv5) { TextBox_WOE_DoneMan.Text = datav["WOE_DoneMan"].ToString().Trim(); TextBox_WOE_DoneTime.Text = datav["WOE_DoneTime"].ToString().Trim() == "" ? "" : Convert.ToDateTime(datav["WOE_DoneTime"].ToString().Trim()).ToString("yyyy-MM-dd HH:mm"); TextBox_WOE_QCResult.Text = datav["WOE_QCResult"].ToString().Trim(); TextBox_WOE_DoneResult.Text = datav["WOE_DoneResult"].ToString().Trim(); } UpdatePanel_Recover.Update(); //以下pannel隐藏 // Panel_ErrorList.Visible = false; // UpdatePanel_ErrorList.Update(); Panel_M.Visible = false; UpdatePanel_M.Update(); Panel_Error.Visible = false; UpdatePanel_Error.Update(); Panel_Track.Visible = false; UpdatePanel_Track.Update(); Panel_C.Visible = false; UpdatePanel_C.Update(); // Panel_Recover.Visible = false; // UpdatePanel_Recover.Update(); Panel_Review.Visible = false; UpdatePanel_Review.Update(); Panel_ReWork.Visible = false; UpdatePanel_ReWork.Update(); } if (e.CommandName == "Rework")//返工 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView_Error.SelectedIndex = row.RowIndex; string[] al = e.CommandArgument.ToString().Split(new char[] { ',' }); label_ReWork_WOEID.Text = al[0]; Panel_ReWork.Visible = true; DataSet ds6 = erl.S_WOError(new Guid(al[0].Trim())); DataView dv6 = ds6.Tables[0].DefaultView; foreach (DataRowView datav in dv6) { TextBox_ReworkAppMan.Text = datav["WOE_ReworkAppMan"].ToString().Trim(); TextBox_ReWorkTime.Text = datav["WOE_ReWorkTime"].ToString().Trim() == "" ? "" : Convert.ToDateTime(datav["WOE_ReWorkTime"].ToString().Trim()).ToString("yyyy-MM-dd HH:mm"); DropDownList_ReworkOption.SelectedValue = datav["RWO_ID"].ToString().Trim(); DropDownList_PBC.SelectedValue = datav["PBC_ID"].ToString().Trim(); TextBox_ReWorkDate.Text = datav["WOE_ReWorkDate"].ToString().Trim() == "" ? "" : Convert.ToDateTime(datav["WOE_ReWorkDate"].ToString().Trim()).ToString("yyyy-MM-dd"); TextBox_ReworkNum.Text = datav["WOE_ReworkNum"].ToString().Trim(); TextBox_ReworkDetail.Text = datav["WOE_ReworkDetail"].ToString().Trim(); } UpdatePanel_ReWork.Update(); //以下pannel隐藏 // Panel_ErrorList.Visible = false; // UpdatePanel_ErrorList.Update(); Panel_M.Visible = false; UpdatePanel_M.Update(); Panel_Error.Visible = false; UpdatePanel_Error.Update(); Panel_Track.Visible = false; UpdatePanel_Track.Update(); Panel_C.Visible = false; UpdatePanel_C.Update(); Panel_Recover.Visible = false; UpdatePanel_Recover.Update(); Panel_Review.Visible = false; UpdatePanel_Review.Update(); } }