Exemplo n.º 1
0
    private void SetWOinfo(string WO)
    {
        DataTable dt = CreateLot.QueryWorkorderIno(WO);

        if (dt.Rows.Count > 0)
        {
            txtThinkness.Text = dt.Rows[0]["MouldThinkness"].ToString();
            txtType.Text      = dt.Rows[0]["MouldType"].ToString();
            txtPETType.Text   = dt.Rows[0]["MouldPETType"].ToString();
            txtPinMin.Text    = dt.Rows[0]["mouldpinmin"].ToString();
        }
        else
        {
            JScript.Alert("未查询到工单信息", this);
        }
    }
Exemplo n.º 2
0
    //private void test()
    //{
    //   grd.DataSource= EqpManage.Exist("All");
    //    grd.DataBind();
    //}
    protected void txtBtnEnter_Click(object sender, EventArgs e)
    {
        //长度和宽度是否已经输入
        if (txtLotLength.Text == "")
        {
            JScript.Alert("请输入批次长度", this);
            return;
        }
        if (txtLotWidth.Text == "")
        {
            JScript.Alert("请输入批次宽度", this);
            return;
        }
        int beginValue;

        beginValue = CreateLot.QueryMaxNum(txtWorkOrder.Text);
        if (beginValue >= 999)
        {
            JScript.Alert("工单数量已经用完大于999个序列号", this);
            return;
        }
        beginValue = beginValue + 1;
        dt         = (DataTable)ViewState["dt"];
        dt.Rows.Clear();
        DataRow dtRow;

        for (int i = beginValue; i <= Convert.ToInt32(txtLotCount.Text) + beginValue - 1; i++)
        {
            //CreateMouldLot.InsertLot()
            //AddRow((i).ToString("000"));
            dtRow            = dt.NewRow();
            dtRow["mouldid"] = txtWorkOrder.Text + i.ToString("000");
            dtRow["Length"]  = txtLotLength.Text;
            dtRow["Width"]   = txtLotWidth.Text;
            dt.Rows.Add(dtRow);
        }
        ViewState["dt"] = dt;
        databind();
    }
Exemplo n.º 3
0
    //protected void btnSaveClose_Click(object sender, EventArgs e)
    //{
    //    test();
    //}
    private void setBominfo(string wo)
    {
        DataTable dt = CreateLot.QueryWorkorderIno(wo);

        if (dt.Rows.Count > 0)
        {
            txtBOMID.Text          = dt.Rows[0]["bomid"].ToString();
            txtMouldLength.Text    = dt.Rows[0]["mouldLength"].ToString();
            txtMouldPETType.Text   = dt.Rows[0]["mouldpettype"].ToString();
            txtMouldPinMin.Text    = dt.Rows[0]["mouldpinmin"].ToString();
            txtMouldThinkness.Text = dt.Rows[0]["mouldthinkness"].ToString();
            txtMouldType.Text      = dt.Rows[0]["mouldtype"].ToString();
            txtMouldWidth.Text     = dt.Rows[0]["mouldwidth"].ToString();
            txtWorkflow.Text       = dt.Rows[0]["flowidalias"].ToString();
            txtWorkorderType.Text  = dt.Rows[0]["workordertype"].ToString();
            txtWorkshopID.Text     = dt.Rows[0]["WorkshopID"].ToString();
            txtWorkflowID.Text     = dt.Rows[0]["flowid"].ToString();
            Showflowid(dt.Rows[0]["flowid"].ToString());
        }
        else
        {
            JScript.Alert("未查询到工单信息", this);
        }
    }
Exemplo n.º 4
0
    protected void btnEnter_Click(object sender, EventArgs e)
    {
        //查询是否可以过站
        string result = CRUD.QueryStationOfLot(lblWorksiteID.Text, txtLot.Text);

        if (result != "success")
        {
            JScript.Alert(result, this);
            txtLot.Text = "";
            return;
        }

        DataTable lotDt = CRUD.GetLotBasisInfo(txtLot.Text);

        ViewState["lotDt"] = lotDt;
        string workshop = lotDt.Rows[0]["workshopID"].ToString();

        setddl(workshop);

        string WO = lotDt.Rows[0]["workorder"].ToString();

        ViewState["WO"] = WO;
        #region 批次流程


        //查询批次流程
        CRUD.setLabelProcess(lblLotprocess, lblCurrnentWorksite, lblEndProcess, txtLot.Text, lblWorksiteID.Text);
        #endregion
        DataTable dt = CRUD.GetWorkflow(txtLot.Text);
        string    firstWorksiteID = dt.Rows[0]["worksiteid"].ToString();

        //第一个站点从工单获取;
        if (lblWorksiteID.Text == firstWorksiteID)
        {
            //查询工单中的长、宽
            dt.Clear();
            dt = CreateLot.QueryWorkorderIno(WO);
            txtPreLength.Text = dt.Rows[0]["mouldlength"].ToString();
            txtPreWidth.Text  = dt.Rows[0]["mouldwidth"].ToString();
        }
        else
        {
            //批次已过站点
            string WorksiteIDOfLot = CRUD.GetWorksite2(txtLot.Text);
            //查询前站的长宽
            dt.Clear();
            dt = CRUD.getStationInfo(txtLot.Text, WorksiteIDOfLot);
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (dt.Rows[i]["paratype"].ToString() == "MouldLength")
                {
                    txtPreLength.Text = dt.Rows[i]["paraid"].ToString();
                }
                if (dt.Rows[i]["paratype"].ToString() == "MouldWidth")
                {
                    txtPreWidth.Text = dt.Rows[i]["paraid"].ToString();
                }
            }
        }
        //查询母批的长度宽度及其剩余量
        //FilmCRUD.GetPreLengthAndWidth(txtPreLength, txtPreWidth, txtLot.Text, lblWorksiteID.Text, WO, "");
        //txtRestLength.Text = lotDt.Rows[0]["restlength"].ToString();
        //txtPreLength.Text = lotDt.Rows[0]["mouldlength"].ToString();
        //txtPreWidth.Text = lotDt.Rows[0]["mouldwidth"].ToString();
        //=======前站宽幅长度和剩余长度取有效值 modify by lei.xue on 2017-6-1================
        txtRestLength.Text = lotDt.Rows[0]["restlength"].ToString();
        txtPreLength.Text  = lotDt.Rows[0]["validlength"].ToString();
        txtPreWidth.Text   = lotDt.Rows[0]["validwidth"].ToString();
        //==========标签增加产品类型 add by lei.xue on 2017-5-20================
        txtProductType.Text = lotDt.Rows[0]["producttype"].ToString();
        //生成条码
        LabelInfo(ddlEqp.SelectedValue.ToString().Substring(0, 3));
    }
Exemplo n.º 5
0
    protected void btnSaveClose_Click(object sender, EventArgs e)
    {
        if (txtWorkflowID.Text == "" || txtWorkshopID.Text == "" || txtWorkOrder.Text == "")
        {
            JScript.Alert("请输入工单按回车", this);
            return;
        }
        if (txtLotLength.Text == "" || txtLotWidth.Text == "")
        {
            JScript.Alert("请输入批次长度和批次宽度", this);
            return;
        }

        DataTable viewdt = (DataTable)ViewState["dt"];

        if (viewdt.Rows.Count <= 0)
        {
            JScript.Alert("请先生成PET编号,在文本框输入数量按回车!", this);
            return;
        }
        //循环datatable插入lotbasis
        for (int i = 0; i <= grd.Rows.Count - 1; i++)
        {
            //CheckBox cbx = (CheckBox)grd.Rows[i].FindControl("cbx");
            //if (cbx.Checked == true)
            //{
            //    //result = EqpManage.Delete(grd.Rows[i].Cells[1].Text);
            //    //if (result != "success")
            //    //{
            //    //    JScript.Alert("删除设备!", this);
            //    //}
            //}
            LotBasisDatalist dl = new LotBasisDatalist();
            dl.flowid          = txtWorkflowID.Text;
            dl.workshopid      = txtWorkshopID.Text;
            dl.lottype         = "Film";
            dl.status          = "Active";
            dl.createuser      = System.Web.HttpContext.Current.Request.Cookies["userID"].Value.ToString();
            dl.currentflowidno = "0";
            dl.factoryid       = "";
            dl.workorder       = txtWorkOrder.Text;//ddlWorkorder.SelectedValue;
            dl.reworkorder     = "";
            dl.lotid           = grd.Rows[i].Cells[0].Text;
            dl.lotcount        = "1";
            dl.Filmlevel       = "A";
            //创建批次增加宽度和长度记录
            //批次长宽改为手动输入 modify by lei.xue on 2017-4-12================================================
            //dl.length = txtMouldLength.Text;
            //dl.restlength = txtMouldLength.Text;
            //dl.width = txtMouldWidth.Text;
            //dl.restwidth = txtMouldWidth.Text;
            dl.length     = txtLotLength.Text;
            dl.restlength = txtLotLength.Text;
            dl.width      = txtLotWidth.Text;
            dl.restwidth  = txtLotWidth.Text;
            //增加有效长度
            dl.validlength = txtLotLength.Text;
            dl.validwidth  = txtLotWidth.Text;

            string result = CreateMouldLot.InsertLot(dl);
            if (result != "success")
            {
                JScript.Alert(result, this);
                return;
            }
            string WOStatusResult = CreateLot.ChangWOStatus(txtWorkOrder.Text, "open");
            if (WOStatusResult != "success")
            {
                JScript.Alert("开启工单失败!", this);
                return;
            }
            JScript.Alert("创建PET膜序列号成功!", this);
            ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>PrintLabel();</script>");
            //CreateTable();
            //databind();
            //txtLotCount.Text = "";
        }
    }