Exemple #1
0
        public void ScanTM()
        {
            TM_Type type = TMtype(SMtextBox.Text.Trim());

            switch (type)
            {
            case TM_Type.none:
                //MessageBox.Show("你扫描的是无效的条码!!", "消息框");
                ShowMeg(q(Msg_Type.msgscantminvalid));
                break;

            case TM_Type.staffno:
                getCzrInfo();
                break;

            case TM_Type.gd:
                //MessageBox.Show("你扫描的是无效的条码!!", "消息框");
                ShowMeg(q(Msg_Type.msgscantminvalid));
                break;

            case TM_Type.ph:
                //MessageBox.Show("你扫描的是无效的条码!!", "消息框");
                ShowMeg(q(Msg_Type.msgscantminvalid));
                break;

            default:
                //MessageBox.Show("你扫描的是无效的条码!!", "消息框");
                ShowMeg(q(Msg_Type.msgscantminvalid));
                break;
            }
            SMtextBox.Clear();
            SMtextBox.Select();
        }
Exemple #2
0
        public void getCzrInfo()
        {
            MES_TM_CZR model = new MES_TM_CZR();

            model.GC    = _MES_PD_SCRW_LIST.GC;
            model.RWBH  = _MES_PD_SCRW_LIST.RWBH;
            model.CZLB  = 1;
            model.CZRGH = SMtextBox.Text.Trim();
            model.GWID  = 0;
            MES_RETURN_UI res = AddCzr(model);

            if (res.TYPE.Equals("S"))
            {
                _czrList = SelectCZR(model);

                czrytextBox.Text = _czrList.CZR;
            }
            else
            {
                //MessageBox.Show(res.MESSAGE, "消息框");
                ShowMeg(res.MESSAGE);
            }
            SMtextBox.Clear();
            SMtextBox.Select();
        }
Exemple #3
0
        private void getRwAndJLinfoByTm()
        {
            MES_PD_SCRW_SELECT_BY_TM model = new MES_PD_SCRW_SELECT_BY_TM();

            model.SBBH = SBHID;
            model.TM   = SMtextBox.Text.Trim().ToUpper();
            model.ZPRQ = Convert.ToDateTime(ServicModel.PUBLIC_FUNC.GET_TIME(getToken())).AddHours(-4).ToString("yyyy-MM-dd");
            SELECT_MES_PD_SCRW res = ServicModel.PD_SCRW.SELECT_BY_TM(model, getToken());

            if (res.MES_RETURN.TYPE.Equals("S"))
            {
                if (res.MES_PD_SCRW_LIST.Length == 1)
                {
                    RefreshRW(res.MES_PD_SCRW_LIST[0], SBHID);
                    SMtextBox.Text = model.TM;
                    getReportInfoByTm();

                    //BOMdataGridView.ClearSelection();
                }
                else if (res.MES_PD_SCRW_LIST.Length > 1)
                {
                    SMtextBox.Clear();
                    frmChange_GD form = new frmChange_GD(res.MES_PD_SCRW_LIST, model.SBBH, RigthType);
                    form.block = RefreshRW;
                    show(form);
                    //for (int i = 0; i < BOMdataGridView.Rows.Count; i++)
                    //{
                    //    BOMdataGridView.Rows[i].Cells["状态"].Style.BackColor = Color.Red;

                    //}
                    //BOMdataGridView.ClearSelection();
                    //Tmlist = new List<TMDataGrid>();
                    //LSdataGridView.DataSource = Tmlist;
                    //LSdataGridView.Columns["删除"].DisplayIndex = 4;

                    //SMtextBox.Select();
                    SMtextBox.Text = model.TM;
                    getReportInfoByTm();
                }
                else if (res.MES_PD_SCRW_LIST.Length == 0)
                {
                    //ShowMeg("找不到条码" + SMtextBox.Text.Trim() + "对应的任务信息");
                    ShowMeg(string.Format(q(Msg_Type.msgtmnorw), SMtextBox.Text.Trim()));
                }
                else
                {
                    //ShowMeg("数据异常,请联系管理员");
                    ShowMeg(q(Msg_Type.msgtmexcept));
                }
                SMtextBox.Select();
            }
            else
            {
                ShowMeg(res.MES_RETURN.MESSAGE);
                BomList = new ZBCFUN_GDJGXX_READ();
                BOMdataGridView.DataSource = new List <BomDataGrid>();
                SMtextBox.Clear();
                SMtextBox.Select();
            }
        }
Exemple #4
0
        public void getReportInfoByTm()
        {
            //if (IsTMP)
            //{
            MES_TM_TMINFO model = new MES_TM_TMINFO();

            model.GC   = this._MES_PD_SCRW_LIST.GC;
            model.TM   = SMtextBox.Text.Trim().ToUpper();
            model.RWBH = this._MES_PD_SCRW_LIST.RWBH;
            model.JLR  = Convert.ToInt32(getUserInfo("staffid"));
            SELECT_MES_TM_TMINFO_BYTM res = ReadphTM(model, 1);

            if (res.MES_RETURN.TYPE.Equals("S"))
            {
                getTMList(res);
            }
            else
            {
                //MessageBox.Show(SMtextBox.Text + res.MES_RETURN.MESSAGE, "消息框");
                ShowMeg(SMtextBox.Text + res.MES_RETURN.MESSAGE);
            }
            //}
            //else
            //{
            //    ShowMeg("请先扫描托盘码");
            //}

            SMtextBox.Clear();
            SMtextBox.Select();
        }
        public void getReportInfoByTm()
        {
            MES_PD_TL model = new MES_PD_TL();

            model.RWBH = Rwlist[Index].RWBH;
            model.TM   = SMtextBox.Text.Trim().ToUpper();
            model.JLR  = Convert.ToInt32(getUserInfo("staffid"));
            MES_RETURN_UI res = ServicModel.PD_SCRW.FJTL_VERIFY(model, getToken());

            if (res.TYPE.Equals("S"))
            {
                //foreach (Control contrl in panel1.Controls)
                //{
                //    if (contrl is TextBox)
                //    {
                //        contrl.BackColor = Color.FromArgb(187, 255, 102);
                //    }
                //}
                qrtlbutton.Enabled = true;
                string datetime = ServicModel.PUBLIC_FUNC.GET_TIME(getToken());

                tlsjtextBox.Text      = Convert.ToDateTime(datetime).ToString("yyyy-MM-dd HH:mm");
                tlsjtextBox.BackColor = Color.FromArgb(187, 255, 102);
                //MessageBox.Show("投料成功", "消息框");
                ShowMeg("投料成功", 1500);
            }
            else
            {
                ShowMeg(res.MESSAGE);
            }
            SMtextBox.Clear();
            SMtextBox.Select();
        }
 private void SMtextBox_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         MES_TM_CZR model = new MES_TM_CZR();
         if (Czlb == 1)
         {
             model.RWBH = _MES_PD_SCRW_LIST.RWBH;
             model.CZLB = Czlb;
         }
         else if (Czlb == 2)
         {
             model.SBBH = _MES_PD_SCRW_LIST.SBBH;
             model.CZLB = Czlb;
         }
         model.GC    = _MES_PD_SCRW_LIST.GC;
         model.CZRGH = SMtextBox.Text.Trim();
         model.GWID  = 0;
         MES_RETURN_UI res = AddCzr(model);
         if (res.TYPE.Equals("S"))
         {
             _czrList = ServicModel.TM_CZR.SELECT_CZR_NOW(model, getToken());
             DatagridgetData();
         }
         else
         {
             //MessageBox.Show(res.MESSAGE, "消息框");
             ShowMeg(res.MESSAGE);
         }
         SMtextBox.Clear();
     }
 }
Exemple #7
0
        public void getCzrInfo()
        {
            MES_TM_CZR model = new MES_TM_CZR();

            model.SBBH  = Rwlist[Index].SBBH;
            model.GC    = Rwlist[Index].GC;
            model.CZLB  = 2;
            model.CZRGH = SMtextBox.Text.Trim();
            model.GWID  = 0;
            MES_RETURN_UI res = AddCzr(model);

            if (res.TYPE.Equals("S"))
            {
                Crzlist         = SelectCZR(model);
                czrtextBox.Text = Crzlist.CZR;
                //czrytextBox.Text = _czrList.CZR;
            }
            else
            {
                //MessageBox.Show(res.MESSAGE, "消息框");
                ShowMeg(res.MESSAGE);
            }
            SMtextBox.Clear();
            SMtextBox.Select();
        }
Exemple #8
0
        public void getReportInfoByTm()
        {
            bool isY = false;

            for (int i = 0; i < BindList.Count; i++)
            {
                if (SMtextBox.Text.Trim().ToUpper() == BindList[i].TM)
                {
                    isY = true;
                }
            }
            if (isY)
            {
                ShowMeg(string.Format(q(Msg_Type.msgtmcf), SMtextBox.Text.Trim()));//
                SMtextBox.Clear();
                SMtextBox.Select();
                return;
            }


            MES_WLKCBS_GETWLZJ_IN model = new MES_WLKCBS_GETWLZJ_IN();

            model.MBLNR   = ZSL_BCS303_BS.MBLNR;
            model.XCBS    = ZSL_BCS303_BS.XCBS;
            model.MJAHR   = ZSL_BCS303_BS.MJAHR;
            model.LINE_ID = ZSL_BCS303_BS.LINE_ID;
            model.LIFNR   = ZSL_BCS303_BS.LIFNR;
            model.TM      = SMtextBox.Text.Trim().ToUpper();
            SELECT_MES_TM_TMINFO_BYTM res = ServicModel.TM_TMINFO.SELECT_WLKCBS(model, getToken());

            if (res.MES_RETURN.TYPE.Equals("S"))
            {
                for (int i = 0; i < res.MES_TM_TMINFO_LIST.Length; i++)
                {
                    BindList.Add(res.MES_TM_TMINFO_LIST[i]);
                }
                for (int i = 0; i < BindList.Count; i++)
                {
                    BindList[i].XH   = i + 1;
                    BindList[i].WLMS = BindList[i].WLH + "/" + BindList[i].WLMS;
                }
                dataGridView2.DataSource = new List <MES_TM_TMINFO_LIST>();
                dataGridView2.DataSource = BindList;
                dataGridView2.ClearSelection();
                Verify();
            }
            else
            {
                ShowMeg(res.MES_RETURN.MESSAGE);
            }
            SMtextBox.Clear();
            SMtextBox.Select();
        }
Exemple #9
0
        public void ScanTM()
        {
            TM_Type type = TMtype(SMtextBox.Text.Trim());

            if (type != TM_Type.tpm)
            {
                if (!IsTMP)
                {
                    ShowMeg(q(Msg_Type.msgscantpm));
                    SMtextBox.Clear();
                    SMtextBox.Select();
                    return;
                }
            }
            switch (type)
            {
            case TM_Type.none:
                //MessageBox.Show("你扫描的是无效的条码!!", "消息框");
                ShowMeg(q(Msg_Type.msgscantminvalid));
                break;

            case TM_Type.staffno:
                getCzrInfo();
                break;

            case TM_Type.gd:
                //MessageBox.Show("你扫描的是无效的条码!!", "消息框");
                ShowMeg(q(Msg_Type.msgscantminvalid));
                //getGDinfo();
                break;

            case TM_Type.ph:

                getReportInfoByTm();
                break;

            case TM_Type.tpm:
                getTPMinfo(SMtextBox.Text.Trim().ToUpper());
                break;

            default:
                //MessageBox.Show("你扫描的是无效的条码!!", "消息框");
                ShowMeg(q(Msg_Type.msgscantminvalid));
                break;
            }
            SMtextBox.Clear();
            SMtextBox.Select();
        }
Exemple #10
0
        private void SMtextBox_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                MES_TM_CZR model = new MES_TM_CZR();
                model.SBBH  = MES_PD_SCRW_LIST.SBBH;
                model.GC    = MES_PD_SCRW_LIST.GC;
                model.CZLB  = 2;
                model.CZRGH = SMtextBox.Text.Trim();
                model.GWID  = 0;
                MES_RETURN_UI res = AddCzr(model);
                if (res.TYPE.Equals("S"))
                {
                    Crzlist         = SelectCZR(model);
                    czrtextBox.Text = Crzlist.CZR;

                    //czrytextBox.Text = _czrList.CZR;
                }
                else
                {
                    //MessageBox.Show(res.MESSAGE, "消息框");
                    ShowMeg(res.MESSAGE);
                }
                SMtextBox.Clear();

                //MES_SY_CZR_BYGH model = ServicModel.TM_CZR.GET_RYNAME(SMtextBox.Text.Trim(), getToken());
                //if (string.IsNullOrEmpty(model.NAME))
                //{
                //    ShowMeg("查不到人员信息");
                //    return;
                //}
                //else
                //{

                //    MES_SY_CZR_BYGH = model;
                //    czrtextBox.Text =  model.NAME;
                //    SMtextBox.Clear();
                //}
            }
        }
Exemple #11
0
 private void ryglbutton_Click(object sender, EventArgs e)
 {
     if (IsTMP)
     {
         frmManagerRY fomr = new frmManagerRY(_czrList, MES_PD_SCRW_LIST, 1);
         show(fomr);
         MES_TM_CZR rymodel = new MES_TM_CZR();
         rymodel.GC   = this._MES_PD_SCRW_LIST.GC;
         rymodel.RWBH = this._MES_PD_SCRW_LIST.RWBH;
         rymodel.CZLB = 1;
         _czrList     = ServicModel.TM_CZR.SELECT_CZR_NOW(rymodel, getToken());
         //MES_PD_SCRW model = new MES_PD_SCRW();
         //model.SBHID = SBHID;
         czrytextBox.Text = _czrList.CZR;
         //SELECT_MES_PD_SCRW Smodel = ServicModel.PD_SCRW.SELECT(model, getToken());
     }
     else
     {
         ShowMeg(q(Msg_Type.msgscantpm));
     }
     SMtextBox.Clear();
     SMtextBox.Select();
 }
        public void ScanTM()
        {
            TM_Type type = TMtype(SMtextBox.Text.Trim());

            switch (type)
            {
            case TM_Type.none:
                MessageBox.Show("你扫描的是无效的条码!!", "消息框");
                break;

            case TM_Type.staffno:
                getCzrInfo();
                break;

            case TM_Type.wllot:
                getwllot();
                break;

            default:
                MessageBox.Show("你扫描的是无效的条码!!", "消息框");
                break;
            }
            SMtextBox.Clear();
        }
Exemple #13
0
        private void getTMList(SELECT_MES_TM_TMINFO_BYTM model, int first)
        {
            for (int x = 0; x < model.MES_TM_TMINFO_LIST.Length; x++)
            {
                IList <TMDataGrid> nodes = new List <TMDataGrid>();
                TMDataGrid         node  = new TMDataGrid();

                if (model.MES_TM_TMINFO_LIST.Length <= 0)
                {
                    //MessageBox.Show("扫描的是无效的条码", "消息框");
                    ShowMeg(q(Msg_Type.msgscantminvalid));
                    SMtextBox.Clear();
                    return;
                }

                node.Tm   = model.MES_TM_TMINFO_LIST[x].TM;
                node.Wlxx = model.MES_TM_TMINFO_LIST[x].WLH + "/" + model.MES_TM_TMINFO_LIST[x].WLMS;
                node.Wllb = model.MES_TM_TMINFO_LIST[x].WLLBNAME;
                //node.Bz = model.MES_TM_TMINFO_LIST[0].REMARK;
                node.Wllbdm = model.MES_TM_TMINFO_LIST[x].WLLB;
                node.Gc     = model.MES_TM_TMINFO_LIST[0].GC;
                node.Tltmid = model.MES_TM_TMINFO_LIST[x].TLTMID;
                //node.Tmid = model.MES_TM_TMINFO_LIST[0].TM;
                //bool isBom = false;
                if (_bomList.ET_BOM != null)
                {
                    for (int i = 0; i < _bomList.ET_BOM.Length; i++)
                    {
                        if (_bomList.ET_BOM[i].WLLB == node.Wllbdm)
                        {
                            BOMdataGridView.Rows[i].Cells[q(Msg_Type.fieldstatus)].Style.BackColor = Color.FromArgb(187, 255, 102);//"状态"
                        }
                    }
                }
                else
                {
                }


                //if (isBom == false)
                //{
                //    if (MessageBox.Show("你扫描的条码不是物料的BOM组成部分!!", "消息框", MessageBoxButtons.OK) == DialogResult.OK)
                //    {
                //        SMtextBox.Clear();
                //    }

                //    return;
                //}
                bool replace = false;
                if (Tmlist.Count > 0)
                {
                    for (int i = 0; i < Tmlist.Count; i++)
                    {
                        if (node.Wllbdm == Tmlist[i].Wllbdm)
                        {
                            replace   = true;
                            Tmlist[i] = node;
                        }
                    }
                    if (replace == false)
                    {
                        Tmlist.Add(node);
                    }
                }
                else
                {
                    Tmlist.Add(node);
                }
                for (int i = 0; i < Tmlist.Count; i++)
                {
                    Tmlist[i].Xh = (i + 1).ToString();
                }
                if (RigthType == Rigth_Type.mfqqingxi)
                {
                    pctextBox.Text = model.MES_TM_TMINFO_LIST[x].PC;
                }
                LSdataGridView.DataSource = Tmlist.ToList();
                LSdataGridView.ClearSelection();
                LSdataGridView.Columns[q(Msg_Type.fielddelete)].DisplayIndex = 4;//"删除"
            }
            if (first == 1)
            {
                if (model.MES_TM_TMINFO_LIST.Length == 1)
                {
                    //MessageBox.Show("投料成功!!!", "消息框");
                    ShowMeg(q(Msg_Type.msgtlsuccess), 1500);//"投料成功"
                }
            }


            SMtextBox.Clear();
            SMtextBox.Select();
        }
Exemple #14
0
        public void ChangeRW()
        {
            MES_PD_SCRW model = new MES_PD_SCRW();

            model.RWBH = SMtextBox.Text.Trim().ToUpper();
            model.GC   = getGC("value");
            model.SBBH = SBHID;
            SELECT_MES_PD_SCRW res = ServicModel.PD_SCRW.SELECT(model, getToken());

            if (res.MES_RETURN.TYPE.Equals("S"))
            {
                MES_PD_SCRW_LIST list = res.MES_PD_SCRW_LIST[0];
                Tmlist = new List <TMDataGrid>();
                LSdataGridView.DataSource = Tmlist;
                LSdataGridView.Columns[q(Msg_Type.fielddelete)].DisplayIndex = 4;//"删除"
                this._MES_PD_SCRW_LIST = list;
                MES_TM_CZR rymodel = new MES_TM_CZR();
                rymodel.GC   = list.GC;
                rymodel.RWBH = list.RWBH;
                rymodel.CZLB = 1;
                _czrList     = ServicModel.TM_CZR.SELECT_CZR_NOW(rymodel, getToken());
                _bomList     = ServicModel.PD_GD.SAP_GET_GDJGXX(list.RWBH, dateTimePicker1.Text.Trim(), list.GC, getToken());
                unRequireArr = new List <int>();
                MES_SY_TYPEMX bcmodel = new MES_SY_TYPEMX();
                bcmodel.GC     = Convert.ToString(getGC("value"));
                bcmodel.TYPEID = 5;
                List <MES_SY_TYPEMXLIST> bcArr  = new List <MES_SY_TYPEMXLIST>();
                MES_SY_TYPEMXLIST[]      bclist = ServicModel.SY_TYPEMX.SELECT(bcmodel, getToken());
                gzzxtextBox.Text = list.GZZXBH + "-" + list.GZZXNAME;
                czrytextBox.Text = _czrList.CZR;
                gctextBox.Text   = list.GC;
                sbhtextBox.Text  = list.SBH;
                pctextBox.Text   = list.PC;
                bcArr            = bclist.ToList();
                MES_SY_TYPEMXLIST bcmodel1 = new MES_SY_TYPEMXLIST();
                bcmodel1.ID     = 0;
                bcmodel1.MXNAME = q(Msg_Type.titlechoice);//"==请选择==";
                bcArr.Insert(0, bcmodel1);
                bccomboBox.DisplayMember = "MXNAME";
                bccomboBox.ValueMember   = "ID";
                bccomboBox.DataSource    = bcArr;
                bccomboBox.SelectedValue = list.BC;
                MESlabel.Text            = q(Msg_Type.titlemesgd) + list.GDDH;                 //"MES工单:"
                GDHlabel.Text            = q(Msg_Type.titlegd) + list.ERPNO;                   //"工单号:"
                WLXXlabel.Text           = q(Msg_Type.titlewlxx) + list.WLH + "/" + list.WLMS; //"物料信息:"
                WLLBlabel1.Text          = q(Msg_Type.titlewllb) + list.WLLBNAME;              //"物料类别:"
                rwdlabel.Text            = q(Msg_Type.titlerwd) + list.RWBH;                   //"任务单:"
                if (_bomList.MES_RETURN.TYPE.Equals("S"))
                {
                    BOMdataGridView.DataSource = getBomList(_bomList);
                }
                else
                {
                    ShowMeg(_bomList.MES_RETURN.MESSAGE);
                    BOMdataGridView.DataSource = new List <BomDataGrid>();
                }
                //scrqtextBox.Text = DateTime.Now.ToString("yyyy-MM-dd");
                LSdataGridView.ReadOnly = true;
                BOMdataGridView.Columns[q(Msg_Type.fieldstatus)].DefaultCellStyle.BackColor = Color.Red;//"状态"
                for (int i = 0; i < unRequireArr.Count; i++)
                {
                    BOMdataGridView.Rows[unRequireArr[i]].Cells[q(Msg_Type.fieldstatus)].Style.BackColor = Color.White;//"状态"
                }
                //SELECT_MES_TM_TMINFO_BYTM r = ServicModel.TM_TMINFO.SELECT_TL_LAST(MES_PD_SCRW_LIST.RWBH, getToken());
                //if (r.MES_RETURN.TYPE.Equals("S"))
                //{
                //    getTMList(r, 0);
                //}
                Tmlist = new List <TMDataGrid>();
                LSdataGridView.DataSource = new List <TMDataGrid>();
                LSdataGridView.ClearSelection();
                LSdataGridView.Columns[q(Msg_Type.fielddelete)].DisplayIndex = 4;//"删除"
                BOMdataGridView.ClearSelection();
                if (RigthType == Rigth_Type.mfqqingxi)
                {
                    GDHlabel.Visible   = false;
                    WLXXlabel.Location = GDHlabel.Location;
                }
            }
            else
            {
                //MessageBox.Show(SMtextBox.Text + res.MES_RETURN.MESSAGE, "消息框");
                ShowMeg(SMtextBox.Text + res.MES_RETURN.MESSAGE);
            }
            SMtextBox.Clear();
            SMtextBox.Select();
        }
Exemple #15
0
        private void getTMList(SELECT_MES_TM_TMINFO_BYTM model)
        {
            for (int x = 0; x < model.MES_TM_TMINFO_LIST.Length; x++)
            {
                IList <TMDataGrid> nodes = new List <TMDataGrid>();
                TMDataGrid         node  = new TMDataGrid();

                if (model.MES_TM_TMINFO_LIST.Length <= 0)
                {
                    //MessageBox.Show("扫描的是无效的条码", "消息框");
                    ShowMeg(q(Msg_Type.msgscantminvalid));
                    SMtextBox.Clear();
                    SMtextBox.Select();
                    return;
                }
                node.Tm   = model.MES_TM_TMINFO_LIST[x].TM;
                node.Wlxx = model.MES_TM_TMINFO_LIST[x].WLH + "/" + model.MES_TM_TMINFO_LIST[x].WLMS;
                node.Wllb = model.MES_TM_TMINFO_LIST[x].WLLBNAME;
                //node.Bz = model.MES_TM_TMINFO_LIST[0].REMARK;
                node.Wllbdm = model.MES_TM_TMINFO_LIST[x].WLLB;
                node.Gc     = model.MES_TM_TMINFO_LIST[0].GC;
                node.Tltmid = model.MES_TM_TMINFO_LIST[x].TLTMID;
                //node.Tmid = model.MES_TM_TMINFO_LIST[0].TM;
                bool isBom = false;
                for (int i = 0; i < _bomList.ET_BOM.Length; i++)
                {
                    //if (_bomList.ET_BOM[i].ZSBS.Equals("Y"))
                    //{

                    //    if (_bomList.ET_BOM[i].IDNRK == node.Wlxx.Split('/')[0])
                    //    {
                    //        isBom = true;
                    //        BOMdataGridView.Rows[i].Cells["状态"].Style.BackColor = Color.FromArgb(187, 255, 102);
                    //    }
                    //}
                    //else
                    //{
                    if (_bomList.ET_BOM[i].WLLB == node.Wllbdm)
                    {
                        isBom = true;
                        BOMdataGridView.Rows[i].Cells[q(Msg_Type.fieldstatus)].Style.BackColor = Color.FromArgb(187, 255, 102);
                    }
                    //}
                }
                if (isBom == false)
                {
                    if (MessageBox.Show(q(Msg_Type.msgbominvalid), q(Msg_Type.msgtitle), MessageBoxButtons.OK) == DialogResult.OK)
                    {
                        SMtextBox.Clear();
                        SMtextBox.Select();
                    }

                    return;
                }
                bool replace = false;
                if (Tmlist.Count > 0)
                {
                    for (int i = 0; i < Tmlist.Count; i++)
                    {
                        if (node.Tm == Tmlist[i].Tm)
                        {
                            replace = true;
                        }
                    }
                    if (replace == false)
                    {
                        Tmlist.Add(node);
                    }
                    else
                    {
                        //ShowMeg("条码" + SMtextBox.Text + "不允许重复添加");
                        ShowMeg(string.Format(q(Msg_Type.msgtmcf), SMtextBox.Text));
                        return;
                    }
                }
                else
                {
                    Tmlist.Add(node);
                }
                for (int i = 0; i < Tmlist.Count; i++)
                {
                    Tmlist[i].Xh = (i + 1).ToString();
                }
                LSdataGridView.DataSource = Tmlist.ToList();
                LSdataGridView.ClearSelection();
                LSdataGridView.Columns[q(Msg_Type.fielddelete)].DisplayIndex = 4;
            }
            if (model.MES_TM_TMINFO_LIST.Length == 1)
            {
                //MessageBox.Show("投料成功!!!", "消息框");
                ShowMeg(q(Msg_Type.msgtlsuccess), 1500);
            }
            SMtextBox.Clear();
            SMtextBox.Select();
        }
Exemple #16
0
        private void getTMList(SELECT_MES_TM_TMINFO_BYTM model)
        {
            for (int x = 0; x < model.MES_TM_TMINFO_LIST.Length; x++)
            {
                IList <TMDataGrid> nodes = new List <TMDataGrid>();
                TMDataGrid         node  = new TMDataGrid();

                if (model.MES_TM_TMINFO_LIST.Length <= 0)
                {
                    MessageBox.Show("扫描的是无效的条码", "消息框");
                    SMtextBox.Clear();
                    return;
                }

                node.Tm   = model.MES_TM_TMINFO_LIST[x].TM;
                node.Wlxx = model.MES_TM_TMINFO_LIST[x].WLH + "/" + model.MES_TM_TMINFO_LIST[x].WLMS;
                node.Wllb = model.MES_TM_TMINFO_LIST[x].WLLBNAME;
                //node.Bz = model.MES_TM_TMINFO_LIST[0].REMARK;
                node.Wllbdm = model.MES_TM_TMINFO_LIST[x].WLLB;
                node.Gc     = model.MES_TM_TMINFO_LIST[0].GC;
                node.Tltmid = model.MES_TM_TMINFO_LIST[x].TLTMID;
                //node.Tmid = model.MES_TM_TMINFO_LIST[0].TM;
                bool isBom = false;
                for (int i = 0; i < _bomList.ET_BOM.Length; i++)
                {
                    if (_bomList.ET_BOM[i].ZSBS.Equals("Y"))
                    {
                        if (_bomList.ET_BOM[i].IDNRK == node.Wlxx.Split('/')[0])
                        {
                            isBom = true;
                            //BOMdataGridView.Rows[i].DefaultCellStyle.BackColor = Color.Cyan;
                            //BOMdataGridView.Columns["状态"].DefaultCellStyle.BackColor = Color.Red;
                            BOMdataGridView.Rows[i].Cells["状态"].Style.BackColor = Color.FromArgb(187, 255, 102);
                        }
                    }
                    else
                    {
                        if (_bomList.ET_BOM[i].WLLB == node.Wllbdm)
                        {
                            isBom = true;
                            BOMdataGridView.Rows[i].Cells["状态"].Style.BackColor = Color.FromArgb(187, 255, 102);
                        }
                    }
                }
                if (isBom == false)
                {
                    if (MessageBox.Show("你扫描的条码不是物料的BOM组成部分!!", "消息框", MessageBoxButtons.OK) == DialogResult.OK)
                    {
                        SMtextBox.Clear();
                    }

                    return;
                }
                bool replace = false;
                if (Tmlist.Count > 0)
                {
                    for (int i = 0; i < Tmlist.Count; i++)
                    {
                        if (node.Wllbdm == Tmlist[i].Wllbdm)
                        {
                            replace   = true;
                            Tmlist[i] = node;
                        }
                    }
                    if (replace == false)
                    {
                        Tmlist.Add(node);
                    }
                }
                else
                {
                    Tmlist.Add(node);
                }
                for (int i = 0; i < Tmlist.Count; i++)
                {
                    Tmlist[i].Xh = (i + 1).ToString();
                }
                LSdataGridView.DataSource = Tmlist.ToList();
                LSdataGridView.ClearSelection();
                LSdataGridView.Columns["删除"].DisplayIndex = 4;
            }
            if (model.MES_TM_TMINFO_LIST.Length == 1)
            {
                MessageBox.Show("投料成功!!!", "消息框");
            }

            SMtextBox.Clear();
        }