Exemplo n.º 1
0
        private void smbJZ_Click(object sender, EventArgs e)
        {
            int x = string.IsNullOrEmpty(this.txtX.Text.Trim()) ? 0 : Convert.ToInt32(this.txtX.Text.Trim());
            int y = string.IsNullOrEmpty(this.txtY.Text.Trim()) ? 0 : Convert.ToInt32(this.txtY.Text.Trim());

            ModulePrint.PrintLabel("0000000000000000", "4", x, y);
        }
Exemplo n.º 2
0
        private void smbJZ_Click(object sender, EventArgs e)
        {
            DataSet dsId = new DataSet();

            //DataRow drlotNumber = this.gvNotPrint.GetFocusedDataRow();
            //string orderNum = Convert.ToString(drlotNumber["WORK_ORDER_NO"]);
            //dsId = lotNumPrint.GetIdByOrderNumber(orderNum);
            int x = string.IsNullOrEmpty(this.txtX.Text.Trim()) ? 0 : Convert.ToInt32(this.txtX.Text.Trim());
            int y = string.IsNullOrEmpty(this.txtY.Text.Trim()) ? 0 : Convert.ToInt32(this.txtY.Text.Trim());

            ModulePrint.PrintLabel("0000000000000000", "4", x, y);
        }
Exemplo n.º 3
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            string lotNumber = this.txtLotNumber.Text.ToString().Trim();
            int    counts    = 0;

            if (string.IsNullOrEmpty(lotNumber))
            {
                MessageService.ShowMessage(StringParser.Parse("${res:FanHai.Hemera.Addins.WIP.LotIVTestPrintDialog.Msg001}"), MESSAGEBOX_CAPTION);//组件序列号不能为空,请确认!
                //MessageBox.Show("组件序列号不能为空!请输入");
                return;
            }

            //补打进行提示
            DataSet ds = lotNumPrint.GetPrintInf(lotNumber, null, null, null);

            if (ds.Tables.Count > 0)
            {
                counts = ds.Tables[0].Rows.Count;
                MessageBox.Show(string.Format("【{0}】序列号本次为第{1}次打印,请注意控制!", lotNumber, counts + 1));
            }

            DataSet dsId = lotNumPrint.GetPrintIdByLotNumber(lotNumber);   //根据批次号获取打印代码

            if (!string.IsNullOrEmpty(lotNumPrint.ErrorMsg))
            {
                MessageBox.Show(lotNumPrint.ErrorMsg);
                return;
            }
            if (dsId.Tables.Count <= 0 || dsId.Tables[0].Rows.Count <= 0)
            {
                MessageService.ShowMessage(StringParser.Parse("${res:FanHai.Hemera.Addins.WIP.LotNumRepeatPrint.Msg001}"), MESSAGEBOX_CAPTION);//请工艺检查该批次工单是否已经维护了对应的打印规则!(工单产品属性设置->打印规则设定)
                //MessageBox.Show("请工艺检查该批次工单是否已经维护了对应的打印规则!(工单产品属性设置->打印规则设定)");
                return;
            }
            int x  = string.IsNullOrEmpty(this.txtX.Text.Trim()) ? 0 : Convert.ToInt32(this.txtX.Text.Trim());
            int y  = string.IsNullOrEmpty(this.txtY.Text.Trim()) ? 0 : Convert.ToInt32(this.txtY.Text.Trim());
            var aa = dsId.Tables[0].Rows[0]["PRINT_CODE"].ToString();

            if (!ModulePrint.PrintLabel(lotNumber, dsId.Tables[0].Rows[0]["PRINT_CODE"].ToString(),
                                        x, y))
            //if (!ModulePrint.PrintLabel("0115002HH265P061500001", "5",
            //x, y))
            {
                MessageService.ShowMessage(StringParser.Parse("${res:FanHai.Hemera.Addins.WIP.LotNumRepeatPrint.Msg002}"), MESSAGEBOX_CAPTION);//打印标签失败,请重试!
                //MessageService.ShowMessage("打印标签失败,请重试!", "提示");
                return;
            }
            SavePrintMessage(lotNumber, printer, Mac, 'Y');
        }
Exemplo n.º 4
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            if (this.gvNotPrint.GetFocusedRow() != null)
            {
                DataSet dsId        = new DataSet();
                DataRow drlotNumber = this.gvNotPrint.GetFocusedDataRow();
                string  lotNumber   = Convert.ToString(drlotNumber["LOT_NUMBER"]);
                string  orderNum    = Convert.ToString(drlotNumber["WORK_ORDER_NO"]);
                string  printer     = PropertyService.Get(PROPERTY_FIELDS.USER_NAME);

                bool flag = lotNumPrint.CheckAndUpdateLotInf(lotNumber, printer, facKey, equipmentKey, lineKey);
                if (flag == true && string.IsNullOrEmpty(lotNumPrint.ErrorMsg))
                {
                    dsId = lotNumPrint.GetIdByOrderNumber(orderNum);
                    if (dsId.Tables[0].Rows.Count <= 0)
                    {
                        MessageService.ShowMessage(StringParser.Parse("${res:FanHai.Hemera.Addins.WIP.LotNumPrint.Msg002}"), MESSAGEBOX_CAPTION);//打印标签失败,打印规则有改动,请工艺确认!
                        //MessageService.ShowMessage("打印标签失败,打印规则有改动,请工艺确认!", "提示");
                        BindGcNotPrint();
                        return;
                    }
                    int x          = string.IsNullOrEmpty(this.txtX.Text.Trim()) ? 0 : Convert.ToInt32(this.txtX.Text.Trim());
                    int y          = string.IsNullOrEmpty(this.txtY.Text.Trim()) ? 0 : Convert.ToInt32(this.txtY.Text.Trim());
                    int printCount = 1;
                    if (!string.IsNullOrEmpty(txtPrintCount.Text))
                    {
                        printCount = Convert.ToInt32(txtPrintCount.Text);
                    }
                    int c = gvNotPrint.RowCount;
                    for (int i = 0; i < c; i++)
                    {
                        DataRowView dr        = (DataRowView)gvNotPrint.GetRow(i);
                        string      lot       = dr.Row["LOT_NUMBER"].ToString();
                        string      order     = dr.Row["WORK_ORDER_NO"].ToString();
                        bool        ischecked = (bool)dr.Row["IS_CHECK"];
                        if (!ModulePrint.PrintLabel(lot, dsId.Tables[0].Rows[0]["PRINT_CODE"].ToString(),
                                                    x, y, printCount))
                        {
                            MessageService.ShowMessage(StringParser.Parse("${res:FanHai.Hemera.Addins.WIP.LotNumPrint.Msg001}"), MESSAGEBOX_CAPTION); //打印标签失败,请重试!
                                                                                                                                                      //MessageService.ShowMessage("打印标签失败,请重试!", "提示");
                            BindGcNotPrint();
                            return;
                        }
                        lotNumPrint.UpdateLotInf(lot, printer);

                        lotNumPrint.save_Print(lot, printer, mac, 'N');
                    }

                    BindGcNotPrint();
                }
                if (!string.IsNullOrEmpty(lotNumPrint.ErrorMsg))
                {
                    MessageBox.Show(lotNumPrint.ErrorMsg);
                    BindGcNotPrint();
                    return;
                }
            }
            else
            {
                MessageService.ShowMessage(StringParser.Parse("${res:FanHai.Hemera.Addins.WIP.LotNumPrint.Msg003}"), MESSAGEBOX_CAPTION);//必须选择至少选择一条记录!
                //MessageService.ShowMessage("必须选择至少选择一条记录", "${res:Global.SystemInfo}");
            }
        }