예제 #1
0
        // ja - print routine for generic final labels
        private void finalPrintBtn_Click(object sender, EventArgs e)
        {
            PrinterArea printArea = PrinterArea.final;

            //LabelOverrides labelOverride = GetOverride();
            string labelOverride = GetFinalDropDownValue();

            LabelGeneratorLib = new LabelGen(labelOverride, true);

            LabelGeneratorLib.AddPrintJob(printArea);

            List <string> list = new List <string>();

            for (int i = 0; i < genericQtyUD.Value; i++)
            {
                list.Add("99999-1001");
            }

            LabelGeneratorLib.AddDataRowFromDB(list);

            if (LabelGeneratorLib.PrintLabels())
            {
                MessageBox.Show("Labels Printed Successfully");
            }
            else
            {
                MessageBox.Show("There was a Problem Printing Labels", "Label Printer", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
            }
        }
예제 #2
0
        private void PrintLabel(string sWorkCode)
        {
            Console.WriteLine("Printing Labels: " + sWorkCode + "...");

            StatusLabel.Text = "Printing Labels for: " + sWorkCode + "...";

            try
            {
                // ja - start a new print job
                LabelGen pd = new LabelGen();

                // ja - from the table name determine the location they are printing from
                LabelGeneratorLib.PrinterArea eLoc = PrinterArea.final;

                // ja - add the job (read labelcodes from Database)
                pd.AddPrintJob(eLoc, sWorkCode, true);

                // ja - read the serials database and fill the list
                List <string> myList = GetSerials();

                // ja - add the serial numbers to the print job
                pd.AddDataRowFromDB(myList);

                // ja - print the labels for all of the jobs
                if (pd.PrintLabels())
                {
                    MessageBox.Show("Labels Printed Successfully");
                    StatusLabel.Text = "Labels Printed Successfully";
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        public int AddPrintJob(LabelGeneratorLib.PrinterArea eArea, LabelGeneratorLib.LabelTypes eLabelType, List <string> sColumns)
        {
            //LabelGen objClass = (LabelGen)Session["LabelGen"];

            //return objClass.AddPrintJob(eArea, eLabelType, sColumns);

            return(_labelGen.AddPrintJob(eArea, eLabelType, sColumns));
        }
        //Session["LabelGen"] = _labelGen;

        public bool Print(LabelGeneratorLib.PrinterArea eArea, LabelGeneratorLib.LabelTypes eLabelType, List <string> sColumns, string sTemplate, int nQty, int nStartPos = 0)
        {
            LabelGen _labelGen = new LabelGen();

            int nJob = _labelGen.AddPrintJob(eArea, eLabelType, sColumns);

            _labelGen.AddDataRow(nJob, sTemplate, nQty, nStartPos);

            _labelGen.PrintLabels();

            return(true);
        }
예제 #5
0
        private void PrintSMT()
        {
            for (int i = 0; i < SmtCount; i++)
            {
                listView1.Items.Add(workcodeTB.Text);
            }

            foreach (ListViewItem item in listView1.Items)
            {
                item.Checked = true;
            }

            PrintJobFound = LabelGeneratorLib.AddPrintJob(ThePrinterArea, GetWorkCode(), true);

            printBtn.Enabled = true;
            printBtn.Visible = true;

            printBtn.PerformClick();

            printBtn.Enabled = false;
            printBtn.Visible = false;
        }
        private void PrintLabel(string sKey, string sWorkCode, string sTable)
        {
            Console.WriteLine("Printing Labels: " + sWorkCode + "...");

#if DEBUG
            SetPrintedFlag(sKey);

            //return;
#endif

            try
            {
                // ja - start a new print job
                LabelGen pd = new LabelGen(sTable);

                // ja - from the table name determine the location they are printing from
                LabelGeneratorLib.PrinterArea eLoc = FindLocation(sTable);

                // ja - add the job (read labelcodes from Database)
                pd.AddPrintJob(eLoc, sWorkCode, true);

                // ja - read the serials database and fill the list
                List <string> myList = GetSerials(sKey);

                // ja - add the serial numbers to the print job
                pd.AddDataRowFromDB(myList);

                // ja - print the labels for all of the jobs
                pd.PrintLabels();

                // ja - mark in the jobs database queue that this has been printed
                SetPrintedFlag(sKey);
            }
            catch (System.Exception ex)
            {
                Config.Log(ex.Message);
            }
        }