Exemplo n.º 1
0
 private void dybutton_Click(object sender, EventArgs e)
 {
     if (Convert.ToInt32(fsnumericUpDown.Value) > 0)
     {
         MES_TM_TMINFO TMINFOmodel = new MES_TM_TMINFO();
         TMINFOmodel.TM = tmtextBox.Text.Trim().ToUpper();
         SELECT_MES_TM_TMINFO_BYTM tminfiRes = ServicModel.TM_TMINFO.SELECT(TMINFOmodel, getToken());
         if (!tminfiRes.MES_RETURN.TYPE.Equals("S"))
         {
             ShowMeg(tminfiRes.MES_RETURN.MESSAGE);
             return;
         }
         if (tminfiRes.MES_TM_TMINFO_LIST != null && tminfiRes.MES_TM_TMINFO_LIST.Length == 1)
         {
             PrintInfoByTM(tmtextBox.Text.Trim().ToUpper(), tminfiRes.MES_TM_TMINFO_LIST[0].GC, Convert.ToInt32(fsnumericUpDown.Value), RigthType, PrintType);
         }
         else
         {
             //ShowMeg("读取扫描条码信息失败");
             ShowMeg(q(Msg_Type.msgloadtmfail));
             return;
         }
         this.Close();
     }
     else
     {
         //ShowMeg("打印份数必须大于0");
         ShowMeg(q(Msg_Type.msgprintnoempty));
     }
 }
Exemplo n.º 2
0
        public string INSERT_PD_TL_BL(string datastring)
        {
            string token   = AppClass.GetSession("token").ToString();
            int    STAFFID = Convert.ToInt32(AppClass.GetSession("STAFFID"));

            Sonluk.UI.Model.MES.PD_TLGLService.MES_PD_TL model = Newtonsoft.Json.JsonConvert.DeserializeObject <Sonluk.UI.Model.MES.PD_TLGLService.MES_PD_TL>(datastring);
            model.JLR = STAFFID;
            MES_TM_TMINFO model_MES_TM_TMINFO = new MES_TM_TMINFO();

            model_MES_TM_TMINFO.TM   = model.TM;
            model_MES_TM_TMINFO.RWBH = model.RWBH;
            MES_RETURN_UI             rst = new MES_RETURN_UI();
            SELECT_MES_TM_TMINFO_BYTM rst_SELECT_MES_TM_TMINFO_BYTM = mesModels.TM_TMINFO.SELECT_BYTM(model_MES_TM_TMINFO, 0, token);

            if (rst_SELECT_MES_TM_TMINFO_BYTM.MES_RETURN.TYPE == "S")
            {
                if (rst_SELECT_MES_TM_TMINFO_BYTM.MES_TM_TMINFO_LIST.Length == 1)
                {
                    rst = mesModels.PD_TLGL.INSERT(model, token);
                }
                else
                {
                    rst.TYPE    = "E";
                    rst.MESSAGE = "没有查询到条码信息!";
                }
            }
            else
            {
                rst.TYPE    = rst_SELECT_MES_TM_TMINFO_BYTM.MES_RETURN.TYPE;
                rst.MESSAGE = rst_SELECT_MES_TM_TMINFO_BYTM.MES_RETURN.MESSAGE;
            }
            return(Newtonsoft.Json.JsonConvert.SerializeObject(rst));
        }
Exemplo n.º 3
0
 private void TMtextBox_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         MES_TM_TMINFO model = new MES_TM_TMINFO();
         model.GC = MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.GC;
         model.TM = TMtextBox.Text.Trim().ToUpper();
         SELECT_MES_TM_TMINFO_BYTM res = ServicModel.TM_TMINFO.SELECT_BYTM(model, 0, getToken());
         //MES_TM_TMINFO model = new MES_TM_TMINFO();
         //model.GC = MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.GC;
         //model.TM = TMtextBox.Text.Trim().ToUpper();
         //model.RWBH = MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.RWBH;
         //SELECT_MES_TM_TMINFO_BYTM res = ReadphTM(model, 2);
         if (res.MES_RETURN.TYPE.Equals("S"))
         {
             if (res.MES_TM_TMINFO_LIST[0].TMLB != 2)
             {
                 ShowMeg("请扫描领用表条码");
             }
         }
         else
         {
             ShowMeg(res.MES_RETURN.MESSAGE);
         }
     }
 }
Exemplo n.º 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();
        }
Exemplo n.º 5
0
        public string GET_TMINFO_LB(string datastring)
        {
            string                    token = AppClass.GetSession("token").ToString();
            MES_TM_TMINFO             model_MES_TM_TMINFO           = Newtonsoft.Json.JsonConvert.DeserializeObject <MES_TM_TMINFO>(datastring);
            SELECT_MES_TM_TMINFO_BYTM rst_SELECT_MES_TM_TMINFO_BYTM = mesmodels.TM_TMINFO.SELECT_LB(model_MES_TM_TMINFO, token);

            return(Newtonsoft.Json.JsonConvert.SerializeObject(rst_SELECT_MES_TM_TMINFO_BYTM));
        }
Exemplo n.º 6
0
        public string MES_TMINFO_SELECT_LB(string cxdata)
        {
            token = appClass.CRM_Gettoken();
            MES_TM_TMINFO model = Newtonsoft.Json.JsonConvert.DeserializeObject <MES_TM_TMINFO>(cxdata);

            model.STAFFID = appClass.CRM_GetStaffid();
            SELECT_MES_TM_TMINFO_BYTM data = mesModels.TM_TMINFO.SELECT_LB(model, token);

            return(Newtonsoft.Json.JsonConvert.SerializeObject(data));
        }
Exemplo n.º 7
0
        public string GET_TMINFO(string datastring)
        {
            string        token = appClass.CRM_Gettoken();
            MES_TM_TMINFO model_MES_TM_TMINFO = Newtonsoft.Json.JsonConvert.DeserializeObject <MES_TM_TMINFO>(datastring);

            model_MES_TM_TMINFO.TMLB = 1;
            SELECT_MES_TM_TMINFO_BYTM rst_SELECT_MES_TM_TMINFO_BYTM = mesModels.TM_TMINFO.SELECT(model_MES_TM_TMINFO, token);

            return(Newtonsoft.Json.JsonConvert.SerializeObject(rst_SELECT_MES_TM_TMINFO_BYTM));
        }
Exemplo n.º 8
0
        public string GET_TM_ZFDC_BY_ROLE(string datastring)
        {
            int           STAFFID             = Convert.ToInt32(AppClass.GetSession("STAFFID"));
            string        token               = AppClass.GetSession("token").ToString();
            MES_TM_TMINFO model_MES_TM_TMINFO = Newtonsoft.Json.JsonConvert.DeserializeObject <MES_TM_TMINFO>(datastring);

            model_MES_TM_TMINFO.STAFFID = STAFFID;
            SELECT_MES_TM_TMINFO_BYTM rst_SELECT_MES_TM_TMINFO_BYTM = mesModels.TM_TMINFO.SELECT_ZFDC_BY_ROLE(model_MES_TM_TMINFO, token);

            return(Newtonsoft.Json.JsonConvert.SerializeObject(rst_SELECT_MES_TM_TMINFO_BYTM));
        }
Exemplo n.º 9
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();
        }
Exemplo n.º 10
0
        public string GET_TM_TL(string TM, string RWBH)
        {
            TokenINFO rst_TokenINFO = GET_TokenINFO();
            //string token = AppClass.GetSession("token").ToString();
            MES_TM_TMINFO model_MES_TM_TMINFO = new MES_TM_TMINFO();

            model_MES_TM_TMINFO.TM   = TM;
            model_MES_TM_TMINFO.RWBH = RWBH;
            SELECT_MES_TM_TMINFO_BYTM rst_SELECT_MES_TM_TMINFO_BYTM = mesmodels.TM_TMINFO.SELECT_BYTM(model_MES_TM_TMINFO, 0, rst_TokenINFO.Token);

            return(Newtonsoft.Json.JsonConvert.SerializeObject(rst_SELECT_MES_TM_TMINFO_BYTM));
        }
Exemplo n.º 11
0
        public string SET_TMTL(string RWBH, string TM, string REMARK)
        {
            TokenINFO     rst_TokenINFO       = GET_TokenINFO();
            MES_TM_TMINFO model_MES_TM_TMINFO = new MES_TM_TMINFO();

            model_MES_TM_TMINFO.RWBH     = RWBH;
            model_MES_TM_TMINFO.TM       = TM;
            model_MES_TM_TMINFO.JLR      = rst_TokenINFO.STAFFID;
            model_MES_TM_TMINFO.TLREMARK = REMARK;
            SELECT_MES_TM_TMINFO_BYTM rst_SELECT_MES_TM_TMINFO_BYTM = mesmodels.TM_TMINFO.SELECT_BYTM(model_MES_TM_TMINFO, 1, rst_TokenINFO.Token);

            return(Newtonsoft.Json.JsonConvert.SerializeObject(rst_SELECT_MES_TM_TMINFO_BYTM));
        }
Exemplo n.º 12
0
        private void frmTL2_Shown(object sender, EventArgs e)
        {
            BOMdataGridView.Columns["状态"].DefaultCellStyle.BackColor = Color.Red;
            for (int i = 0; i < unRequireArr.Count; i++)
            {
                BOMdataGridView.Rows[unRequireArr[i]].Cells["状态"].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);
            }
        }
Exemplo n.º 13
0
        public void ConfigTable(bool ISrwd)
        {
            MES_TM_TMINFO model = new MES_TM_TMINFO();

            model.MAC = DeviceInfo.GetNetCardMAC().Substring(0, 17);
            if (ISrwd)
            {
                model.RWBH = Rwbh;
            }
            model.WLLB = Wllb;
            DateTime sy_dt = Convert.ToDateTime(ServicModel.PUBLIC_FUNC.GET_TIME(getToken())).AddHours(-4);

            model.JLJSTIME = sy_dt.ToString("yyyy-MM-dd");
            model.JLKSTIME = sy_dt.ToString("yyyy-MM-dd");
            if (RigthType == Rigth_Type.zhengjicc)
            {
                model.GZZXBH = SBHID;
            }
            else
            {
                model.SBBH = SBHID;
            }

            SELECT_MES_TM_TMINFO_BYTM res = ServicModel.TM_TMINFO.SELECT(model, getToken());

            if (res.MES_RETURN.TYPE.Equals("S"))
            {
                TM_list = res.MES_TM_TMINFO_LIST.ToList();
                if (res.MES_TM_TMINFO_LIST.Length == 0)
                {
                    ShowMeg(q(Msg_Type.msgtodaynodata));//"当天没有对应的数据"
                }
                else
                {
                    JLdataGridView.DataSource = TM_list;

                    Type         type = JLdataGridView.GetType();
                    PropertyInfo pi   = type.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
                    pi.SetValue(JLdataGridView, true, null);
                    JLdataGridView.ClearSelection();
                }
            }
            else
            {
                ShowMeg(res.MES_RETURN.MESSAGE);
            }
            dybutton.Select();
        }
Exemplo n.º 14
0
        public void getReportInfoByTm()
        {
            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"))
            {
                ShowMeg(q(Msg_Type.msgtlsuccess), 1500);//"投料成功"
                UpdateJSDataGrid(MES_PD_SCRW_LIST.RWBH);
            }
            else
            {
                //MessageBox.Show(res.MES_RETURN.MESSAGE, "消息框");
                ShowMeg(res.MES_RETURN.MESSAGE);
            }
        }
Exemplo n.º 15
0
 private void TMtextBox_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         MES_TM_TMINFO model = new MES_TM_TMINFO();
         model.GC = MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.GC;
         SELECT_MES_TM_TMINFO_BYTM res = ServicModel.TM_TMINFO.SELECT_BYTM(model, 0, getToken());
         if (res.MES_RETURN.TYPE.Equals("S"))
         {
             if (res.MES_TM_TMINFO_LIST[0].TMLB != 2)
             {
                 //ShowMeg("请扫描领用表条码");
                 ShowMeg(q(Msg_Type.msgscanlybtm));
             }
         }
         else
         {
             ShowMeg(res.MES_RETURN.MESSAGE);
         }
     }
 }
Exemplo n.º 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("扫描的是无效的条码", "消息框");
                    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();
        }
Exemplo n.º 17
0
        private void smtextBox_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                TM_Type type = TMtype(smtextBox.Text.Trim().ToUpper());
                switch (type)
                {
                case TM_Type.none:
                    //MessageBox.Show("你扫描的是无效的条码!!", "消息框");
                    ShowMeg(q(Msg_Type.msgscantminvalid));
                    break;

                case TM_Type.staffno:
                {
                    MES_RETURN_UI res = ServicModel.PUBLIC_FUNC.GET_YGNAME(smtextBox.Text.Trim().ToUpper(), getToken());
                    if (res.TYPE.Equals("S"))
                    {
                        czrtextBox.Text = res.MESSAGE;
                        Gh = smtextBox.Text.Trim().ToUpper();
                    }
                    else
                    {
                        ShowMeg(res.MESSAGE);
                    }
                }
                break;

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

                case TM_Type.ph:
                {
                    MES_TM_TMINFO model = new MES_TM_TMINFO();
                    model.TM      = smtextBox.Text.Trim().ToUpper();
                    model.STAFFID = Convert.ToInt32(getUserInfo("staffid"));
                    SELECT_MES_TM_TMINFO_BYTM res = ServicModel.TM_TMINFO.SELECT_BY_KCDDLimit(model, getToken());
                    if (res.MES_RETURN.TYPE.Equals("S"))
                    {
                        if (res.MES_TM_TMINFO_LIST.Length == 1)
                        {
                            MES_TM_TMINFO_LIST  = res.MES_TM_TMINFO_LIST[0];
                            ytmtextBox.Text     = MES_TM_TMINFO_LIST.TM;
                            ytmwllbtextBox.Text = MES_TM_TMINFO_LIST.WLLBNAME;
                            tlsstextBox.Text    = MES_TM_TMINFO_LIST.SCDATE;
                        }
                        else if (res.MES_TM_TMINFO_LIST.Length == 0)
                        {
                            ShowMeg(q(Msg_Type.msgtmnoexistorunrole));        //"条码信息不存在或账号没有权限查询"
                        }
                        else
                        {
                            ShowMeg(q(Msg_Type.msgtmexcept));        //"获得的条码数据异常,请联系管理员"
                        }
                    }
                    else
                    {
                        ShowMeg(res.MES_RETURN.MESSAGE);
                    }
                }
                break;

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

                default:
                    //MessageBox.Show("你扫描的是无效的条码!!", "消息框");
                    ShowMeg(q(Msg_Type.msgscantminvalid));
                    break;
                }
                smtextBox.Clear();
                smtextBox.Select();
            }
        }
Exemplo n.º 18
0
        private void cxbutton_Click(object sender, EventArgs e)
        {
            //MES_SY_TYPEMXLIST[] wllbArr = ServicModel.SY_TYPEMX.SELECT(typeModel, getToken());
            //List<MES_SY_TYPEMXLIST> wllblist = wllbArr.ToList();
            //MES_SY_TYPEMXLIST choicwllb = new MES_SY_TYPEMXLIST();
            //choicwllb.ID = 0;
            //choicwllb.MXNAME = "==请选择==";
            //wllblist.Insert(0, choicwllb);
            MES_TM_TMINFO model = new MES_TM_TMINFO();

            if (!Convert.ToString(gccomboBox.SelectedValue).Equals("0"))
            {
                model.GC = Convert.ToString(gccomboBox.SelectedValue);
            }
            if (gzzxcomboBox.SelectedValue != null)
            {
                if (!Convert.ToString(gzzxcomboBox.SelectedValue).Equals("0"))
                {
                    model.GZZXBH = Convert.ToString(gzzxcomboBox.SelectedValue);
                }
            }
            if (!Convert.ToString(sbhcomboBox.SelectedValue).Equals("0"))
            {
                model.SBBH = Convert.ToString(sbhcomboBox.SelectedValue);
            }
            if (!string.IsNullOrEmpty(tmtextBox.Text.Trim()))
            {
                if (tmtextBox.Text.Trim().Length == 12)// && tmtextBox.Text.Trim().ToUpper().StartsWith("P"))
                {
                    model.TM = tmtextBox.Text.Trim();
                }
                else
                {
                    //ShowMeg("条码格式是P开头的12位信息,请核对");
                    ShowMeg(q(Msg_Type.msgtmstartwithP));
                    return;
                }
            }
            if (!string.IsNullOrEmpty(wlbmtextBox.Text.Trim()))
            {
                model.WLH = wlbmtextBox.Text.Trim();
            }
            if (!string.IsNullOrEmpty(xsddtextBox.Text.Trim()))
            {
                model.NOBILL = xsddtextBox.Text.Trim();
            }

            if (!string.IsNullOrEmpty(thtextBox.Text.Trim()))
            {
                if (judge.IsNumber(thtextBox.Text.Trim()))
                {
                    model.TH = Convert.ToInt32(thtextBox.Text.Trim());
                }
                else
                {
                    //ShowMeg("桶号必须是数字");
                    ShowMeg(q(Msg_Type.msgthisdigital));
                    return;
                }
            }
            if (!string.IsNullOrEmpty(erptextBox.Text.Trim()))
            {
                if (erptextBox.Text.Trim().Length == 8)
                {
                    model.ERPNO = erptextBox.Text.Trim();
                }
                else
                {
                    //ShowMeg("ERP工单是有效的8位信息");
                    ShowMeg(q(Msg_Type.msgerpdglengtheigth));
                    return;
                }
            }
            if (!string.IsNullOrEmpty(rwdtextBox.Text.Trim()))
            {
                if (rwdtextBox.Text.Trim().Length == 11)
                {
                    model.RWBH = rwdtextBox.Text.Trim().ToUpper();
                }
                else
                {
                    //ShowMeg("任务单是有效的11位信息");
                    ShowMeg(q(Msg_Type.msgrwdlengtheleven));
                    return;
                }
            }
            if (!string.IsNullOrEmpty(pctextBox.Text.Trim()))
            {
                model.PC = Convert.ToString(pctextBox.Text.Trim());
            }
            //if (!string.IsNullOrEmpty(scrqtextBox.Text.Trim()))
            //{
            //    if (judge.IsDate(scrqtextBox.Text.Trim()))
            //    {
            //        model.SCDATE = scrqtextBox.Text.Trim();
            //    }
            //    else
            //    {
            //        ShowMeg("生产日期不是有效的时间格式");
            //        return;
            //    }
            //}
            //if (!string.IsNullOrEmpty(jlrqfromtextBox.Text.Trim()))
            //{
            //      if (judge.IsDate(jlrqfromtextBox.Text.Trim()))
            //    {
            //        model.JLKSTIME = Convert.ToDateTime(jlrqfromtextBox.Text.Trim()).ToString("yyyy-MM-dd");
            //    }
            //    else
            //    {
            //        ShowMeg("记录开始日期不是有效的时间格式");
            //        return;
            //    }
            //}
            //if (!string.IsNullOrEmpty(jlrqtotextBox.Text.Trim()))
            //{
            //    if (judge.IsDate(jlrqtotextBox.Text.Trim()))
            //    {
            //        model.JLJSTIME = Convert.ToDateTime(jlrqtotextBox.Text.Trim()).ToString("yyyy-MM-dd");
            //    }
            //    else
            //    {
            //        ShowMeg("记录结束日期不是有效的时间格式");
            //        return;
            //    }
            //}

            if (!string.IsNullOrEmpty(scrqtextBox.Text.Trim()))
            {
                if (judge.IsDate(scrqtextBox.Text.Trim()))
                {
                    model.SCDATE = scrqtextBox.Text.Trim();
                }
                else
                {
                    //ShowMeg("生产日期不是正确的日期格式");
                    ShowMeg(q(Msg_Type.msgscrqformat));
                }
            }
            if (!string.IsNullOrEmpty(jlrqfromtextBox.Text.Trim()))
            {
                if (judge.IsDate(jlrqfromtextBox.Text.Trim()))
                {
                    model.JLKSTIME = jlrqfromtextBox.Text.Trim();
                }
                else
                {
                    //ShowMeg("记录开始日期不是正确的日期格式");
                    ShowMeg(q(Msg_Type.msgjlksrqformat));
                }
            }
            if (!string.IsNullOrEmpty(jlrqtotextBox.Text.Trim()))
            {
                if (judge.IsDate(jlrqtotextBox.Text.Trim()))
                {
                    model.JLJSTIME = jlrqtotextBox.Text.Trim();
                }
                else
                {
                    //ShowMeg("记录结束日期不是正确的日期格式");
                    ShowMeg(q(Msg_Type.msgjljsrqformat));
                }
            }
            if (!string.IsNullOrEmpty(jlrqfromtextBox.Text.Trim()) && !string.IsNullOrEmpty(jlrqtotextBox.Text.Trim()))
            {
                TimeSpan midtine = DateTime.Parse(jlrqfromtextBox.Text.Trim()) - DateTime.Parse(jlrqtotextBox.Text.Trim());
                if (midtine.Days > 0)
                {
                    //ShowMeg("记录开始日期不能大于记录结束日期");
                    ShowMeg(q(Msg_Type.msgksgtjs));
                }
            }
            if (MaccheckBox.Checked)
            {
                model.MAC = DeviceInfo.GetNetCardMAC().Substring(0, 17);
            }
            //model.WLLBNAME = "素电";
            model.WLLB = Convert.ToInt32(wllbcomboBox1.SelectedValue);
            SELECT_MES_TM_TMINFO_BYTM res = ServicModel.TM_TMINFO.SELECT(model, getToken());

            if (res.MES_RETURN.TYPE.Equals("S"))
            {
                JLdataGridView.DataSource = res.MES_TM_TMINFO_LIST.ToList();
                List = res.MES_TM_TMINFO_LIST.ToList();
                JLdataGridView.ClearSelection();
                Type         type = JLdataGridView.GetType();
                PropertyInfo pi   = type.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
                pi.SetValue(JLdataGridView, true, null);
            }
            else
            {
                ShowMeg(res.MES_RETURN.MESSAGE);
            }
        }
Exemplo n.º 19
0
        private void JLdataGridView_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex != -1)
            {
                if (this.JLdataGridView.CurrentCell.OwningColumn.Name.Equals(q(Msg_Type.fieldtm)))                 //"条码"
                {
                    string tm = Convert.ToString(this.JLdataGridView.CurrentRow.Cells[q(Msg_Type.fieldtm)].Value); //"条码"
                    if (!string.IsNullOrEmpty(tm))
                    {
                        MES_TM_TMINFO TMINFOmodel = new MES_TM_TMINFO();
                        TMINFOmodel.TM = tm;
                        SELECT_MES_TM_TMINFO_BYTM tminfiRes = ServicModel.TM_TMINFO.SELECT(TMINFOmodel, getToken());
                        if (tminfiRes.MES_RETURN.TYPE.Equals("S"))
                        {
                            if (tminfiRes.MES_TM_TMINFO_LIST.Length == 1)
                            {
                                Sonluk.UI.Model.MES.TM_TMINFOService.MES_TM_TMINFO_LIST tmINFO = tminfiRes.MES_TM_TMINFO_LIST[0];
                                Print_Type ptype = (Print_Type)tmINFO.TMSX;
                                Rigth_Type r;
                                bool       isNormal = true;
                                switch (ptype)
                                {
                                case Print_Type.none:
                                    isNormal = false;
                                    break;

                                case Print_Type.rk:
                                    r = Rigth_Type.gangketl_cc;
                                    PrintInfoByTM_READONLY(tmINFO.TM, tmINFO.GC, 1, r, ptype);
                                    break;

                                case Print_Type.lot:
                                    r = Rigth_Type.gangketl_cc;
                                    PrintInfoByTM_READONLY(tmINFO.TM, tmINFO.GC, 1, r, ptype);
                                    break;

                                case Print_Type.zjlot:
                                    r = Rigth_Type.zhengjicc;
                                    PrintInfoByTM_READONLY(tmINFO.TM, tmINFO.GC, 1, r, ptype);
                                    break;

                                case Print_Type.fujilot:
                                    r = Rigth_Type.fujitl;
                                    PrintInfoByTM_READONLY(tmINFO.TM, tmINFO.GC, 1, r, ptype);
                                    break;

                                case Print_Type.zxlot:
                                    r = Rigth_Type.zhuxiancc;
                                    PrintInfoByTM_READONLY(tmINFO.TM, tmINFO.GC, 1, r, ptype);
                                    break;

                                case Print_Type.bblot:
                                    r = Rigth_Type.baobiaocc;
                                    PrintInfoByTM_READONLY(tmINFO.TM, tmINFO.GC, 1, r, ptype);
                                    break;

                                case Print_Type.zfsd:
                                    r = Rigth_Type.zhuxiancc;
                                    PrintInfoByTM_READONLY(tmINFO.TM, tmINFO.GC, 1, r, ptype);
                                    break;

                                case Print_Type.wlrk:
                                    r = Rigth_Type.wlrkdy;
                                    PrintInfoByTM_READONLY(tmINFO.TM, tmINFO.GC, 1, r, ptype);
                                    break;

                                case Print_Type.wlrkLot:
                                    r = Rigth_Type.wlrkdy;
                                    PrintInfoByTM_READONLY(tmINFO.TM, tmINFO.GC, 1, r, ptype);
                                    break;

                                default:
                                    isNormal = false;
                                    break;
                                }
                                if (isNormal == false)
                                {
                                    //ShowMeg("条码属性读取异常,请联系管理员");
                                    ShowMeg(q(Msg_Type.msgtmsxecpect));
                                    SMtextBox.Select();
                                    return;
                                }
                            }
                            else
                            {
                                ShowMeg(q(Msg_Type.msgloadtmfail));//"读取扫描条码信息失败"
                            }
                        }
                        else
                        {
                            ShowMeg(tminfiRes.MES_RETURN.MESSAGE);
                        }
                    }
                    else
                    {
                        ShowMeg(q(Msg_Type.msgtmnoempty));// "条码不能为空"
                    }
                    SMtextBox.Select();
                }
            }
        }
Exemplo n.º 20
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();
        }
Exemplo n.º 21
0
        public frmBindXCM(ZSL_BCS303_BS list, int rowindex)
        {
            InitializeComponent();
            BomdataGridView.AutoGenerateColumns = false;
            dataGridView2.AutoGenerateColumns   = false;
            RowIndex      = rowindex;
            XCList        = new List <UI.Model.MES.MES_WLKCBSService.ZSL_BCS303_BS>();
            BindList      = new List <MES_TM_TMINFO_LIST>();
            ZSL_BCS303_BS = list;



            wlpzlabel.Text = q(Msg_Type.titlewlpzxmnd) + list.MBLNR + "/" + list.ZEILE + "/" + list.MJAHR; //"物料凭证/项目/年度:"
            wlxxlabel.Text = q(Msg_Type.titlewlxx) + list.MATNR + "/" + list.MAKTX;                        //"物料信息:"
            gyslabel.Text  = q(Msg_Type.titlegysxx) + list.LIFNR + "/" + list.SORTL;                       //"供应商信息:"
            cglabel.Text   = q(Msg_Type.titlepo) + list.EBELN + "/" + list.EBELP;                          //"采购订单/项目:"

            ZSL_BCS303_BS model = new UI.Model.MES.MES_WLKCBSService.ZSL_BCS303_BS();

            model.MBLNR   = list.MBLNR;
            model.XCBS    = list.XCBS;
            model.MJAHR   = list.MJAHR;
            model.LINE_ID = list.LINE_ID;
            model.LIFNR   = list.LIFNR;
            ZBCFUN_PURBS_READ res1 = ServicModel.MES_WLKCBS.GET_WLPZ_ZJ(model, getToken());;

            if (res1.MES_RETURN.TYPE.Equals("S"))
            {
                XCList = res1.ET_PURBS.ToList();
                for (int i = 0; i < res1.ET_PURBS.Length; i++)
                {
                    res1.ET_PURBS[i].MATNR = res1.ET_PURBS[i].MATNR + "/" + res1.ET_PURBS[i].MAKTX;
                }
                BomdataGridView.DataSource = res1.ET_PURBS;
            }
            else
            {
                ShowMeg(res1.MES_RETURN.MESSAGE);
            }


            MES_TM_TMINFO tmmodel = new MES_TM_TMINFO();

            string[] xcmArr = list.XCZJTM.Split(',');
            for (int j = 0; j < xcmArr.Length; j++)
            {
                tmmodel.TM = xcmArr[j];
                SELECT_MES_TM_TMINFO_BYTM res = ServicModel.TM_TMINFO.SELECT_BYTM(tmmodel, 0, 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();
                }
            }
        }
Exemplo n.º 22
0
        private void tmtextBox_KeyDown(object sender, KeyEventArgs e)
        {
            if (tmtextBox.ReadOnly == false)
            {
                if (e.KeyCode == Keys.Enter)
                {
                    if (Convert.ToInt32(fsnumericUpDown.Value) > 0)
                    {
                        string tm = tmtextBox.Text.Trim().ToUpper();
                        if (tm.Length == 12 && tm.StartsWith("P"))
                        {
                            MES_TM_TMINFO TMINFOmodel = new MES_TM_TMINFO();
                            TMINFOmodel.TM = tm;
                            SELECT_MES_TM_TMINFO_BYTM tminfiRes = ServicModel.TM_TMINFO.SELECT(TMINFOmodel, getToken());
                            if (tminfiRes.MES_RETURN.TYPE.Equals("S"))
                            {
                                if (tminfiRes.MES_TM_TMINFO_LIST.Length == 1)
                                {
                                    MES_TM_TMINFO_LIST tmINFO = tminfiRes.MES_TM_TMINFO_LIST[0];
                                    Print_Type         ptype  = (Print_Type)tmINFO.TMSX;
                                    PrintType = ptype;
                                    bool isNormal = true;
                                    switch (ptype)
                                    {
                                    case Print_Type.none:
                                        isNormal = false;
                                        break;

                                    case Print_Type.rk:
                                        RigthType = Rigth_Type.gangketl_cc;
                                        break;

                                    case Print_Type.lot:
                                        RigthType = Rigth_Type.gangketl_cc;
                                        break;

                                    case Print_Type.zjlot:
                                        RigthType = Rigth_Type.zhengjicc;
                                        break;

                                    case Print_Type.fujilot:
                                        RigthType = Rigth_Type.fujitl;
                                        break;

                                    case Print_Type.zxlot:
                                        RigthType = Rigth_Type.zhuxiancc;
                                        break;

                                    case Print_Type.bblot:
                                        RigthType = Rigth_Type.baobiaocc;
                                        break;

                                    case Print_Type.zfsd:
                                        RigthType = Rigth_Type.zhuxiancc;
                                        break;

                                    case Print_Type.wlrk:
                                        RigthType = Rigth_Type.wlrkdy;
                                        break;

                                    case Print_Type.wlrkLot:
                                        RigthType = Rigth_Type.wlrkdy;
                                        break;

                                    case Print_Type.zswllot:
                                        RigthType = Rigth_Type.zswllotdy;
                                        break;

                                    case Print_Type.zswlbsk:
                                        RigthType = Rigth_Type.none;
                                        break;

                                    default:
                                        isNormal = false;
                                        break;
                                    }
                                    if (isNormal == false)
                                    {
                                        //ShowMeg("条码属性读取异常,请联系管理员");
                                        ShowMeg(q(Msg_Type.msgtmsxecpect));
                                        return;
                                    }
                                    tmtextBox.Text = tmINFO.TM;
                                    PrintInfoByTM(tmINFO.TM, tmINFO.GC, Convert.ToInt32(fsnumericUpDown.Value), RigthType, ptype);
                                    tmtextBox.Clear();
                                }
                                else
                                {
                                    //ShowMeg("读取扫描条码信息失败");
                                    ShowMeg(q(Msg_Type.msgloadtmfail));
                                }
                            }
                            else
                            {
                                ShowMeg(tminfiRes.MES_RETURN.MESSAGE);
                            }
                        }
                        else
                        {
                            //ShowMeg("你扫描的是无效的条码");
                            ShowMeg(q(Msg_Type.msgscantminvalid));
                        }
                    }
                    else
                    {
                        //ShowMeg("打印份数必须大于0");
                        ShowMeg(q(Msg_Type.msgprintnoempty));
                    }
                }
            }
        }
Exemplo n.º 23
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["删除"].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 = "==请选择==";
                bcArr.Insert(0, bcmodel1);
                bccomboBox.DisplayMember   = "MXNAME";
                bccomboBox.ValueMember     = "ID";
                bccomboBox.DataSource      = bcArr;
                bccomboBox.SelectedValue   = list.BC;
                MESlabel.Text              = "MES工单:" + list.GDDH;
                GDHlabel.Text              = "工单号:" + list.ERPNO;
                WLXXlabel.Text             = "物料信息:" + list.WLH + "/" + list.WLMS;
                WLLBlabel1.Text            = "物料类别:" + list.WLLBNAME;
                rwdlabel.Text              = "任务单:" + list.RWBH;
                BOMdataGridView.DataSource = getBomList(_bomList);
                //scrqtextBox.Text = DateTime.Now.ToString("yyyy-MM-dd");
                LSdataGridView.ReadOnly = true;
                BOMdataGridView.Columns["状态"].DefaultCellStyle.BackColor = Color.Red;
                for (int i = 0; i < unRequireArr.Count; i++)
                {
                    BOMdataGridView.Rows[unRequireArr[i]].Cells["状态"].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);
                }
                BOMdataGridView.ClearSelection();
                if (RigthType == Rigth_Type.mfqqingxi)
                {
                    GDHlabel.Visible   = false;
                    WLXXlabel.Location = GDHlabel.Location;
                }
            }
            else
            {
                MessageBox.Show(SMtextBox.Text + res.MES_RETURN.MESSAGE, "消息框");
            }
            SMtextBox.Clear();
            SMtextBox.Select();
        }
Exemplo n.º 24
0
        private void ConfigUI(string tm)
        {
            ClearUI();
            CancleTextboxzswllot();
            CancleTextboxzswlbsk();
            MES_TM_TMINFO_SELECT_BY_UPDATEROLE_IN model = new MES_TM_TMINFO_SELECT_BY_UPDATEROLE_IN();

            model.STAFFID = Convert.ToInt32(getUserInfo("staffid"));
            model.TM      = tm;
            SELECT_MES_TM_TMINFO_BYTM res = ServicModel.TM_TMINFO.SELECT_BY_UPDATEROLE(model, getToken());

            if (res.MES_RETURN.TYPE.Equals("S"))
            {
                if (res.MES_TM_TMINFO_LIST.Length == 1)
                {
                    MES_SY_TYPEMXLIST zfsdnode = new MES_SY_TYPEMXLIST();
                    zfsdnode.ID        = 0;
                    zfsdnode.MXNAME    = q(Msg_Type.titlechoice);//"==请选择==";
                    MES_TM_TMINFO_LIST = res.MES_TM_TMINFO_LIST[0];
                    string gc = MES_TM_TMINFO_LIST.GC;
                    //MES_TM_TMINFO_LIST.MOULD
                    cpztcomboBox.DataSource    = GetDictionaryMX(9, gc);
                    cpztcomboBox.DisplayMember = "MXNAME";
                    cpztcomboBox.ValueMember   = "ID";

                    List <MES_SY_TYPEMXLIST> dcxhlist = GetDictionaryMX(6, gc).ToList();
                    dcxhlist.Insert(0, zfsdnode);
                    dcxhcomboBox.DataSource    = dcxhlist;
                    dcxhcomboBox.DisplayMember = "MXNAME";
                    dcxhcomboBox.ValueMember   = "ID";
                    int bcID = 5;
                    if (res.MES_TM_TMINFO_LIST[0].WLLBNAME.Equals("正极粉"))
                    {
                        bcID = 12;
                    }
                    List <MES_SY_TYPEMXLIST> bclist = GetDictionaryMX(bcID, gc).ToList();
                    bclist.Insert(0, zfsdnode);
                    bccomboBox.DataSource    = bclist;
                    bccomboBox.DisplayMember = "MXNAME";
                    bccomboBox.ValueMember   = "ID";


                    //scbzcomboBox.DataSource = GetDictionaryMX(12);
                    //scbzcomboBox.DisplayMember = "MXNAME";
                    //scbzcomboBox.ValueMember = "ID";

                    List <MES_SY_TYPEMXLIST> dcdjlist = GetDictionaryMX(7, gc).ToList();
                    dcdjlist.Insert(0, zfsdnode);
                    dcdjcomboBox.DataSource    = dcdjlist;
                    dcdjcomboBox.DisplayMember = "MXNAME";
                    dcdjcomboBox.ValueMember   = "ID";

                    List <MES_SY_TYPEMXLIST> sbcdlist = GetDictionaryMX(15, gc).ToList();
                    sbcdlist.Insert(0, zfsdnode);
                    sbcdcomboBox.DataSource    = sbcdlist;
                    sbcdcomboBox.DisplayMember = "MXNAME";
                    sbcdcomboBox.ValueMember   = "ID";

                    List <MES_SY_TYPEMXLIST> zfsdlist = GetDictionaryMX(17, gc).ToList();
                    zfsdlist.Insert(0, zfsdnode);
                    zflbcomboBox.DataSource    = zfsdlist;
                    zflbcomboBox.DisplayMember = "MXNAME";
                    zflbcomboBox.ValueMember   = "ID";

                    List <MES_SY_TYPEMXLIST> hdgxlist = GetDictionaryMX(19, gc).ToList();
                    hdgxlist.Insert(0, zfsdnode);
                    hgxcomboBox.DisplayMember = "MXNAME";
                    hgxcomboBox.ValueMember   = "ID";
                    hgxcomboBox.DataSource    = hdgxlist;

                    List <MES_SY_TYPEMXLIST> yslist = GetDictionaryMX(33, gc).ToList();
                    yslist.Insert(0, zfsdnode);
                    yscomboBox.DisplayMember = "MXNAME";
                    yscomboBox.ValueMember   = "ID";
                    yscomboBox.DataSource    = yslist;

                    List <MES_SY_TYPEMXLIST> cptypelist = GetDictionaryMX(32, gc).ToList();
                    cptypelist.Insert(0, zfsdnode);
                    cptypecomboBox.DisplayMember = "MXNAME";
                    cptypecomboBox.ValueMember   = "ID";
                    cptypecomboBox.DataSource    = cptypelist;


                    tmtextBox1.Text            = MES_TM_TMINFO_LIST.TM;
                    wlhtextBox2.Text           = MES_TM_TMINFO_LIST.WLH;
                    wllbtextBox.Text           = MES_TM_TMINFO_LIST.WLLBNAME;
                    wlmstextBox.Text           = MES_TM_TMINFO_LIST.WLMS;
                    dcxhcomboBox.SelectedValue = MES_TM_TMINFO_LIST.DCXH;
                    dcdjcomboBox.SelectedValue = MES_TM_TMINFO_LIST.DCDJ;
                    kssjtextBox.Text           = MES_TM_TMINFO_LIST.KSTIME;
                    jssjtextBox.Text           = MES_TM_TMINFO_LIST.JSTIME;
                    cpztcomboBox.SelectedValue = MES_TM_TMINFO_LIST.CPZT;
                    //bztextBox.Text = MES_TM_TMINFO_LIST.REMARK;
                    bzrichTextBox1.Text          = MES_TM_TMINFO_LIST.REMARK;
                    xsddtextBox.Text             = MES_TM_TMINFO_LIST.NOBILL;
                    xsxmtextBox.Text             = MES_TM_TMINFO_LIST.NOBILLMX;
                    gyspctextBox.Text            = MES_TM_TMINFO_LIST.GYSPC;
                    thtextBox.Text               = MES_TM_TMINFO_LIST.TH.ToString();
                    pctextBox.Text               = MES_TM_TMINFO_LIST.PC;
                    clpbtextBox.Text             = MES_TM_TMINFO_LIST.CLPBDM;
                    zflbcomboBox.SelectedValue   = MES_TM_TMINFO_LIST.ZFDCLB;
                    cptypecomboBox.SelectedValue = MES_TM_TMINFO_LIST.CPTYPE;
                    bccomboBox.SelectedValue     = MES_TM_TMINFO_LIST.BC;
                    if (MES_TM_TMINFO_LIST.DCSLYS != 0)
                    {
                        wstextBox1.Text = MES_TM_TMINFO_LIST.DCSLYS.ToString();
                    }
                    if (MES_TM_TMINFO_LIST.DCSLMBSL != 0)
                    {
                        mbsltextBox2.Text = MES_TM_TMINFO_LIST.DCSLMBSL.ToString();
                    }
                    if (MES_TM_TMINFO_LIST.DCSLBS != 0)
                    {
                        bstextBox3.Text = MES_TM_TMINFO_LIST.DCSLBS.ToString();
                    }
                    hgxcomboBox.SelectedValue  = MES_TM_TMINFO_LIST.XDGX;
                    bbpmtextBox.Text           = MES_TM_TMINFO_LIST.RQM;
                    scdatetextBox.Text         = MES_TM_TMINFO_LIST.SCDATE;
                    sbcdcomboBox.SelectedValue = MES_TM_TMINFO_LIST.SBCD;
                    sltextBox.Text             = MES_TM_TMINFO_LIST.SL.ToString();
                    //ystextBox.Text = MES_TM_TMINFO_LIST.MFQCOLORNAME;
                    yscomboBox.SelectedValue = MES_TM_TMINFO_LIST.MFQCOLOR;
                    wqhtextBox.Text          = MES_TM_TMINFO_LIST.WQH;
                    if (MES_TM_TMINFO_LIST.TMSX == 622)// zswlbsk = 622  物料标识卡
                    {
                        ReadOnlyTextboxzswlbsk();
                    }
                    else if (MES_TM_TMINFO_LIST.TMSX == 621)//zswllot = 621, 物料lot表
                    {
                        sltextBox.ReadOnly     = true;
                        bccomboBox.Enabled     = false;
                        scdatetextBox.ReadOnly = true;
                        Sonluk.UI.Model.MES.TM_GLService.MES_TM_GL glmodel = new Sonluk.UI.Model.MES.TM_GLService.MES_TM_GL();
                        glmodel.LB   = 1;
                        glmodel.XCTM = MES_TM_TMINFO_LIST.TM;
                        Sonluk.UI.Model.MES.TM_GLService.MES_TM_GL_SELECT glres = ServicModel.TM_GL.SELECT(glmodel, getToken());
                        if (glres.MES_RETURN.TYPE.Equals("S"))
                        {
                            if (glres.MES_TM_GL.Length > 0)
                            {
                                if (glres.MES_TM_GL[0].SCTMRESDUESL > 0)
                                {
                                    ReadOnlyTextboxzswllot();
                                }
                                else
                                {
                                }
                            }
                            else
                            {
                                cptypecomboBox.Enabled = true;
                            }
                        }
                        else
                        {
                            ShowMeg(glres.MES_RETURN.MESSAGE);
                        }
                    }
                }
                else
                {
                    //ShowMeg("条码数据异常");
                    ShowMeg(q(Msg_Type.msgtmexcept));
                }
            }
            else
            {
                ShowMeg(res.MES_RETURN.MESSAGE);
            }
            smtextBox.Clear();
        }
Exemplo n.º 25
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();
        }
Exemplo n.º 26
0
        private void smtextBox_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                TM_Type type = TMtype(smtextBox.Text.Trim().ToUpper());
                switch (type)
                {
                case TM_Type.none:
                    //MessageBox.Show("你扫描的是无效的条码!!", "消息框");
                    ShowMeg(q(Msg_Type.msgscantminvalid));
                    break;

                case TM_Type.staffno:
                {
                    //string a = getToken();
                    MES_RETURN_UI res = ServicModel.PUBLIC_FUNC.GET_YGNAME(smtextBox.Text.Trim().ToUpper(), getToken());
                    if (res.TYPE.Equals("S"))
                    {
                        czrtextBox.Text = res.MESSAGE;
                        Gh = smtextBox.Text.Trim().ToUpper();
                    }
                    else
                    {
                        ShowMeg(res.MESSAGE);
                    }
                }
                break;

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

                case TM_Type.ph:
                {
                    MES_TM_TMINFO model = new MES_TM_TMINFO();
                    model.GC   = MES_PD_TL_LIST.GC;
                    model.TM   = smtextBox.Text.Trim();
                    model.RWBH = MES_PD_TL_LIST.RWBH;
                    SELECT_MES_TM_TMINFO_BYTM res = ReadphTM(model, 0);
                    if (res.MES_RETURN.TYPE.Equals("S"))
                    {
                        ResList             = res.MES_TM_TMINFO_LIST[0];
                        mbmtextBox.Text     = res.MES_TM_TMINFO_LIST[0].TM;
                        mbmwllbtextBox.Text = res.MES_TM_TMINFO_LIST[0].WLLBNAME;
                    }
                    else
                    {
                        ShowMeg(res.MES_RETURN.MESSAGE);
                    }

                    break;
                }

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

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

                smtextBox.Clear();
                smtextBox.Select();
            }
        }