Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 3
0
        private void printBtn_Click(object sender, EventArgs e)
        {
            if (Rma && Final)
            {
                ShowRmaDlg();
            }

            printBtn.Enabled = false;

            if (Final && workCodeCB.Checked)
            {
                try
                {
                    string sWorkCode = workcodeTB.Text.Trim();
                    PrintLabel(sWorkCode);
                    return;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }

            List <string> serialsList = GetSerials();

            if (serialsList.Count == 0)
            {
                MessageBox.Show("No Items to Print");
                return;
            }

            // ja - add the serial numbers to the print job
            LabelGeneratorLib.AddDataRowFromDB(serialsList);

            // ja - print the labels for all of the jobs
            if (LabelGeneratorLib.PrintLabels())
            {
                // ja - burst the serial numbers
                if (BurstLabels)
                {
                    Burst(serialsList);
                }

                MessageBox.Show(serialsList.Count.ToString() + " - Labels Printed Successfully");
            }
            else
            {
                MessageBox.Show("There was a Problem Printing Labels", "Label Printer", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
            }

            printBtn.Enabled = true;

#if DEBUG
            System.Diagnostics.Process.Start(@"\\nightadder\btwFiles\testFiles");
#endif
        }
        //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);
        }
        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);
            }
        }
 public bool PrintLabels()
 {
     return(_labelGen.PrintLabels());
 }