Пример #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);
            }
        }
Пример #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
        }
        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 AddDataRowFromDB(List <string> sSerials)
 {
     return(_labelGen.AddDataRowFromDB(sSerials));
 }