Example #1
0
        private bool Verify()
        {
            bool judge = true;

            if (PrintType == Print_Type.rk)
            {
                if (string.IsNullOrEmpty(tstextBox.Text))
                {
                    MessageBox.Show("产出托数不能为空", "消息框");
                    tstextBox.Select();
                    return(false);
                }
                if (string.IsNullOrEmpty(xstextBox.Text))
                {
                    MessageBox.Show("产出箱数不能为空", "消息框");
                    xstextBox.Select();
                    return(false);;
                }
                if (string.IsNullOrEmpty(fsnumericUpDown.Value.ToString()))
                {
                    if (Convert.ToInt32(fsnumericUpDown.Value) == 0)
                    {
                        ShowMeg("打印分数必须大于0");

                        fsnumericUpDown.Select();
                        return(false);
                    }
                    MessageBox.Show("打印分数不能为空");
                    fsnumericUpDown.Select();
                    return(false);;
                }
            }
            else if (PrintType == Print_Type.lot)
            {
                if (RigthType == Rigth_Type.gangketl_cc)
                {
                    if (string.IsNullOrEmpty(TMtextBox.Text))
                    {
                        MessageBox.Show("必须扫描入库标识条码", "消息框");
                        TMtextBox.Select();
                        return(false);;
                    }
                }

                if (string.IsNullOrEmpty(xstextBox.Text))
                {
                    MessageBox.Show("产出数量不能为空", "消息框");
                    xstextBox.Select();
                    return(false);;
                }
                if (string.IsNullOrEmpty(fsnumericUpDown.Value.ToString()))
                {
                    if (Convert.ToInt32(fsnumericUpDown.Value) == 0)
                    {
                        ShowMeg("打印分数必须大于0");
                        fsnumericUpDown.Select();
                        return(false);
                    }
                    MessageBox.Show("打印份数不能为空", "消息框");
                    fsnumericUpDown.Select();
                    return(false);;
                }
            }
            return(judge);
        }
Example #2
0
        public frmPrint(MES_TM_TMINFO_INSERT_GL model, Print_Type type, Rigth_Type rtype)
        {
            InitializeComponent();
            RigthType = rtype;
            MES_TM_TMINFO_INSERT_GL = model;
            //List<String> list = LocalPrinter.GetLocalPrinters(); //获得系统中的打印机列表
            //IList<comboxclass> cbnodes = new List<comboxclass>();
            rkbslabel.Visible = false;
            TMtextBox.Visible = false;
            //foreach (String s in list)
            //{
            //    //DYcomboBox.Items.Add(s); //将打印机名称添加到下拉框中
            //    comboxclass cb = new comboxclass();
            //    cb.Text = s;
            //    cb.Value = s;
            //    cbnodes.Add(cb);
            //}
            //DYcomboBox.DataSource = cbnodes.ToList();
            //DYcomboBox.ValueMember = "value";
            //DYcomboBox.DisplayMember = "text";
            CPZTcomboBox.Visible = false;
            label5.Text          = "数量:";
            label4.Text          = "箱数:";
            tstextBox.Visible    = true;

            if (type == Print_Type.lot)
            {
                tstextBox.Visible = false;
                TMtextBox.Select();
                if (rtype == Rigth_Type.gangketl_cc)
                {
                    rkbslabel.Visible = true;
                    TMtextBox.Visible = true;
                    //tstextBox.Visible = false;
                }
                else
                {
                    int h = 70;
                    label5.Location          = new Point(label5.Location.X, label5.Location.Y - h);
                    tstextBox.Location       = new Point(tstextBox.Location.X, tstextBox.Location.Y - h);
                    label4.Location          = new Point(label4.Location.X, label4.Location.Y - h);
                    xstextBox.Location       = new Point(xstextBox.Location.X, xstextBox.Location.Y - h);
                    label2.Location          = new Point(label2.Location.X, label2.Location.Y - h);
                    fsnumericUpDown.Location = new Point(fsnumericUpDown.Location.X, fsnumericUpDown.Location.Y - h);
                    label6.Location          = new Point(label6.Location.X, label6.Location.Y - h);
                    bztextBox.Location       = new Point(bztextBox.Location.X, bztextBox.Location.Y - h);
                    //dybutton.Location = new Point(dybutton.Location.X, dybutton.Location.Y - h);
                }
                CPZTcomboBox.Location = tstextBox.Location;

                label5.Text = "状态:";
                label4.Text = "数量:";
                MES_SY_TYPEMX TYPEMX = new MES_SY_TYPEMX();
                TYPEMX.TYPEID              = 9;
                TYPEMX.GC                  = Convert.ToString(getGC("value"));
                CPZTcomboBox.DataSource    = ServicModel.SY_TYPEMX.SELECT(TYPEMX, getToken());
                CPZTcomboBox.Visible       = true;
                CPZTcomboBox.DisplayMember = "MXNAME";
                CPZTcomboBox.ValueMember   = "ID";
            }
            else if (type == Print_Type.rk)
            {
                tstextBox.Select();
                label5.Location          = new Point(label5.Location.X, label5.Location.Y - 50);
                tstextBox.Location       = new Point(tstextBox.Location.X, tstextBox.Location.Y - 50);
                label2.Location          = new Point(label2.Location.X, label2.Location.Y - 50);
                label4.Location          = new Point(label4.Location.X, label4.Location.Y - 50);
                xstextBox.Location       = new Point(xstextBox.Location.X, xstextBox.Location.Y - 50);
                fsnumericUpDown.Location = new Point(fsnumericUpDown.Location.X, fsnumericUpDown.Location.Y - 50);
            }
            PrintType = type;
            RigthType = rtype;
            switch (type)
            {
            case Print_Type.rk:
                this.Text = "打印入库标识";
                break;

            case Print_Type.lot:
                this.Text = "打印LOT";
                break;

            default:
                break;
            }

            MES_TM_TMINFO_INSERT_GL = model;

            //int width = printDialog1.PrinterSettings.DefaultPageSettings.PaperSize.Width;
        }