public void databind() { string condition; string WO_Type = DropDownList_WO_Type.SelectedItem.Text.Trim() == "请选择" ? " and 1=1 " : " and WO_Type like '%" + DropDownList_WO_Type.SelectedItem.Text.Trim() + "%' "; //string WO_People = this.TextBox_WO_People.Text.Trim() == "请选择" ? " and 1=1 " : " and WO_People like '%" + this.TextBox_WO_People.Text.Trim() + "%' "; if ((TextBox_WO_Time1.Text != "" && TextBox_WO_Time2.Text == "") || (TextBox_WO_Time1.Text == "" && TextBox_WO_Time2.Text != "")) { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('请将时间检索范围输入完整,请您再次核对!')", true); return; } string WO_Time = (TextBox_WO_Time1.Text.Trim() == "" && TextBox_WO_Time2.Text.Trim() == "") ? " and 1=1 " : " and WOD_StaTime between ' " + TextBox_WO_Time1.Text.Trim() + "' and ' " + TextBox_WO_Time2.Text.Trim() + "'"; string WO_Num = TextBox_wonum.Text.Trim() == "" ? " and 1=1 " : " and WO_Num like '%" + TextBox_wonum.Text.Trim() + "%' "; string pbcname = TextBox_PBC.Text.Trim() == "" ? " and 1=1 " : " and PBC_Name like '%" + TextBox_PBC.Text.Trim() + "%' "; string SMSO_ComOrderNum = TextBox_OrderNum.Text.Trim() == "" ? " and 1=1 " : " and SMSO_ComOrderNum like '%" + TextBox_OrderNum.Text.Trim() + "%' "; string WO_ProType = TextBox_pt.Text.Trim() == "" ? " and 1=1 " : " and WO_ProType like '%" + TextBox_pt.Text.Trim() + "%' "; string WO_ChipNum = TextBox_chipnum.Text.Trim() == "" ? " and 1=1 " : " and WO_ChipNum like '%" + TextBox_chipnum.Text.Trim() + "%' "; string WO_Level = DropDownList_level.SelectedItem.Text.Trim() == "请选择" ? " and 1=1 " : " and WO_Level like '%" + DropDownList_level.SelectedItem.Text.Trim() + "%' "; string WO_State = DropDownList_WoState.SelectedItem.Text.Trim() == "请选择" ? " and 1=1 " : " and WO_State like '%" + DropDownList_WoState.SelectedItem.Text.Trim() + "%' "; string WO_SN = TextBox_WOSN.Text.Trim() == "" ? " and 1=1 " : " and WO_SN like '%" + TextBox_WOSN.Text.Trim() + "%' "; condition = WO_Type + WO_Time + WO_Num + pbcname + SMSO_ComOrderNum + WO_ProType + WO_ChipNum + WO_Level + WO_State + WO_SN; GridView_WOmain.DataSource = erl.S_WorkOrder_Check(condition); GridView_WOmain.DataBind(); UpdatePanel_WOmain.Update(); }
protected void Button_Cancel_Click(object sender, EventArgs e) { Panel_Combine.Visible = false; UpdatePanel_Combine.Update(); DropDownList1.SelectedIndex = 0; TextBox_PT_Combine.Text = ""; TextBox_ChipNum_Conbine.Text = ""; TextBox_Newwonum.Text = ""; 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; }
public void databind() { string condition; string WO_Type = ""; try { if (Request.QueryString["WO_Type"].ToString() == "检验") { WO_Type = " and WO_Type='检验' "; DropDownList_WO_Type.SelectedIndex = 4; } else { WO_Type = DropDownList_WO_Type.SelectedItem.Text.Trim() == "请选择" ? " and 1=1 " : " and WO_Type like '%" + DropDownList_WO_Type.SelectedItem.Text.Trim() + "%' "; } } catch (Exception) { WO_Type = DropDownList_WO_Type.SelectedItem.Text.Trim() == "请选择" ? " and 1=1 " : " and WO_Type like '%" + DropDownList_WO_Type.SelectedItem.Text.Trim() + "%' "; } //string WO_People = this.TextBox_WO_People.Text.Trim() == "请选择" ? " and 1=1 " : " and WO_People like '%" + this.TextBox_WO_People.Text.Trim() + "%' "; if ((TextBox_WO_Time1.Text != "" && TextBox_WO_Time2.Text == "") || (TextBox_WO_Time1.Text == "" && TextBox_WO_Time2.Text != "")) { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('请将时间检索范围输入完整,请您再次核对!')", true); return; } if ((DropDownList3.SelectedValue.ToString() != "" && DropDownList4.SelectedValue.ToString() == "") || (DropDownList3.SelectedValue.ToString().Trim() == "" && DropDownList4.SelectedValue.ToString().Trim() != "")) { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('请将工序检索范围输入完整,请您再次核对!')", true); return; } string gx = " and 1=1 "; string WO_Time = (TextBox_WO_Time1.Text.Trim() == "" && TextBox_WO_Time2.Text.Trim() == "") ? " and 1=1 " : " and WOD_StaTime between ' " + TextBox_WO_Time1.Text.Trim() + "' and ' " + TextBox_WO_Time2.Text.Trim() + "'"; string WO_Num = TextBox_wonum.Text.Trim() == "" ? " and 1=1 " : " and WO_Num like '%" + TextBox_wonum.Text.Trim() + "%' "; string pbcname = TextBox_PBC.Text.Trim() == "" ? " and 1=1 " : " and PBC_Name like '%" + TextBox_PBC.Text.Trim() + "%' "; string SMSO_ComOrderNum = TextBox_OrderNum.Text.Trim() == "" ? " and 1=1 " : " and SMSO_ComOrderNum like '%" + TextBox_OrderNum.Text.Trim() + "%' "; string WO_ProType = TextBox_pt.Text.Trim() == "" ? " and 1=1 " : " and WO_ProType like '%" + TextBox_pt.Text.Trim() + "%' "; string WO_State = DropDownList_WoState.SelectedItem.Text.Trim() == "请选择" ? " and WO_State!='已被合单' " : " and WO_State like '%" + DropDownList_WoState.SelectedItem.Text.Trim() + "%' "; string WO_SN = TextBox_WOSN.Text.Trim() == "" ? " and 1=1 " : " and WO_SN like '%" + TextBox_WOSN.Text.Trim() + "%' "; string error = DropDownList1.SelectedItem.Text.Trim() == "请选择" ? " and 1=1 " : " and WOD_Error like '%" + DropDownList1.SelectedItem.Text.Trim() + "%' "; string otime = DropDownList2.SelectedItem.Text.Trim() == "请选择" ? " and 1=1 " : " and WOD_OverTime like '%" + DropDownList2.SelectedItem.Text.Trim() + "%' "; string pihao = TextBox_WOSN0.Text.Trim() == "" ? " and 1=1 " : " and pihao like '%" + TextBox_WOSN0.Text.Trim() + "%' "; if (DropDownList3.SelectedValue.ToString().Trim() == "" && DropDownList4.SelectedValue.ToString().Trim() == "") { gx = " and 1=1 "; } else { gx = " and '" + DropDownList3.SelectedValue.ToString().Trim() + "' in (select PBC_ID from WODetail where WO_ID=t.WO_ID and WOD_InTime is not null) " + " and ( '" + DropDownList4.SelectedValue.ToString().Trim() + "' in (select top 1 PBC_ID from WODetail where WO_ID=t.WO_ID and WOD_InTime is not null order by WOD_InTime desc) or '" + DropDownList4.SelectedValue.ToString().Trim() + "' not in (select PBC_ID from WODetail where WO_ID=t.WO_ID and WOD_InTime is not null ) ) "; } condition = WO_Type + WO_Time + WO_Num + pbcname + SMSO_ComOrderNum + WO_ProType + WO_State + WO_SN + error + otime + gx + pihao; GridView_WOmain.DataSource = erl.S_WorkOrder_Check(condition); GridView_WOmain.DataBind(); UpdatePanel_WOmain.Update(); }
protected void databind_main() { string condition = " and IMISD_ID like '%" + label_GridPageState.Text.ToString().Trim() + "%'"; GridView_WOmain.DataSource = erl.S_WorkOrder_Check(condition); GridView_WOmain.DataBind(); UpdatePanel_WOmain.Update(); }
public void databind1() { string condition; string PMS_Name = TextBox_Teamname.Text.Trim() == "" ? " and 1=1 " : " and PMS_Name like '%" + TextBox_Teamname.Text.Trim() + "%' "; condition = PMS_Name; GridView_WOmain.DataSource = ppl.S_ProMainSeries(condition); GridView_WOmain.DataBind(); UpdatePanel_WOmain.Update(); }
protected void Btn_CombingConfirm_Click(object sender, EventArgs e) { int num = 0; string wonum = TextBox_Newwonum.Text.Trim(); string fatherwonum = TextBox_WoNumChecked.Text.Trim(); string pt = TextBox_PT_Combine.Text.Trim(); string ordernum = TextBox_OrderCombine.Text.Trim(); string sn = TextBox_SN_Combine.Text.Trim(); string level = DropDownList_level_Combine.SelectedItem.Text; string chipnum = TextBox_ChipNum_Conbine.Text.Trim(); string idstring = Labe_WOID.Text.Trim(); if (TextBox_SN_Combine.Text.Trim() == "") { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('周期码不能为空!')", true); return; } try { num = Convert.ToInt32(TextBox_PNum_Conbine.Text.Trim()); } catch (Exception) { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('计划数量不能为空且为整数形式!')", true); return; } string note = TextBox_Note_Combine.Text.Trim(); string people = Session["UserName"].ToString().Trim(); try { wcl.I_WorkOrder_Combine(wonum, fatherwonum, pt, ordernum, sn, level, chipnum, num, note, people, idstring); ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('合单成功!')", true); } catch (Exception) { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('合单失败!')", true); return; } if (label_GridPageState.Text == "默认数据源") { string condition = " and 1=1"; GridView_WOmain.DataSource = erl.S_WorkOrder_Check(condition); GridView_WOmain.DataBind(); UpdatePanel_WOmain.Update(); } if (label_GridPageState.Text == "检索数据源") { databind(); } Panel_Combine.Visible = false; UpdatePanel_Combine.Update(); }
protected void Page_Load(object sender, EventArgs e) { label_GridPageState.Text = "默认数据源"; if (!IsPostBack) { string condition = " and 1=1"; GridView_WOmain.DataSource = erl.S_WorkOrder_Check(condition); GridView_WOmain.DataBind(); UpdatePanel_WOmain.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; GridView_WOmain.PageIndex = newPageIndex; if (label_GridPageState.Text == "默认数据源") { string condition = " and 1=1"; GridView_WOmain.DataSource = erl.S_WorkOrder_Check(condition); GridView_WOmain.DataBind(); UpdatePanel_WOmain.Update(); } if (label_GridPageState.Text == "检索数据源") { databind(); } Panel_Combine.Visible = false; UpdatePanel_Combine.Update(); DropDownList1.SelectedIndex = 0; TextBox_PT_Combine.Text = ""; TextBox_ChipNum_Conbine.Text = ""; TextBox_Newwonum.Text = ""; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string condition = " and 1=1"; GridView_WOmain.DataSource = ot.S_PMMInventory(condition); GridView_WOmain.DataBind(); UpdatePanel_WOmain.Update(); DropDownList1.DataSource = erl.S_WOError_Rework_PBCraft(); DropDownList1.DataTextField = "PBC_Name"; DropDownList1.DataValueField = "PBC_ID"; DropDownList1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { label_GridPageState.Text = "默认数据源"; string state = ""; if (!IsPostBack) { if (Request.QueryString["state"] == null) { Response.Redirect("~/Default.aspx"); } else { state = Request.QueryString["state"]; } if (state == "devide") { Title = "随工单分单"; GridView_WOmain.Columns[0].Visible = false; GridView_WOmain.Columns[1].Visible = false; CheckBoxAll.Visible = false; CheckBoxfanxuan.Visible = false; Btn_deleting.Visible = false; } if (state == "combine") { Title = "随工单合单"; GridView1.Columns[15].Visible = false; } DropDownList3.DataSource = erl.S_WOError_Rework_PBCraft(); DropDownList3.DataTextField = "PBC_Name"; DropDownList3.DataValueField = "PBC_ID"; DropDownList3.DataBind(); DropDownList3.Items.Insert(0, new ListItem("请选择", "")); DropDownList4.DataSource = erl.S_WOError_Rework_PBCraft(); DropDownList4.DataTextField = "PBC_Name"; DropDownList4.DataValueField = "PBC_ID"; DropDownList4.DataBind(); DropDownList4.Items.Insert(0, new ListItem("请选择", "")); //this.Title = "随工单分单"; string condition = " and 1=1"; GridView_WOmain.DataSource = erl.S_WorkOrder_Check(condition); GridView_WOmain.DataBind(); UpdatePanel_WOmain.Update(); } }
public void databind() { string condition; string PMMI_RState = DropDownList_TimeState.SelectedItem.Text.Trim() == "请选择" ? " and 1=1 " : " and PMMI_RState = '" + DropDownList_TimeState.SelectedItem.Text.Trim() + "' "; string PMMI_FCState = DropDownList_PieceState.SelectedItem.Text.Trim() == "请选择" ? " and 1=1 " : " and PMMI_FCState = '" + DropDownList_PieceState.SelectedItem.Text.Trim() + "' "; string PBC_Name = TextBox1.Text.Trim() == "" ? " and 1=1 " : " and PBC_Name = '" + TextBox1.Text.Trim() + "' "; if ((TextBox_calculate_Time1.Text != "" && TextBox_calculate_Time2.Text == "") || (TextBox_calculate_Time1.Text == "" && TextBox_calculate_Time2.Text != "")) { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('请将时间检索范围输入完整,请您再次核对!')", true); return; } string PMMI_Date = (TextBox_calculate_Time1.Text.Trim() == "" && TextBox_calculate_Time2.Text.Trim() == "") ? " and 1=1 " : " and PMMI_Date between ' " + TextBox_calculate_Time1.Text.Trim() + "' and ' " + TextBox_calculate_Time2.Text.Trim() + "'"; condition = PMMI_RState + PMMI_FCState + PMMI_Date + PBC_Name; GridView_WOmain.DataSource = ot.S_PMMInventory(condition); GridView_WOmain.DataBind(); UpdatePanel_WOmain.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 Page_Load(object sender, EventArgs e) { try { if (Request.QueryString["state"] == null) { label_pagestate.Text = "look"; } else { label_pagestate.Text = Request.QueryString["state"]; } string state = label_pagestate.Text; if (state.Trim() == "look") { Title = "异常查看"; Btn_M_Confirm.Visible = false; Btn_ErrorDealer_Confirm.Visible = false; Btn_ErrorTrack_Confirm.Visible = false; GridView2.Columns[7].Visible = false; Btn_ErrorRecover_Confirm.Visible = false; Button1.Visible = false; Button3.Visible = false; } if (state.Trim() == "clycjy") { Title = "材料异常检验"; Btn_ErrorDealer_Confirm.Visible = false; Btn_ErrorTrack_Confirm.Visible = false; GridView2.Columns[7].Visible = false; Btn_ErrorRecover_Confirm.Visible = false; Button1.Visible = false; Button3.Visible = false; } if (state.Trim() == "yccl") { Title = "异常处理"; Btn_M_Confirm.Visible = false; // Btn_ErrorDealer_Confirm.Visible = false; Btn_ErrorTrack_Confirm.Visible = false; GridView2.Columns[7].Visible = false; Btn_ErrorRecover_Confirm.Visible = false; Button1.Visible = false; Button3.Visible = false; } if (state.Trim() == "ycgz") { Title = "异常跟踪"; Btn_M_Confirm.Visible = false; Btn_ErrorDealer_Confirm.Visible = false; // Btn_ErrorTrack_Confirm.Visible = false; GridView2.Columns[7].Visible = false; Btn_ErrorRecover_Confirm.Visible = false; Button1.Visible = false; Button3.Visible = false; } if (state.Trim() == "ycja") { Title = "异常结案"; Btn_M_Confirm.Visible = false; Btn_ErrorDealer_Confirm.Visible = false; Btn_ErrorTrack_Confirm.Visible = false; GridView2.Columns[7].Visible = false; // Btn_ErrorRecover_Confirm.Visible = false; Button1.Visible = false; Button3.Visible = false; } if (state.Trim() == "ycsh") { Title = "异常审核"; Btn_M_Confirm.Visible = false; Btn_ErrorDealer_Confirm.Visible = false; Btn_ErrorTrack_Confirm.Visible = false; GridView2.Columns[7].Visible = false; Btn_ErrorRecover_Confirm.Visible = false; // Button1.Visible = false; Button3.Visible = false; } if (state.Trim() == "ychq") { Title = "异常会签"; Btn_M_Confirm.Visible = false; Btn_ErrorDealer_Confirm.Visible = false; Btn_ErrorTrack_Confirm.Visible = false; // GridView2.Columns[7].Visible = false; Btn_ErrorRecover_Confirm.Visible = false; Button1.Visible = false; Button3.Visible = false; } if (state.Trim() == "ycfg") { Title = "异常返工"; Btn_M_Confirm.Visible = false; Btn_ErrorDealer_Confirm.Visible = false; Btn_ErrorTrack_Confirm.Visible = false; GridView2.Columns[7].Visible = false; Btn_ErrorRecover_Confirm.Visible = false; Button1.Visible = false; // Button3.Visible = false; } if (!IsPostBack) { try { if (!((Session["UserRole"].ToString().Contains("异常查看")) || (Session["UserRole"].ToString().Contains("材料异常检验")) || (Session["UserRole"].ToString().Contains("异常处理")) || (Session["UserRole"].ToString().Contains("异常跟踪")) || (Session["UserRole"].ToString().Contains("异常结案")) || (Session["UserRole"].ToString().Contains("异常审核")) || (Session["UserRole"].ToString().Contains("异常会签")) || (Session["UserRole"].ToString().Contains("异常返工")))) { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('可能您没有权限操作和查看本页面,请退出选择其他账号登陆,或联系管理员!')", true); Response.Redirect("~/Default.aspx"); } if (!(Session["UserRole"].ToString().Contains("材料异常检验"))) { Btn_M_Confirm.Visible = false; } if (!(Session["UserRole"].ToString().Contains("异常处理"))) { Btn_ErrorDealer_Confirm.Visible = false; } if (!(Session["UserRole"].ToString().Contains("异常跟踪"))) { Btn_ErrorTrack_Confirm.Visible = false; } if (!(Session["UserRole"].ToString().Contains("异常结案"))) { Btn_ErrorRecover_Confirm.Visible = false; } if (!(Session["UserRole"].ToString().Contains("异常审核"))) { Button1.Visible = false; } if (!(Session["UserRole"].ToString().Contains("异常会签"))) { GridView2.Columns[7].Visible = false; } if (!(Session["UserRole"].ToString().Contains("异常返工"))) { Button3.Visible = false; } label_GridPageState.Text = "默认数据源"; string condition = " and 1=1"; GridView_WOmain.DataSource = erl.S_WorkOrder_Check(condition); GridView_WOmain.DataBind(); UpdatePanel_WOmain.Update(); DropDownList_PBC.DataSource = erl.S_WOError_Rework_PBCraft(); DropDownList_PBC.DataTextField = "PBC_Name"; DropDownList_PBC.DataValueField = "PBC_ID"; DropDownList_PBC.DataBind(); DropDownList_PBC.Items.Insert(0, new ListItem("请选择", "")); DropDownList_ReworkOption.DataSource = erl.S_WOError_Rework_ReWorkOption(); DropDownList_ReworkOption.DataTextField = "RWO_Name"; DropDownList_ReworkOption.DataValueField = "RWO_ID"; DropDownList_ReworkOption.DataBind(); DropDownList_ReworkOption.Items.Insert(0, new ListItem("请选择", "")); } catch (Exception) { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('可能您没有权限操作和查看本页面,请退出选择其他账号登陆,或联系管理员!')", true); Response.Redirect("~/Default.aspx"); } } } catch (Exception) { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('可能您没有权限操作和查看本页面,请退出选择其他账号登陆,或联系管理员!')", true); Response.Redirect("~/Default.aspx"); } }