示例#1
0
 protected override void OnCreate(Bundle bundle)
 {
     base.OnCreate(bundle);
     Forms.Init(this, bundle);
     BarCodes.Init(this);
     this.LoadApplication(new App());
 }
示例#2
0
        private void getProtectedID(XmlDocument checkedDocument)
        {
            XmlNode id = XmlHelperFunctions.GetSubNode(checkedDocument.DocumentElement, "fu:ProtectedID");

            this.ProtectedID = (id == null) ? string.Empty : id.InnerText;
            this.BarCodes    = (id == null) ? null : BarCodes.Create(checkedDocument);
        }
示例#3
0
 public override bool FinishedLaunching(UIApplication app, NSDictionary options)
 {
     BarCodes.Init();
     Forms.Init();
     this.LoadApplication(new App());
     return(base.FinishedLaunching(app, options));
 }
示例#4
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            BarCodes.Init(() => (Activity)Forms.Context);

            Forms.Init(this, bundle);
            this.LoadApplication(new App());
        }
示例#5
0
 protected override void OnCreate(Bundle bundle)
 {
     base.OnCreate(bundle);
     BarCodes.Init(this);
     global::Xamarin.Forms.Forms.Init(this, bundle);
     ImageCircleRenderer.Init();
     LoadApplication(new WherePhoneApp());
 }
示例#6
0
 public MainPage()
 {
     this.InitializeComponent();
     this.SupportedOrientations = SupportedPageOrientation.PortraitOrLandscape;
     Forms.Init();
     BarCodes.Init();
     this.LoadApplication(new Samples.App());
 }
示例#7
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            BarCodes.Init();
            global::Xamarin.Forms.Forms.Init();
            LoadApplication(new App());
            ImageCircleRenderer.Init();

            return(base.FinishedLaunching(app, options));
        }
示例#8
0
 public MainPage()
 {
     InitializeComponent();
     SupportedOrientations = SupportedPageOrientation.PortraitOrLandscape;
     BarCodes.Init();
     global::Xamarin.Forms.Forms.Init();
     ImageCircleRenderer.Init();
     LoadApplication(new WherePhoneApp());
 }
示例#9
0
        private void btbuscar_Click(object sender, RoutedEventArgs e)
        {
            ///
            //pninfo.Visible = false;
            ///
            String article = "";
            ///
            String size    = "";
            string calidad = "";

            ///
            String[] infoCodeBars;
            ///
            if (!txtarticulo.Text.Equals(String.Empty))
            {
                /// Pos 0: Articulo referencia
                /// Pos 1: Plano
                infoCodeBars = BarCodes.getInfoFromTheBarCode(txtarticulo.Text);
                ///
                if (infoCodeBars == null)
                {
                    //pninfo.Visible = true;
                    //lblinfo.BackColor = System.Drawing.ColorTranslator.FromHtml("#ee7749");
                    //lblinfo.Text = "Codigo de articulo invalido.";
                    //msnMessage.LoadMessage("Codigo de articulo invalido.", UserControl.ucMessage.MessageType.Error);
                    return;
                }
                ///
                article = infoCodeBars[0].ToString();
                calidad = infoCodeBars[2].ToString();
                /// Para saber si se debe consultar la talla legible se debe medir el numero de digitos; El EAN13 posee 14
                ///
                if (txtarticulo.Text.Length == 13)
                {
                    ///
                    DataTable dtInfoArticle = null;// Article.getInfoDecodifyCodeBars(_user._usv_co, article, "", (Convert.ToDecimal(infoCodeBars[1]) - 1).ToString());

                    ///
                    if (dtInfoArticle != null && dtInfoArticle.Rows.Count > 0)
                    {
                        ///
                        size = dtInfoArticle.Rows[0]["sgv_size_display"].ToString();
                    }
                }
                else
                {
                    ///
                    size = infoCodeBars[1].ToString();
                }
                ///

                loadArticleForReturn(txtfac.Text.Trim(), article, size, calidad);
            }
            ///
            txtarticulo.Focus();
        }
        /// <summary>
        /// Buscar articulo y/o verificar que sea un articulo que se pueda retornar
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btFindArticle_Click(object sender, EventArgs e)
        {
            ///
            msnMessage.Visible = false;
            ///
            String article = "";
            ///
            String size    = "";
            string calidad = "";

            ///
            String[] infoCodeBars;
            ///
            if (!txtCodigoArticulo.Text.Equals(String.Empty))
            {
                /// Pos 0: Articulo referencia
                /// Pos 1: Plano
                infoCodeBars = BarCodes.getInfoFromTheBarCode(txtCodigoArticulo.Text);
                ///
                if (infoCodeBars == null)
                {
                    msnMessage.LoadMessage("Codigo de articulo invalido.", UserControl.ucMessage.MessageType.Error);
                    return;
                }
                ///
                article = infoCodeBars[0].ToString();
                calidad = infoCodeBars[2].ToString();
                /// Para saber si se debe consultar la talla legible se debe medir el numero de digitos; El EAN13 posee 14
                ///
                if (txtCodigoArticulo.Text.Length == 13)
                {
                    ///
                    DataTable dtInfoArticle = Article.getInfoDecodifyCodeBars(_user._usv_co, article, "", (Convert.ToDecimal(infoCodeBars[1]) - 1).ToString());

                    ///
                    if (dtInfoArticle != null && dtInfoArticle.Rows.Count > 0)
                    {
                        ///
                        size = dtInfoArticle.Rows[0]["sgv_size_display"].ToString();
                    }
                }
                else
                {
                    ///
                    size = infoCodeBars[1].ToString();
                }
                ///

                loAQUARELLArticleForReturn(txtNoInvoice.Text.Trim(), article, size, calidad);
            }
            ///
            txtCodigoArticulo.Focus();
        }
示例#11
0
        public void testInvoice2()
        {
            XmlDocument xmlDoc = this.getXml("OKInvoice4.xml");
            BarCodes    bc     = BarCodes.Create(xmlDoc);

            Assert.AreEqual(bc.BarCodeValue, "069869408702625034879475616534770898107101290141508071305245");

            string xmlTaxNumber  = XmlHelperFunctions.GetSubNode(xmlDoc.DocumentElement, "fu:TaxNumber").InnerText;
            string codeTaxNumber = bc.BarCodeValue.Substring(39, 8);

            Assert.AreEqual(xmlTaxNumber, codeTaxNumber);
        }
示例#12
0
            public void WhenNullOrEmptyText_ExpectNoQrCode(string text)
            {
                // arrange
                var sut = new BarCodes();
                //act
                var actual = sut.With_Text(text)
                             .With_Default_Resolution()
                             .With_Default_Dimension()
                             .Of_Type_QR_Code(true)
                             .As_Png()
                             .Create();

                // assert
                actual.Length.Should().Be(0);
            }
示例#13
0
            public void WhenQrCode_ExpectGuid()
            {
                // arrange
                var barcodePath = Path.Combine(TestContext.CurrentContext.TestDirectory, "Barcode", "barcode3.png");
                var bytes       = File.ReadAllBytes(barcodePath);
                var sut         = new BarCodes();
                // act
                var actual = sut.With_Image(bytes)
                             .Of_Type_QR_Code(true)
                             .As_Png()
                             .Extract_Text();
                // assert
                var expected = "4b744914-00cc-4d29-99b9-d6c1a92db7a8";

                Assert.AreEqual(expected, actual);
            }
示例#14
0
            public void WhenResponseNotNull_ExpectQrCode()
            {
                // arrange
                var text = Guid.NewGuid().ToString();
                var sut  = new BarCodes();
                // act
                var actual = sut.With_Text(text)
                             .With_Default_Resolution()
                             .With_Default_Dimension()
                             .Of_Type_QR_Code(true)
                             .As_Png()
                             .Create();

                // assert
                actual.Length.Should().BeGreaterThan(0);
            }
示例#15
0
            public void WhenResponseNotNull_ExpectQrCodeSavedToFileSystem()
            {
                // arrange
                var localPath = Path.GetTempFileName() + ".png";
                var text      = Guid.NewGuid().ToString();
                var sut       = new BarCodes();

                // act
                sut.With_Text(text)
                .With_Default_Resolution()
                .With_Default_Dimension()
                .Of_Type_QR_Code(true)
                .As_Png()
                .Save_To(localPath);
                var qrCodeBytes = File.ReadAllBytes(localPath);

                // assert
                qrCodeBytes.Length.Should().BeGreaterThan(0);
            }
示例#16
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            Xamarin.Forms.Forms.Init(this, bundle);
            BarCodes.Init(() => (Activity)Forms.Context);

            //configuração do firebase
            topics = new List <string>();
            if (IsPlayServicesAvailable())
            {
                if (FirebaseInstanceId.Instance.Token != null)
                {
                    MakeGetRequest(FirebaseInstanceId.Instance.Token);
                }
            }

            Self = this;
            LoadApplication(new App());
        }
        public void WhenTheresRequestToAttachEndPoint_ShouldReturnAttachmentOfPDFWithBarcode()
        {
            //Arrange
            var createBarcodes = new BarCodes();
            var browser        = CreateBrowser(createBarcodes);

            //Act
            var result = browser.Get($"/api/AttachQRBarcode", with =>
            {
                with.HttpRequest();
            });

            var pdfPath = AppDomain.CurrentDomain.BaseDirectory + "Document\\Boot camp form - v2.pdf";
            var file    = File.ReadAllBytes(pdfPath);

            var actual = JsonConvert.DeserializeObject <AttachBarcodeResponse>(result.Result.Body.AsString());

            //Assert
            Assert.AreEqual(HttpStatusCode.OK, result.Result.StatusCode);
            Assert.AreNotEqual(file, actual.PdfWithBarcode);
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Page != null)
        {
            string appDirectory = HttpContext.Current.Server.MapPath(string.Empty);

            // Определяем выбранный отчёт
            string keyValue = Page.Request.QueryString.Get("reportname");
            if (keyValue == null)
            {
                keyValue = "SimpleList";
            }

            StiReport report   = new StiReport();
            string    text     = string.Empty;
            bool      isRender = false;
            switch (keyValue)
            {
            // Basic Reports
            case "SimpleList": report = new SimpleList(); text = "The sample demonstrates how to create a simple list report."; isRender = true; break;

            case "TwoSimpleLists": report = new TwoSimpleLists(); text = "The sample demonstrates how to create two simple list reports."; isRender = true; break;

            case "HighlightCondition": report = new HighlightCondition(); text = "The sample demonstrates how to use highlight condition to create a report."; isRender = true; break;

            case "Shapes": report = new Shapes(); text = "The sample demonstrates how to create a report with shapes."; isRender = true; break;

            case "Images": report = new Images(); text = "The sample demonstrates how to create a report with images."; isRender = true; break;

            case "Watermark": report = new Watermark(); text = "The sample demonstrates how to create a report with watermark."; isRender = true; break;

            case "BarCodes": report = new BarCodes(); text = "The sample demonstrates how to create a report with BarCodes."; isRender = true; break;

            case "Invoice": report = new Invoice(); text = "A simple invoice."; isRender = true; break;

            case "Indicators": report.Load(appDirectory + "\\Reports\\Indicators.mrt"); text = "This sample shows how to use indicators in the report."; break;

            // Reports with Columns
            case "MultiColumnList": report = new MultiColumnList(); text = "The sample demonstrates how to create a report with multiple columns. To create a report with columns set the Columns property of a page in two or more."; isRender = true; break;

            case "MultiColumnBandsAcrossThenDown": report = new MultiColumnBandsAcrossThenDown(); text = "The sample demonstrates how to create a report with multiple columns on the bands. Multicolumn direction - across then down."; isRender = true; break;

            case "MultiColumnBandsDownThenAcross": report = new MultiColumnBandsDownThenAcross(); text = "The sample demonstrates how to create a report with multiple columns on the bands. Multicolumn direction - down then across."; isRender = true; break;

            case "Labels": report = new Labels(); text = "The sample demonstrates how to create a report with labels."; isRender = true; break;

            // Master-Detail Reports
            case "MasterDetail": report = new MasterDetail(); text = "The sample demonstrates how to create a Master-Detail report."; isRender = true; break;

            case "MasterDetailSubdetail": report = new MasterDetailSubdetail(); text = "The sample demonstrates how to create a Master-Detail-Subdetail report."; isRender = true; break;

            case "MasterDetailWithColumns": report = new MasterDetailWithColumns(); text = "The sample demonstrates how to create a Master-Detail report with columns."; isRender = true; break;

            case "TwoMastersOnOneDetail": report = new TwoMastersOnOneDetail(); text = "The sample demonstrates how to create a report with two master-detail links. And detail for both links is the same."; isRender = true; break;

            case "MasterDetailWithZeroHeight": report = new MasterDetailWithZeroHeight(); text = "The sample demonstrates how to create a Master-Detail report in which one of the bands has the zero height."; isRender = true; break;

            case "MasterDetailOnDataBand": report = new MasterDetailOnDataBand(); text = "The sample demonstrates how to create a Master-Detail report in which one of the bands placed on other."; isRender = true; break;

            // Reports with Groups
            case "SimpleGroup": report = new SimpleGroup(); text = "The sample demonstrates how to create a simple group report with one group."; isRender = true; break;

            case "NestedGroups": report = new NestedGroups(); text = "The sample demonstrates how to create a report using several groups."; isRender = true; break;

            case "GroupsTopSales": report = new GroupsTopSales(); text = "This sample demonstrates how to sort group by its totals."; isRender = true; break;

            case "MasterDetailWithGroups": report = new MasterDetailWithGroups(); text = "The sample demonstrates how to create a Master-Detail report with groups."; isRender = true; break;

            case "MultiColumnGroup": report = new MultiColumnGroup(); text = "The sample demonstrates how to create a simple group report with two columns on page."; isRender = true; break;

            case "GroupsWithRanges": report = new GroupsWithRanges(); text = "The sample demonstrates how to create groups with ranges in report."; isRender = true; break;

            case "SimpleGroupWithColumns": report = new SimpleGroupWithColumns(); text = "The sample demonstrates how to create a simple group report with multiple columns on the bands. Multicolumn direction - across then down."; isRender = true; break;

            case "AllGroupFootersAtEnd": report = new AllGroupFootersAtEnd(); text = "This sample shows all group footers at the bottom of Report."; isRender = true; break;

            case "InvoiceWithGroups": report = new InvoiceWithGroups(); text = "An invoice with categories."; isRender = true; break;

            case "SalesInvoice": report = new SalesInvoice(); text = "Sales invoice."; isRender = true; break;

            // Hierarchical Reports
            case "Tree": report = new Tree(); text = "The sample demonstrates how to create hierarchical report."; isRender = true; break;

            case "TreeWithHeadersFooters": report = new TreeWithHeadersFooters(); text = "The sample demonstrates how to create hierarchical wiith headers and footers."; isRender = true; break;

            case "TreeWithTotals": report = new TreeWithTotals(); text = "The sample demonstrates how to create hierarchical report with totals."; isRender = true; break;

            case "TreeWithTotalsAllLevels": report = new TreeWithTotalsAllLevels(); text = "The sample demonstrates how to create hierarchical report with totals which include all sub-levels of tree."; isRender = true; break;

            case "TreeWithLockedComponents": report = new TreeWithLockedComponents(); text = "The sample demonstrates how to create hierarchical report with locked components."; isRender = true; break;

            // Parameters
            case "ParametersDetailedCategories": report.Load(appDirectory + "\\Reports\\ParametersDetailedCategories.mrt"); text = "Detailing by selected category of products."; break;

            case "ParametersDetailedOrders": report.Load(appDirectory + "\\Reports\\ParametersDetailedOrders.mrt"); text = "Detailing of the list of orders by specified number."; break;

            case "ParametersHighlightCondition": report.Load(appDirectory + "\\Reports\\ParametersHighlightCondition.mrt"); text = "Highlighting data rows by selected conditions."; break;

            //case "ParametersSelectingCountry": report.Load(appDirectory + "\\Reports\\ParametersSelectingCountry.mrt"); text = "Showing data only by selected countries."; break;
            //case "ParametersDateRange": report.Load(appDirectory + "\\Reports\\ParametersDateRange.mrt"); text = "Selecting the date range for printing data."; break;
            case "ParametersInvoice": report.Load(appDirectory + "\\Reports\\ParametersInvoice.mrt"); text = "This sample requests parameters for printing an invoice."; break;

            // Interactive Reports
            case "DrillDownListOfProducts": report.Load(appDirectory + "\\Reports\\DrillDownListOfProducts.mrt"); text = "The sample demonstrates how to use drill-down reports."; break;

            case "DrillDownGroupWithCollapsing": report.Load(appDirectory + "\\Reports\\DrillDownGroupWithCollapsing.mrt"); text = "The sample demonstrates how to use GroupHeaderBand without GroupFooterBand."; break;

            case "DrillDownSorting": report.Load(appDirectory + "\\Reports\\DrillDownSorting.mrt"); text = "The sample demonstrates how to use interactive sorting."; break;

            case "DrillDownGroupWithCollapsingWithoutFooter": report.Load(appDirectory + "\\Reports\\DrillDownGroupWithCollapsingWithoutFooter.mrt"); text = "The sample demonstrates how to use GroupHeaderBand without GroupFooterBand."; break;

            case "DrillDownMasterDetailWithCollapsing": report.Load(appDirectory + "\\Reports\\DrillDownMasterDetailWithCollapsing.mrt"); text = "The sample demonstrates how to use Master-Detail report with collapsing."; break;

            case "EditableReport": report.Load(appDirectory + "\\Reports\\EditableReport.mrt"); text = "The sample demonstrates how to edit a rendered report in the Preview Window."; break;

            case "BookmarksHyperlinks": report.Load(appDirectory + "\\Reports\\BookmarksHyperlinks.mrt"); text = "The sample demonstrates how to use bookmarks and hyperlinks."; break;

            case "Anchors": report.Load(appDirectory + "\\Reports\\Anchors.mrt"); text = "The sample demonstrates how to use anchors."; break;

            // Charts
            case "ChartColumnsAndBars": report = new ChartColumnsAndBars(); text = "This sample demonstrates Column and Bar chart types."; isRender = true; break;

            case "ChartLinesAndSplines": report = new ChartLinesAndSplines(); text = "This sample demonstrates Line and Spline chart types."; isRender = true; break;

            case "ChartAreas": report = new ChartAreas(); text = "This sample demonstrates Areas chart types."; isRender = true; break;

            case "ChartPieAndDoughnut": report = new ChartPieAndDoughnut(); text = "This sample demonstrates Pie and Doughnut chart types."; isRender = true; break;

            case "ChartStyles": report = new ChartStyles(); text = "This sample demonstrates different chart styles."; isRender = true; break;

            case "ChartOnDataband": report = new ChartOnDataband(); text = "This sample demonstrates how to use a chart with DataBand."; isRender = true; break;

            // Reports with EmptyBand
            case "SimpleListWithEmptyLines": report = new SimpleListWithEmptyLines(); text = "The sample demonstrates how to create a simple list report with empty lines on the bottom of a page."; isRender = true; break;

            case "MasterDetailWithEmptyLines": report = new MasterDetailWithEmptyLines(); text = "The sample demonstrates how to create a Master-Detail report with empty lines on the bottom of a page."; isRender = true; break;

            case "InvoiceWithEmptyBand": report = new InvoiceWithEmptyBand(); text = "An invoice created using an Empty Band."; isRender = true; break;

            // Containers
            case "SideBySideListWithContainers": report = new SideBySideListWithContainers(); text = "The sample demonstrates how to create a report that contains two side by side lists with containers."; isRender = true; break;

            case "SideBySideGroupWithContainers": report = new SideBySideGroupWithContainers(); text = "The sample demonstrates how to create a report that contains two side by side groups with containers."; isRender = true; break;

            case "MultiColumnListContainers": report = new MultiColumnListContainers(); text = "The sample demonstrates how to create a report with multiple columns using containers."; isRender = true; break;

            case "MasterDetailCards": report = new MasterDetailCards(); text = "The sample demonstrates how to create a Master-Detail report which data are grouped as cards."; isRender = true; break;

                // SubReports
                //case "SideBySideListWithSubReports": report = new SideBySideListWithSubReports(); text = "The sample demonstrates how to create a report that contains two side by side lists with SubReports."; isRender = true; break;
                //case "SideBySideGroupWithSubReports": report = new StiSideBySideGroupWithSubReportsReport(); text = "The sample demonstrates how to create a report that contains two side by side groups with SubReports."; break;
                //case "MasterDetailWithSubReports": report = new StiMasterDetailWithSubReportsReport(); text = "The sample demonstrates how to create a Master-Detail report with SubReports."; break;
            }

            //report = new StiReport();
            //report.Load(appDirectory + "\\Reports\\shapes.mrt");
            LabelText.Text = text;

            RenderReport(report, isRender);
            StiWebViewerSL1.Report = report;
        }
    }
        public static Object ajaxGetInvoicesForArticle(String article, String customer)
        {
            ///
            /// Deido a que la funcion es estatica se deben crear referencias para podre hacer llamados a algunos metodos
            System.Web.SessionState.HttpSessionState sessions = HttpContext.Current.Session;


            Users user = (Users)sessions[Constants.NameSessionUser];

            // Cargar session de compañia
            String company = user._usv_co;

            String art = "";
            ///
            String size = "";

            ///
            String[] infoCodeBars;
            ///
            if (!String.IsNullOrEmpty(article))
            {
                /// Pos 0: Articulo referencia
                /// Pos 1: Plano
                infoCodeBars = BarCodes.getInfoFromTheBarCode(article);
                ///
                if (infoCodeBars == null)
                {
                    ///lblMsg.Text = "Codigo de articulo invalido.";
                    //return;
                }
                ///
                art = infoCodeBars[0].ToString();
                /// Para saber si se debe consultar la talla legible se debe medir el numero de digitos; El EAN13 posee 14
                ///
                if (article.Length == 13)
                {
                    size = (Convert.ToDecimal(infoCodeBars[1]) - 1).ToString();
                }
                else
                {
                    ///
                    size = infoCodeBars[1].ToString();
                }
            }
            ///
            DataTable results = Facturacion.getSalesDevolByCoord(company, customer, art, size);

            ///
            JsonArray jj = new JsonArray();
            ///
            JsonObject jso = new JsonObject();

            ///
            if (results != null && results.Rows.Count > 0)
            {
                foreach (DataRow dr in results.Rows)
                {
                    ///
                    jso = new JsonObject();
                    /// Fecha factura
                    jso.Put("ihd_date", dr["ihd_date"].ToString().Trim());
                    /// Nombre articulo
                    jso.Put("Nombre", dr["arv_name"].ToString().Trim());
                    /// Referencia
                    jso.Put("Ref", dr["idv_article"].ToString().Trim());
                    /// Marca
                    jso.Put("brand", dr["brv_description"].ToString().Trim());
                    /// Color
                    jso.Put("Color", dr["cov_description"].ToString().Trim());
                    /// Talla
                    jso.Put("Size", dr["idv_size"].ToString().Trim());
                    /// Cantidades en factura
                    jso.Put("Qty", dr["idn_qty"].ToString().Trim());
                    /// Factura
                    jso.Put("idv_invoice", dr["idv_invoice"].ToString().Trim());
                    /// qty devueltas
                    jso.Put("qty_devol", dr["rdn_qty"].ToString().Trim());
                    /// Sell price
                    jso.Put("idn_sellprice", Convert.ToDecimal(dr["idn_sellprice"]).ToString("n0"));
                    /// Cantidades habilitAQUARELLAs para la devolucion
                    jso.Put("qty_to_devol", dr["qty_to_devol"].ToString());
                    ///  precio neto aproximado al cual se realizara la devolucion
                    jso.Put("idn_neto", Convert.ToDecimal(dr["idn_neto"]).ToString("n0"));
                    /// Numero de devolucion en caso tal de que haya sido devuelto
                    jso.Put("rdv_return", dr["rdv_return"].ToString());
                    ///
                    jj.Put(jso);
                }
            }
            else
            {
                ///
                jso = new JsonObject();
                jso.Put("Nombre", "No Existen Compras resgistrAQUARELLAs de este cliente en este articulo.");
                jso.Put("Size", "-1");
                jj.Put(jso);
            }
            ///
            JsonObject jsoGeneral = new JsonObject();

            ///
            Object[] obj = new Object[2];
            ///
            var ret = jj.ToArray();

            return(ret);
        }
示例#20
0
        static void Main(string[] args)
        {
            //Should fix Console ä ö å problems
            Console.OutputEncoding = System.Text.Encoding.UTF8;
            // Tuple boolean is used to determine if bank number is BBAN or IBAN. null if invalid number.
            Tuple <bool, string> bankNumberTuple = null;
            string refNumber          = String.Empty;
            bool   refIsInternational = false;
            bool   refValid           = false;

            try
            {
                // Get user to input a bank number.
                Console.WriteLine("Please write a bank account number (BBAN or IBAN) 8-14 numbers:");
                bankNumberTuple = Input.InputBankNumber(Console.ReadLine());// "159030776");

                // Change bank number into machine format
                bankNumberTuple = MachineFormat.MachineReadable(bankNumberTuple);
                Console.WriteLine("Machine readable version: " + bankNumberTuple.Item2);
                // And test for validity.
                Console.WriteLine("Testing for BBAN/IBAN validity...");
                bankNumberTuple = Validation.Validate(bankNumberTuple);

                if (bankNumberTuple == null)
                {
                    Console.WriteLine("Bank number is NOT valid.");
                }
                else
                {
                    String bankFormat = bankNumberTuple.Item1 ? "IBAN" : "BBAN";
                    Console.WriteLine("{0} is valid {1}.", bankNumberTuple.Item2, bankFormat);

                    // If bank number is in BBAN format, change into IBAN
                    if (!bankNumberTuple.Item1)
                    {
                        Console.WriteLine("Changing BBAN number to IBAN format: ");
                        bankNumberTuple = new Tuple <bool, string>(true, International.ChangeToInternational(bankNumberTuple.Item2, "FI"));
                        Console.WriteLine(bankNumberTuple.Item2);
                    }

                    // Find BIC code from IBAN
                    Console.WriteLine("Trying to find matching BIC code:");
                    Console.WriteLine(BIC.BIC_Define(bankNumberTuple));
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }


            // Reference number method calls
            try
            {
                Console.WriteLine("Please write a reference number (national or international).");
                Console.WriteLine("Base part is 3-19 numbers and optionally end with one (1) validation number:");
                refNumber          = Console.ReadLine();// "12345672";//Console.ReadLine();
                refIsInternational = International.IsInternational(refNumber);
                string amount = String.Empty;
                refNumber = RefNumbers.EnsureCorrectInput(refNumber, refIsInternational);
                Console.WriteLine(refIsInternational ? "International reference number detected." : "National reference number detected.");
                if (!refIsInternational)
                {
                    Console.WriteLine("How many valid reference numbers you want to generate, if any:");
                    amount = Console.ReadLine();
                }

                // If user is not generating any numbers (amount = 0 or null), check the validity of given number.
                if (!int.TryParse(amount, out int amountInt) || amountInt < 1)
                {
                    //Checks if given validation number is correct
                    Console.WriteLine("Checking reference number validity...");
                    refValid = RefNumbers.ValidifyReferenceNumber(refNumber, refIsInternational);
                    if (refValid)
                    {
                        Console.WriteLine(RefNumbers.WhiteSpaces(refNumber) + " - OK");
                        if (!refIsInternational)
                        {
                            Console.WriteLine("International version: " + RefNumbers.WhiteSpaces(International.ChangeToInternational(refNumber, "RF")));
                        }
                    }
                    else
                    {
                        Console.WriteLine("Reference number is incorrect!");
                    }
                }
                // Otherwise generate given amount of reference numbers (with validation numbers). Only national numbers can be generated.
                else
                {
                    string[] refGenerated = RefNumbers.Generate(refNumber, amountInt);
                    for (int i = 0; i < refGenerated.Length; i++)
                    {
                        // Add white spaces and print all generated numbers
                        // Also change into international format and print them out
                        Console.WriteLine(RefNumbers.WhiteSpaces(refGenerated[i]) + "\t  International version:  " + RefNumbers.WhiteSpaces(International.ChangeToInternational(refGenerated[i], "RF")));
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            // Bank Barcode function calls. Uses previous inputs as bank number and reference number
            try
            {
                if (bankNumberTuple != null && refNumber != null && refValid)
                {
                    // Input invoice amount
                    Console.WriteLine("If you are making an invoice, please insert invoice amount in euros (. or , can be used as decimal separator): ");
                    string invoice = Console.ReadLine();
                    invoice = BarCodes.InputInvoice(invoice);
                    // Input due date
                    if (invoice != String.Empty)
                    {
                        Console.WriteLine("Please insert due date for payment (dd mm yyyy): ");
                        string dueDate = Console.ReadLine();
                        dueDate = BarCodes.InputDate(dueDate);

                        Console.WriteLine("Invoice: {0}  Due date: {1}", invoice, dueDate);
                        string barCode;
                        // 105 = Start Code C
                        if (refIsInternational) // use version 5
                        {
                            barCode = "5" + bankNumberTuple.Item2.Substring(2) + invoice + refNumber.Substring(2, 2) + BarCodes.FillWithZeroPrefix(refNumber.Substring(4), 21) + dueDate;
                            //Calculate modulo 103
                            string mod103 = BarCodes.Modulo103(barCode);
                            barCode = "[105] " + BarCodes.WhiteSpaces(barCode) + $"[{mod103}]" + " [106]"; // START, barcode, checksum, STOP
                        }
                        else // use version 4
                        {
                            barCode = "4" + bankNumberTuple.Item2.Substring(2) + invoice + "000" + BarCodes.FillWithZeroPrefix(refNumber, 20) + dueDate;
                            //Calculate modulo 103
                            string mod103 = BarCodes.Modulo103(barCode);
                            barCode = "[105] " + BarCodes.WhiteSpaces(barCode) + $"[{mod103}]" + " [106]"; // START, barcode, checksum, STOP
                        }

                        Console.WriteLine(barCode);
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            Console.ReadKey();
        }
示例#21
0
 /// <summary>
 /// Draws the specified data matrix code.
 /// </summary>
 public void DrawMatrixCode(BarCodes.MatrixCode matrixcode, XBrush brush, XPoint position)
 {
   matrixcode.Render(this, brush, position);
 }
示例#22
0
 /// <summary>
 /// Draws the specified bar code.
 /// </summary>
 public void DrawBarCode(BarCodes.BarCode barcode, XBrush brush, XFont font, XPoint position)
 {
   barcode.Render(this, brush, font, position);
 }
示例#23
0
    // ----- DrawBarCode --------------------------------------------------------------------------

    /// <summary>
    /// Draws the specified bar code.
    /// </summary>
    public void DrawBarCode(BarCodes.BarCode barcode, XPoint position)
    {
      barcode.Render(this, XBrushes.Black, null, position);
    }
示例#24
0
        /// <summary>
        /// Empacar un articulo
        /// </summary>
        public void packArticleCodeBar()
        {
            try
            {
                /// Descomponer la informacion contenida en el codigo de barras
                /// Determinar la codificacion de la referencia del articulo.
                /// Si es Ean13, o si es referencia mas talla, entre otros
                ///

                string   v_articulo  = txtArticlesRef.Text.Trim();
                string   _barra      = (txtArticlesRef.Text.Trim().Length == 18) ? txtArticlesRef.Text.Trim() : "";
                String[] infoArticle = BarCodes.getInfoFromTheBarCode(txtArticlesRef.Text);


                ///
                if (infoArticle != null && infoArticle.Length > 0)
                {
                    String sizeToAdd = infoArticle[1];
                    /// Article
                    String articleToAdd = infoArticle[0];

                    String calidadToAdd = infoArticle[2];

                    string varReturn = Venta.insertar_articulopaq(Packages._paq_id, Liquidation_Hdr._liq_id, articleToAdd, sizeToAdd, 1, calidadToAdd, _barra);


                    ///
                    if (varReturn.Equals("1"))
                    {
                        this.Dispatcher.BeginInvoke(DispatcherPriority.Send, new Action(loadAllGrids));
                        ///
                        this.changeSemaphore(Brushes.YellowGreen);
                        ///
                        lblMessage.Text = " > Artículo " + articleToAdd + " adicionado correctamente.";
                    }
                    else
                    {
                        ///
                        MessageBox.Show("El Código Leído ( " + txtArticlesRef.Text + " ) no Corresponde a un Artículo en el Pedido o ya Ha Sido Empacado en Su Totalidad.", "Aquarella - Mensaje De Advertencia",
                                        MessageBoxButton.OK, MessageBoxImage.Exclamation);
                        /// Adicionar articulo a textarea de errores de lectura
                        this.txtAreaArticlesError.Text += Environment.NewLine + " > Articulo desconocido o código de barras incorrecto - " + txtArticlesRef.Text + " - ";
                        /// Semaforo en rojo, adicion de articulo incompleta
                        changeSemaphore(Brushes.Red);
                    }
                }/// codigo de barras erroneo
                else
                {
                    ///
                    lblMessage.Foreground = Brushes.Maroon;
                    /// Articulo desconocido o codigo de barras incorrecto
                    ///
                    lblMessage.Text = " > Articulo " + txtArticlesRef.Text + " desconocido o codigo de barras incorrecto !!.";
                    ///
                    MessageBox.Show("Articulo desconocido o codigo de barras incorrecto !!.", "Aquarella - Mensaje De Advertencia", MessageBoxButton.OK, MessageBoxImage.Exclamation);

                    /// Adicionar articulo a textarea de errores de lectura
                    this.txtAreaArticlesError.Text += Environment.NewLine + " > Articulo desconocido o código de barras incorrecto - " + txtArticlesRef.Text + " - ";

                    /// Semaforo en rojo, adicion de articulo incompleta
                    changeSemaphore(Brushes.Red);
                }
            }
            catch
            { }
        }