Exemplo n.º 1
0
        private void GenerateSimpleButton_Click(object sender, EventArgs e)
        {
            string BarcodePrefix = NZString(BarcodePrefixTextEdit.EditValue, "");
            string CompanyNo     = NZString(CompanyNoTextEdit.EditValue, "");

            var ReportLayout = new dxBarcodePrint(_BarcodeType, _ShowBarcodeText)
            {
                DataSource = BuildBarcodeData(BarcodePrefix, CompanyNo, _BarcodeList, _ROWCOUNT)
            };

            ReportLayout.ShowPreviewDialog();
        }
Exemplo n.º 2
0
        private void GenerateSimpleButton_Click(object sender, EventArgs e)
        {
            int ThisBarcodeNo = 0;
            try
            {
                string TheEnteredBarcodeNo = NZString(BarcodeStartNoTextEdit.EditValue, "");
                if (string.IsNullOrEmpty(TheEnteredBarcodeNo)) throw new ApplicationException("Invalid barcode entered.");

                if (!int.TryParse(TheEnteredBarcodeNo, out ThisBarcodeNo))
                {
                    throw new ApplicationException("Invalid barcode entered.");
                }
            }
            catch 
            {
                ShowMessage("You have entered an invalid start number for the Barcode.\nOnly numbers are allowed.", "Invalid Barcode");
                return;
            }

            int NoPages = NZInt(PageCountSpinEdit.Value, 1);
            bool ShowBarcodeText = ShowBarcodeTextCheckEdit.Checked;
            string Prefix = NZString(BarcodePrefixTextEdit.EditValue.ToString(), "");
            string CompanyNo = NZString(CompanyNoComboBoxEdit.EditValue.ToString(), "");
            string BarcodeType = NZString(BarcodeTypeComboBoxEdit.EditValue, "");

            if (ManualCheckEdit.Checked)
            {
                var ManualBarcodeForm = new dxPLManualBarcodes(Prefix, CompanyNo, BarcodeType, ShowBarcodeText);
                ManualBarcodeForm.Show();
                return;
            }

            List<PLBarcodeData> BarcodeList = BuildBarcodeData(Prefix, CompanyNo, ThisBarcodeNo, LABELS_PER_PAGE);
            //List<PLBarcodeData> BarcodeList = new List<PLBarcodeData>();
            //for (int i = 0; i < LABELS_PER_PAGE * NoPages; i++)
            //{
            //    BarcodeList.Add(new PLBarcodeData(Prefix, CompanyNo, ThisBarcodeNo));
            //    ThisBarcodeNo++;
            //}

            
            // Save any changes back to the settings file for next time.
            ThisBarcodeNo++;
            Properties.Settings.Default.NextBarcodeNo = ThisBarcodeNo;
            Properties.Settings.Default.BarcodePrefix = Prefix;
            Properties.Settings.Default.BarcodeType = BarcodeType;
            Properties.Settings.Default.ShowBarcodeText = ShowBarcodeText;
            Properties.Settings.Default.Save();

            var ReportLayout = new dxBarcodePrint(BarcodeType, ShowBarcodeText) { DataSource = BarcodeList };
            ReportLayout.ShowPreviewDialog();
        }