Example #1
0
    protected void Button_Cancel_Click(object sender, EventArgs e)
    {
        //panel 各种隐藏



        DropDownList1.SelectedIndex = 0;
        DropDownList2.SelectedIndex = 0;
        TextBox_WOSN0.Text          = "";
        DropDownList3.SelectedIndex = 0;
        DropDownList4.SelectedIndex = 0;

        DropDownList_WO_Type.SelectedIndex = 0;
        DropDownList_WoState.SelectedIndex = 0;
        TextBox_OrderNum.Text     = "";
        TextBox_wonum.Text        = "";
        TextBox_PBC.Text          = "";
        TextBox_pt.Text           = "";
        TextBox_WO_Time1.Text     = "";
        TextBox_WO_Time2.Text     = "";
        TextBox_WOSN.Text         = "";
        GridView_WOmain.PageIndex = 0;
        databind();
        GridView_WOmain.SelectedIndex = -1;


        Panel_Divide.Visible = false;
        UpdatePanel_Divide.Update();
        Panel1.Visible = false;
        UpdatePanel1.Update();
    }
Example #2
0
    protected void Button_Cancel0_Click(object sender, EventArgs e)//关闭详细表
    {
        Panel_Divide.Visible = false;
        UpdatePanel_Divide.Update();


        Panel1.Visible = false;
        UpdatePanel1.Update();
    }
Example #3
0
 protected void Btn_Search_Click(object sender, EventArgs e)
 {
     Panel_Divide.Visible = false;
     UpdatePanel_Divide.Update();
     Panel1.Visible = false;
     UpdatePanel1.Update();
     databind();
     label_GridPageState.Text = "检索数据源";
 }
Example #4
0
    protected void GridView_Order_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Select_Order")//选择订单号
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView_Order.SelectedIndex = row.RowIndex;
            string[] al = e.CommandArgument.ToString().Split(new char[] { ',' });
            Label_AddOrderNum.Text    = al[0];
            TextBox_WOMotherNum1.Text = al[1];//客户订单号
            // Label_OT.Text = al[3];
            UpdatePanel_Divide.Update();

            Panel_SelectOrder.Visible = false;
            UpdatePanel_SelectOrder.Update();
        }
    }
Example #5
0
    //从当前页收集选中项的情况
    protected void GridView_ProType_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "SelectPT")//选择产品型号
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView_ProType.SelectedIndex = row.RowIndex;

            string[] al     = e.CommandArgument.ToString().Split(new char[] { ',' });
            string   ptname = al[1];
            Label_PTID.Text           = al[0];
            TextBox_WOMotherNum0.Text = ptname;

            UpdatePanel_Divide.Update();
            Panel_Product.Visible        = false;
            Panel_Product_Search.Visible = false;
        }
    }
Example #6
0
    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;
        databind();
        GridView_WOmain.SelectedIndex = -1;

        //分单页面
        Panel_Divide.Visible = false;
        UpdatePanel_Divide.Update();
        Panel1.Visible = false;
        UpdatePanel1.Update();
    }
Example #7
0
    protected void GridView_WOmain_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "BasicInfo")//
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView_WOmain.SelectedIndex = row.RowIndex;

            string[] al = e.CommandArgument.ToString().Split(new char[] { ',' });
            label_WO_ID.Text        = al[0];
            label_WONum.Text        = al[1];
            label_PType.Text        = al[2];
            label_PTypeID.Text      = al[3];
            GridView1.SelectedIndex = -1;
            Panel1.Visible          = true;
            databind_detail();



            //不良品信息分单页面隐藏
            Panel_Divide.Visible = false;
            UpdatePanel_Divide.Update();
        }
    }
Example #8
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        //分单

        if (e.CommandName == "Dividing")//
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView_WOmain.SelectedIndex = row.RowIndex;
            string[] al = e.CommandArgument.ToString().Split(new char[] { ',' });
            Labe_WOID.Text           = label_WO_ID.Text;
            Label_WODID.Text         = al[0];
            label_PBCDivide.Text     = al[1];
            label_WONum0.Text        = label_WONum.Text;
            TextBox_WOMotherNum.Text = label_WONum.Text;

            TextBox_WOMotherNum0.Text = label_PType.Text;
            Label_PTID.Text           = label_PTypeID.Text;
            TextBox4.Text             = "";
            TextBox_InputNum.Text     = "";

            DropDownList1.SelectedIndex = 0;
            Panel_Divide.Visible        = true;
            UpdatePanel_Divide.Update();

            for (int i = 0; i < GridView1.Rows.Count && GridView1.Rows[i].Cells[6].Text.Trim() != "&nbsp;" && GridView1.Rows[i].Cells[6].Text.Trim() != ""; i++)
            {
                if (GridView1.Rows[i].Cells[6].Text.Trim() != "" && GridView1.Rows[i].Cells[3].Text.Contains("压塑") && (!(GridView1.Rows[i].Cells[3].Text.Contains("QC"))) && (!(GridView1.Rows[i].Cells[3].Text.Contains("&"))))
                {
                    Label_Note.Text = Label_Note.Text + "压塑设备:" + (GridView1.Rows[i].Cells[5].ToolTip.ToString() == "&nbsp;" ? "未选择" : GridView1.Rows[i].Cells[5].ToolTip.ToString()) + " 压塑进站时间:" + GridView1.Rows[i].Cells[6].ToolTip.ToString()
                                      + " 压塑出站时间:" + (GridView1.Rows[i].Cells[7].ToolTip.ToString() == "&nbsp;" ? "未出站" : GridView1.Rows[i].Cells[7].ToolTip.ToString());
                }
                if (GridView1.Rows[i].Cells[6].Text.Trim() != "" && GridView1.Rows[i].Cells[3].Text.Contains("浇灌") && (!(GridView1.Rows[i].Cells[3].Text.Contains("QC"))) && (!(GridView1.Rows[i].Cells[3].Text.Contains("&"))))
                {
                    Label_Note.Text = Label_Note.Text + "浇灌设备:" + (GridView1.Rows[i].Cells[5].ToolTip.ToString() == "&nbsp;" ? "未选择" : GridView1.Rows[i].Cells[5].ToolTip.ToString()) + " 浇灌进站时间:" + GridView1.Rows[i].Cells[6].ToolTip.ToString()
                                      + " 浇灌出站时间:" + (GridView1.Rows[i].Cells[7].ToolTip.ToString() == "&nbsp;" ? "未出站" : GridView1.Rows[i].Cells[7].ToolTip.ToString());
                }
                if (GridView1.Rows[i].Cells[6].Text.Trim() != "" && GridView1.Rows[i].Cells[3].Text.Contains("固化") && (!(GridView1.Rows[i].Cells[3].Text.Contains("QC"))) && (!(GridView1.Rows[i].Cells[3].Text.Contains("&"))))
                {
                    Label_Note.Text = Label_Note.Text + "固化设备:" + (GridView1.Rows[i].Cells[5].ToolTip.ToString() == "&nbsp;" ? "未选择" : GridView1.Rows[i].Cells[5].ToolTip.ToString()) + " 固化进站时间:" + GridView1.Rows[i].Cells[6].ToolTip.ToString()
                                      + " 固化出站时间:" + (GridView1.Rows[i].Cells[7].ToolTip.ToString() == "&nbsp;" ? "未出站" : GridView1.Rows[i].Cells[7].ToolTip.ToString());
                }
            }
            int sum = 0;

            for (int m = 0; m < GridView1.Rows.Count && (GridView1.Rows[m].Cells[8].ToolTip.ToString().Trim() != "&nbsp;" && (GridView1.Rows[m].Cells[8].ToolTip.ToString().Trim() != "")) && (!(GridView1.Rows[m].Cells[3].Text.Contains("QC"))); m++)
            {
                {
                    sum++;
                }
            }
            //if (sum == 0)
            //{
            //    Label_yuannum.Text = "0";
            //}
            //else
            //{

            //    for (int i = 0; i < GridView1.Rows.Count && GridView1.Rows[i].Cells[8].Text.Trim() != "&nbsp;" && GridView1.Rows[i].Cells[8].Text.Trim() != "" && (!(GridView1.Rows[i].Cells[3].Text.Contains("QC"))); i++)
            //    {


            //        if ((GridView1.Rows[i].Cells[9].ToolTip.ToString().Trim() == "&nbsp;" || (GridView1.Rows[i].Cells[9].ToolTip.ToString().Trim() == "")))
            //        {
            //            Label_yuannum.Text = (GridView1.Rows[i].Cells[8].ToolTip.ToString().Trim());
            //        }
            //        else
            //        {
            //            Label_yuannum.Text = (GridView1.Rows[i].Cells[9].ToolTip.ToString().Trim());
            //        }


            //    }
            //}

            DataSet ds0 = ws.S_HeDanNum(new Guid(Labe_WOID.Text.Trim()));
            Label_yuannum.Text = ds0.Tables[0].Rows[0]["num"].ToString();
        }
    }
Example #9
0
    protected void Btn_Dividing_Click(object sender, EventArgs e)//分单
    {
        int yuannum = 0; int fenchu_n = 0;

        try
        {
            yuannum = Convert.ToInt32(Label_yuannum.Text.Trim());
        }
        catch (Exception)
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('原单数量初始化失败!')", true);
            return;
        }
        try
        {
            fenchu_n = Convert.ToInt32(TextBox_InputNum.Text.Trim()); Convert.ToInt32(TextBox_InputNum.Text.Trim());
        }
        catch (Exception)
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('分出数量请填整数!')", true);
            return;
        }
        if (fenchu_n > yuannum)
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('分出数量不得大于原有数量!')", true);
            return;
        }
        try
        {
            wo.WO_ID       = new Guid(Labe_WOID.Text.Trim());
            wo.SMSO_ID     = new Guid(Label_AddOrderNum.Text.Trim());
            wo.WO_Num      = TextBox_WOMotherNum.Text.Trim();
            wo.WO_ProType  = TextBox_WOMotherNum0.Text.Trim();
            wo.WO_OrderNum = TextBox_WOMotherNum1.Text.Trim();
            wo.WO_People   = Session["UserName"].ToString().Trim();
            wo.WO_Note     = Label_Note.Text + "  " + TextBox4.Text;
            ppd.I_WorkOrder_Devide_NEW(wo, new Guid(Label_PTID.Text.Trim()), TextBox_WOMotherNum2.Text.Trim(), fenchu_n, new Guid(Label_WODID.Text.Trim()), yuannum);
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('分单成功!')", true);
        }
        catch (Exception)
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('分单失败!')", true);
            return;
        }


        databind();


        //分单表绑定


        Panel_Divide.Visible         = false;
        Panel_Product_Search.Visible = false;
        Panel_Product.Visible        = false;
        UpdatePanel_Product.Update();
        Panel_SelectOrder.Visible = false;
        UpdatePanel_SelectOrder.Update();
        Panel1.Visible = false;
        UpdatePanel1.Update();
        UpdatePanel_Divide.Update();
    }