public frmPrintLabel(Item objItem, BillOfLading objBOL)
        {
            int intTemp = 0;


            InitializeComponent();

            bw = new BackgroundWorker();
            bw.WorkerReportsProgress      = true;
            bw.WorkerSupportsCancellation = true;
            bw.DoWork += new DoWorkEventHandler(bw_DoWork);
            //bw.ProgressChanged += new ProgressChangedEventHandler(bw_ProgressChanged);
            bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);

            mobjItem = objItem;
            mobjBOL  = objBOL;

            if (int.TryParse(mobjItem.SelectedOrder.CustomerNumber, out intTemp))
            {
                mintCustomerNumber = intTemp;
            }
            else if (int.TryParse(mobjItem.SelectedJob.CustomerNumber, out intTemp))
            {
                mintCustomerNumber = intTemp;
            }

            mstrCustomerName = mobjItem.SelectedJob.CustomerName;

            mobjSelectedLabel = new WTFClassLibrary.Label();

            grpMultiple.Enabled = false;
            chkMultiple.Checked = false;
        }
        private void LoadLabelFormatsList()
        {
            ExtraSytelineTablesSettings objExtraSytelineTableSettings;
            DataTable objDataTable = new DataTable();
            SqlDataAdapter objDataAdapter;
            SqlCommand objSQLCommand;
            WTFClassLibrary.Label objLabel;
            string strSQL;
            long lngTemp;
            int intTemp;

            objExtraSytelineTableSettings = new ExtraSytelineTablesSettings();

            strSQL = QueryDefinitions.GetQuery("SelectCustomerLabels", new string[] { mintCustomerNumber.ToString() });
            objExtraSytelineTableSettings.SQLConnection.Open();
            objSQLCommand = objExtraSytelineTableSettings.SQLConnection.CreateCommand();
            objSQLCommand.CommandText = strSQL;
            objDataAdapter = new SqlDataAdapter(objSQLCommand);
            objDataAdapter.Fill(objDataTable);

            cboLabels.Items.Clear();

            objLabel = new WTFClassLibrary.Label();
            objLabel.Description = "--- Select Label Format ---";

            cboLabels.Items.Add(objLabel);

            foreach (DataRow objRow in objDataTable.Rows)
            {
                objLabel = new WTFClassLibrary.Label();

                if (long.TryParse(objRow["CustomerLabelID"].ToString(), out lngTemp))
                    objLabel.CustomerLabelID = lngTemp;
                else
                    objLabel.CustomerLabelID = 0;

                if (int.TryParse(objRow["AddrLineCt"].ToString(), out intTemp))
                    objLabel.AddressLineCount = intTemp;
                else
                    objLabel.AddressLineCount = 0;

                objLabel.Description = objRow["Description"].ToString();
                objLabel.LabelFile = objRow["LabelFile"].ToString();
                objLabel.SupplierNumber = objRow["SupplierNumber"].ToString();

                if (long.TryParse(objRow["Sequence"].ToString(), out lngTemp))
                    objLabel.Sequence = lngTemp;
                else
                    objLabel.Sequence = 0;

                cboLabels.Items.Add(objLabel);
            }

            cboLabels.SelectedIndex = 0;
        }
        public frmPrintLabel(Item objItem, BillOfLading objBOL)
        {
            int intTemp = 0;

            InitializeComponent();

            bw = new BackgroundWorker();
            bw.WorkerReportsProgress = true;
            bw.WorkerSupportsCancellation = true;
            bw.DoWork += new DoWorkEventHandler(bw_DoWork);
            //bw.ProgressChanged += new ProgressChangedEventHandler(bw_ProgressChanged);
            bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);

            mobjItem = objItem;
            mobjBOL = objBOL;

            if (int.TryParse(mobjItem.SelectedOrder.CustomerNumber, out intTemp))
                mintCustomerNumber = intTemp;
            else if (int.TryParse(mobjItem.SelectedJob.CustomerNumber, out intTemp))
                mintCustomerNumber = intTemp;

            mstrCustomerName = mobjItem.SelectedJob.CustomerName;

            mobjSelectedLabel = new WTFClassLibrary.Label();

            grpMultiple.Enabled = false;
            chkMultiple.Checked = false;
        }
        private void LoadLabelFormatsList()
        {
            ExtraSytelineTablesSettings objExtraSytelineTableSettings;
            DataTable      objDataTable = new DataTable();
            SqlDataAdapter objDataAdapter;
            SqlCommand     objSQLCommand;

            WTFClassLibrary.Label objLabel;
            string strSQL;
            long   lngTemp;
            int    intTemp;


            objExtraSytelineTableSettings = new ExtraSytelineTablesSettings();

            strSQL = QueryDefinitions.GetQuery("SelectCustomerLabels", new string[] { mintCustomerNumber.ToString() });
            objExtraSytelineTableSettings.SQLConnection.Open();
            objSQLCommand             = objExtraSytelineTableSettings.SQLConnection.CreateCommand();
            objSQLCommand.CommandText = strSQL;
            objDataAdapter            = new SqlDataAdapter(objSQLCommand);
            objDataAdapter.Fill(objDataTable);

            cboLabels.Items.Clear();

            objLabel             = new WTFClassLibrary.Label();
            objLabel.Description = "--- Select Label Format ---";

            cboLabels.Items.Add(objLabel);

            foreach (DataRow objRow in objDataTable.Rows)
            {
                objLabel = new WTFClassLibrary.Label();

                if (long.TryParse(objRow["CustomerLabelID"].ToString(), out lngTemp))
                {
                    objLabel.CustomerLabelID = lngTemp;
                }
                else
                {
                    objLabel.CustomerLabelID = 0;
                }

                if (int.TryParse(objRow["AddrLineCt"].ToString(), out intTemp))
                {
                    objLabel.AddressLineCount = intTemp;
                }
                else
                {
                    objLabel.AddressLineCount = 0;
                }

                objLabel.Description    = objRow["Description"].ToString();
                objLabel.LabelFile      = objRow["LabelFile"].ToString();
                objLabel.SupplierNumber = objRow["SupplierNumber"].ToString();

                if (long.TryParse(objRow["Sequence"].ToString(), out lngTemp))
                {
                    objLabel.Sequence = lngTemp;
                }
                else
                {
                    objLabel.Sequence = 0;
                }

                cboLabels.Items.Add(objLabel);
            }

            cboLabels.SelectedIndex = 0;
        }