예제 #1
0
        private MES_TM_TMINFO_INSERT_RETURN Createbarcode(int TMcount)
        {
            int flag = 0;

            if (RigthType == Rigth_Type.jidiantitl_cc || RigthType == Rigth_Type.fujifengkoujitl_cc || RigthType == Rigth_Type.zhengjifengkoujitl_cc)
            {
                MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.TH = Convert.ToInt32(qshtextBox.Text.Trim());
                flag = 1;
            }
            MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.TMCOUNT = TMcount;
            MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.REMARK  = richTextBox1.Text.Trim();
            MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.MAC     = DeviceInfo.GetNetCardMAC().Substring(0, 17);
            if (PrintType == Print_Type.lot)
            {
                MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.CPZT = Convert.ToInt32(CPZTcomboBox.SelectedValue);
                MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.TMSX = (int)Print_Type.lot;
                MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.TMLB = 1;
                MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.SL   = Convert.ToDecimal(xstextBox.Text.Trim());
            }
            else
            {
                MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.CPZT = 80;
                MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.TMLB = 2;
                MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.TMSX = (int)Print_Type.rk;
                MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.SL   = Convert.ToDecimal(tstextBox.Text.Trim());
            }
            MES_TM_TMINFO_INSERT_RETURN r = ServicModel.TM_TMINFO.INSERT(MES_TM_TMINFO_INSERT_GL, flag, getToken());


            return(r);
        }
예제 #2
0
        private MES_TM_TMINFO_INSERT_RETURN Createbarcode(int TMcount)
        {
            MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.TMCOUNT = TMcount;
            MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.REMARK  = bztextBox.Text.Trim();
            MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.MAC     = DeviceInfo.GetNetCardMAC().Substring(0, 17);
            if (PrintType == Print_Type.lot)
            {
                MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.CPZT = Convert.ToInt32(CPZTcomboBox.SelectedValue);
                MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.TMSX = (int)Print_Type.lot;
                MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.TMLB = 1;
                MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.SL   = Convert.ToDecimal(xstextBox.Text.Trim());
            }
            else
            {
                MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.CPZT = 80;
                MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.TMLB = 2;
                MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.TMSX = (int)Print_Type.rk;
                MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.SL   = Convert.ToDecimal(tstextBox.Text.Trim());
            }


            MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.UPPERTM = TMtextBox.Text.Trim().ToUpper();
            MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.GC      = getGC("value");
            MES_TM_TMINFO_INSERT_RETURN r = ServicModel.TM_TMINFO.INSERT(MES_TM_TMINFO_INSERT_GL, 0, getToken());

            //SELECT_MES_TM_TMINFO_PRINT[] res = ServicModel.TM_TMINFO.INSERT(MES_TM_TMINFO_INSERT_GL, getToken());
            return(r);
        }
예제 #3
0
        private MsgReturn GetTM()
        {
            MsgReturn msg = new MsgReturn();

            msg.Pass = false;
            msg.Msg  = q(Msg_Type.msginserttmfail);//"生成条码失败!!!";
            MES_TM_TMINFO_INSERT_RETURN res = new MES_TM_TMINFO_INSERT_RETURN();

            res = Createbarcode(Convert.ToInt32(tmnumericUpDown.Value));
            if (res.MES_RETURN.TYPE.Equals("S"))
            {
                PrintList = res.SELECT_MES_TM_TMINFO_PRINT;
                msg.Pass  = true;
            }
            else
            {
                msg.Msg = res.MES_RETURN.MESSAGE;
            }
            return(msg);
        }
예제 #4
0
        private MsgReturn GetTM()
        {
            MsgReturn msg = new MsgReturn();

            msg.Pass = false;
            msg.Msg  = "生成条码失败!!!";

            MES_TM_TMINFO_INSERT_RETURN res = new MES_TM_TMINFO_INSERT_RETURN();

            if (PrintType == Print_Type.lot)
            {
                if (RigthType == Rigth_Type.gangketl_cc)
                {
                    res = Createbarcode(Convert.ToInt32(fsnumericUpDown.Value));
                }
                else
                {
                    res = Createbarcode(1);
                }
            }
            else
            {
                res = Createbarcode(1);
            }
            if (res.MES_RETURN.TYPE.Equals("S"))
            {
                PrintList = res.SELECT_MES_TM_TMINFO_PRINT;
                msg.Pass  = true;
            }
            else
            {
                msg.Msg = res.MES_RETURN.MESSAGE;
            }


            return(msg);
        }
예제 #5
0
        public MES_TM_TMINFO_INSERT_RETURN INSERT(MES_TM_TMINFO_INSERT_GL model, int ISAUTOADD, string ptoken)
        {
            MES_TM_TMINFO_INSERT_RETURN rst = client.INSERT(model, ISAUTOADD, ptoken);

            return(rst);
        }
예제 #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (Convert.ToInt32(tmsxcomboBox.SelectedValue) == 0)
            {
                ShowMeg(q(Msg_Type.msgchoicetmlb));//"请选择条码类别"
                return;
            }
            if (string.IsNullOrEmpty(pctextBox17.Text.Trim()))
            {
                ShowMeg(q(Msg_Type.msgpcnoempty));//"批次信息不能为空"
                return;
            }
            if (string.IsNullOrEmpty(thtextBox11.Text.Trim()))
            {
                ShowMeg(q(Msg_Type.msgthnoempty));//"桶号信息不能为空"
                return;
            }
            if (!string.IsNullOrEmpty(dateTimePicker1.Text.Trim()))
            {
                if (!judge.IsDate(dateTimePicker1.Text.Trim()))
                {
                    ShowMeg(q(Msg_Type.msgkssjformat));//"开始日期不是有效的日期格式"
                    return;
                }
            }
            if (!string.IsNullOrEmpty(dateTimePicker2.Text.Trim()))
            {
                if (!judge.IsDate(dateTimePicker2.Text.Trim()))
                {
                    ShowMeg(q(Msg_Type.msgjssjformat));//"结束日期不是有效的日期格式"
                    return;
                }
            }
            if (string.IsNullOrEmpty(bstextBox.Text.Trim()))
            {
                ShowMeg(q(Msg_Type.msgbsnoempty));//"板数信息不能为空"
                return;
            }
            if (string.IsNullOrEmpty(mbsltextBox.Text.Trim()))
            {
                ShowMeg(q(Msg_Type.msgmbslnoempty));//"每板数量不能为空"
                return;
            }
            if (!string.IsNullOrEmpty(dateTimePicker1.Text.Trim()) && !string.IsNullOrEmpty(dateTimePicker2.Text.Trim()))
            {
                TimeSpan span = Convert.ToDateTime(dateTimePicker1.Text.Trim()) - Convert.ToDateTime(dateTimePicker2.Text.Trim());
                if (span.TotalMinutes > 0)
                {
                    ShowMeg(q(Msg_Type.msgksgtjs));//"开始日期不能大于结束日期"
                    return;
                }
            }
            UI.Model.MES.TM_TMINFOService.MES_TM_TMINFO_INSERT_GL model1 = new UI.Model.MES.TM_TMINFOService.MES_TM_TMINFO_INSERT_GL();
            MES_TM_TMINFO model = new MES_TM_TMINFO();

            if (Convert.ToInt32(tmsxcomboBox.SelectedValue) == 374)
            {
                model.TMLB = 2;
            }
            else
            {
                model.TMLB = 1;
            }

            model.GC        = gctextBox.Text;
            model.WLH       = MES_SY_MATERIAL_LIST.WLH;
            model.WLMS      = MES_SY_MATERIAL_LIST.WLMS;
            model.WLLB      = MES_SY_MATERIAL_LIST.WLLB;
            model.WLLBNAME  = MES_SY_MATERIAL_LIST.WLLBNAME;
            model.WLGROUP   = MES_SY_MATERIAL_LIST.WLGROUP;
            model.UNITSID   = MES_SY_MATERIAL_LIST.UNITSID;
            model.UNITSNAME = MES_SY_MATERIAL_LIST.UNITSNAME;
            if (!Convert.ToString(gzzxcomboBox.SelectedValue).Equals("0"))
            {
                model.GZZXBH = Convert.ToString(gzzxcomboBox.SelectedValue);
                model.GZZXMS = gzzxcomboBox.Text.Trim();
            }
            else
            {
                ShowMeg(q(Msg_Type.msggzzxnoempty));//"工作中心不能为空"
                return;
            }
            if (gzzxcomboBox.SelectedValue == null)
            {
                ShowMeg(q(Msg_Type.msggzzxinvalid));//"不是有效的工作中心请核对"
                return;
            }
            if (!Convert.ToString(sbhcomboBox3.SelectedValue).Equals("0"))
            {
                model.SBBH  = Convert.ToString(sbhcomboBox3.SelectedValue);
                model.SBHMS = sbhcomboBox3.Text.Trim();
            }
            else
            {
                //if (MES_SY_MATERIAL_LIST.WLLBNAME.Equals("素电"))
                //{
                //    ShowMeg("设备号不能为空");
                //    return;
                //}
            }

            if (!Convert.ToString(zflbcomboBox.SelectedValue).Equals("0"))
            {
                model.ZFDCLB = Convert.ToInt32(zflbcomboBox.SelectedValue);
            }



            model.DCDJ   = MES_SY_MATERIAL_LIST.DCDJ;
            model.DCDJMS = MES_SY_MATERIAL_LIST.DCDJNAME;
            model.DCXH   = MES_SY_MATERIAL_LIST.DCXH;
            model.DCXHMS = MES_SY_MATERIAL_LIST.DCXHNAME;
            model.SCDATE = dateTimePicker3.Text.Trim();
            //model.KSTIME = kssjtextBox14.Text.Trim();
            //model.JSTIME = jssjtextBox15.Text.Trim();
            //model.BC = Convert.ToInt32(bccomboBox4.SelectedValue);
            //model.BCMS = bccomboBox4.Text.Trim();
            model.PC = pctextBox17.Text.Trim();
            //model.CLCJ = clcjtextBox7.Text.Trim();
            //model.GYLX = gylxtextBox8.Text.Trim();
            //model.GYSMS = gysjctextBox10.Text.Trim();
            model.CPZT = Convert.ToInt32(cpztcomboBox5.SelectedValue);
            model.JLR  = Convert.ToInt32(getUserInfo("staffid"));
            if (!string.IsNullOrEmpty(thtextBox11.Text.Trim()))
            {
                model.TH = Convert.ToInt32(thtextBox11.Text.Trim());
            }

            model.SL       = Convert.ToInt32(hjsltextBox.Text.Trim());
            model.DCSLBS   = Convert.ToInt32(bstextBox.Text.Trim());
            model.DCSLMBSL = Convert.ToInt32(mbsltextBox.Text.Trim());
            int ws = 0;

            if (!string.IsNullOrEmpty(wstextBox.Text.Trim()))
            {
                ws = Convert.ToInt32(wstextBox.Text.Trim());
            }
            model.DCSLYS = ws;
            //model.PFDH = pfdtextBox12.Text.Trim();
            //model.PLDH = pldhtextBox13.Text.Trim();
            model.KSTIME = dateTimePicker1.Text.Trim();
            model.JSTIME = dateTimePicker2.Text.Trim();
            model.REMARK = bztextBox16.Text.Trim();
            model.MAC    = DeviceInfo.GetNetCardMAC().Substring(0, 17);
            //if (!Convert.ToString(kcddcomboBox.SelectedValue).Equals("0"))
            //{
            //    model.KCDD = Convert.ToString(kcddcomboBox.SelectedValue);
            //    model.KCDDNAME = kcddcomboBox.Text.Trim();
            //}

            model.TMCOUNT        = 1;
            model.TMSX           = Convert.ToInt32(tmsxcomboBox.SelectedValue);
            model1.MES_TM_TMINFO = model;
            List <MES_TM_GL> gl = new List <MES_TM_GL>();

            model1.MES_TM_GL = gl.ToArray();
            MES_TM_TMINFO_INSERT_RETURN res = ServicModel.TM_TMINFO.INSERT(model1, 0, getToken());

            if (res.MES_RETURN.TYPE.Equals("S"))
            {
                Print_Type ptype = (Print_Type)Convert.ToInt32(tmsxcomboBox.SelectedValue);

                switch (ptype)
                {
                case Print_Type.none:
                    break;

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

                case Print_Type.lot:
                    RigthType = Rigth_Type.sgsm;
                    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.zhdc:
                    RigthType = Rigth_Type.sgsm;
                    ptype     = Print_Type.lot;
                    break;

                default:
                    break;
                }
                PrintInfoByTM(res.MES_RETURN.TM, res.MES_RETURN.GC, Convert.ToInt32(fsnumericUpDown1.Value), RigthType, ptype);
            }
            else
            {
                ShowMeg(res.MES_RETURN.MESSAGE);
            }
        }