Ejemplo n.º 1
0
        private async void btnMergeFact_Click(object sender, EventArgs e)
        {
            pgbAnalisis.Visible = true;
            pgbAnalisis.Style   = eDotNetBarStyle.Windows7;

            btnMergeFact.Enabled = false;

            await Task.Run(() =>
            {
                try {
                    CheckForIllegalCrossThreadCalls = false;
                    var engineNotas        = new FileHelperEngine <NotasCSV>();
                    NotasCSV[] resultNotas = engineNotas.ReadFile(archFact.rutaNotas);
                    conexion.InsertarRegistrosNotas(resultNotas);


                    var engineBase        = new DelimitedFileEngine <BaseCSV>();
                    engineBase.Encoding   = Encoding.UTF8;
                    BaseCSV[] resultBases = engineBase.ReadFile(archFact.rutaFactBruta);
                    conexion.InsertarRegistrosEnBaseFacturacion(resultBases);


                    notifyIcon1.Visible         = true;
                    notifyIcon1.Icon            = SystemIcons.Information;
                    notifyIcon1.BalloonTipTitle = "MENSAJE DEL SISTEMA";
                    notifyIcon1.BalloonTipText  = "PROCESO COMPLETADO SATISFACTORIAMENTE.";
                    notifyIcon1.BalloonTipIcon  = ToolTipIcon.Info;
                    notifyIcon1.ShowBalloonTip(1000);
                }
                catch (Exception ex)
                {
                    MessageBoxEx.Show(this, "ERROR AL GENERAR ARCHIVO.\n" + ex.Message, "ERROR DEL SISTEMA", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            });

            FlashWindowHelper.Flash(this);
            //btnImport.Enabled = true;
            pgbAnalisis.Visible = false;
            // MessageBoxEx.Show(this, "PROCESO COMPLETADO SATISFACTORIAMENTE", "MENSAJE DEL SISTEMA", MessageBoxButtons.OK, MessageBoxIcon.Information);
            archFact.GenerarFacturacinBruta = true;
            if (!archFact.GenerarFacturacionNeta)
            {
                btnGenerarFactNeta.Enabled = true;
            }
        }
Ejemplo n.º 2
0
        private void PlayNotification()
        {
            Window window = Window.GetWindow(this);

            if (!window.IsActive || !IsVisible)
            {
                IntPtr handle = new WindowInteropHelper(window).Handle;
                FlashWindowHelper.Flash(handle);

                if (File.Exists("Assets/message.wav"))
                {
                    using (SoundPlayer player = new SoundPlayer("Assets/message.wav"))
                    {
                        player.Play();
                    }
                }
            }
        }