Пример #1
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[] { ',' });
         if (Panel_AddWorkOrder.Visible == true)
         {
             Label_AddOrderNum.Text = al[0];
             TextBox_Add_Order.Text = al[1];//客户订单号
             Label_OT.Text          = al[3];
             TextBox_Add_SN.Text    = GridView_Order.DataKeys[row.RowIndex].Values["OEMOT_SNum"].ToString();
             UpdatePanel_AddWorkOrder.Update();
         }
         if (Panel_EditWorkOrder.Visible == true)
         {
             Label_EditOrderNum.Text   = al[0];
             TextBox_EditOrderNum.Text = al[1];//客户订单号
             TextBox_EditSN.Text       = GridView_Order.DataKeys[row.RowIndex].Values["OEMOT_SNum"].ToString();
             UpdatePanel_EditWorkOrder.Update();
         }
         Panel_SelectOrder.Visible = false;
         UpdatePanel_SelectOrder.Update();
     }
 }
Пример #2
0
 protected void Btn_Close_SearchOrder_Click(object sender, EventArgs e)//关闭检索订单页面
 {
     TextBox_ComOrderNum.Text  = "";
     TextBox_CustOrder.Text    = "";
     Panel_SelectOrder.Visible = false;
     UpdatePanel_SelectOrder.Update();
 }
Пример #3
0
    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();
    }
Пример #4
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;
        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();
    }
Пример #5
0
    protected void Button_SearchOrder_Click(object sender, EventArgs e)//检索订单号
    {
        string condition;
        string ComOrderNum = TextBox_ComOrderNum.Text.Trim() == "" ? " and 1=1 " : "and SMSO_ComOrderNum like '%" + TextBox_ComOrderNum.Text.Trim() + "%' ";
        string CustOrder   = TextBox_CustOrder.Text.Trim() == "" ? " and 1=1 " : "and SMSO_CusOrderNum like '%" + TextBox_CustOrder.Text.Trim() + "%' ";

        condition = ComOrderNum + CustOrder;
        GridView_Order.DataSource = wol.S_WO_SMSalesOrder(condition);
        GridView_Order.DataBind();
        UpdatePanel_SelectOrder.Update();
    }
Пример #6
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();
        }
    }
Пример #7
0
    protected void Btn_SelectOrder_Click(object sender, EventArgs e)//新增随工单时,选择订单号
    {
        Panel_Product_Search.Visible = false;
        Panel_SelectOrder.Visible    = true;

        string condition;
        string ComOrderNum = TextBox_ComOrderNum.Text.Trim() == "" ? " and 1=1 " : "and SMSO_ComOrderNum like '%" + TextBox_ComOrderNum.Text.Trim() + "%' ";
        string CustOrder   = TextBox_CustOrder.Text.Trim() == "" ? " and 1=1 " : "and SMSO_CusOrderNum like '%" + TextBox_CustOrder.Text.Trim() + "%' ";

        condition = ComOrderNum + CustOrder;
        GridView_Order.DataSource = wol.S_WO_SMSalesOrder(condition);
        GridView_Order.DataBind();


        UpdatePanel_Product.Update();
        UpdatePanel_SelectOrder.Update();
    }
Пример #8
0
    protected void Btn_Search0_Click(object sender, EventArgs e)//选产品型号
    {
        // Label_PS.Text = "";
        Panel_Product.Visible        = true;
        Panel_Product_Search.Visible = true;
        Panel_SelectOrder.Visible    = false;
        UpdatePanel_SelectOrder.Update();
        //  Panel_basic.Visible = false;
        TextBox_Series.Text       = "";
        TextBox_ProductName.Text  = "";
        TextBox_ProductName0.Text = "";
        TextBox_ProductName1.Text = "";

        Panel_Product.Visible        = true;
        Panel_Product_Search.Visible = true;
        databind_PT();
    }
Пример #9
0
    protected void GridView_Order_PageIndexChanging(object sender, GridViewPageEventArgs e) //订单号表翻页
    {
        GridView theGrid      = sender as GridView;                                         // refer to the GridView
        int      newPageIndex = 0;

        GridView_Order.SelectedIndex = -1;
        if (-2 == e.NewPageIndex)
        {
            TextBox txtNewPageIndex = null;

            GridViewRow pagerRow = GridView_Order.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_Order.PageCount ? GridView_Order.PageCount - 1 : newPageIndex;
        GridView_Order.PageIndex = newPageIndex;
        GridView_Order.PageIndex = newPageIndex;
        string condition;
        string ComOrderNum = TextBox_ComOrderNum.Text.Trim() == "" ? " and 1=1 " : "and SMSO_ComOrderNum like '%" + TextBox_ComOrderNum.Text.Trim() + "%' ";
        string CustOrder   = TextBox_CustOrder.Text.Trim() == "" ? " and 1=1 " : "and SMSO_CusOrderNum like '%" + TextBox_CustOrder.Text.Trim() + "%' ";

        condition = ComOrderNum + CustOrder;
        GridView_Order.DataSource = wol.S_WO_SMSalesOrder(condition);
        GridView_Order.DataBind();
        UpdatePanel_SelectOrder.Update();
    }
Пример #10
0
 protected void Btn_Close_SearchOrder_Click(object sender, EventArgs e)
 {
     Panel_SelectOrder.Visible = false;
     UpdatePanel_SelectOrder.Update();
 }
Пример #11
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();
    }