Example #1
0
        private void BtnIniciar_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.VerificarEsquema())
                {
                    string rpta = "OK";
                    MensajeEspera.ShowWait("Cargando");
                    this.CrearTablaErrores();

                    if (this.VerificarClientes(out string consulta))
                    {
                        rpta = EClientes.InsertarClientes(consulta);
                        if (rpta.Equals("OK"))
                        {
                            MensajeEspera.CloseForm();
                            Mensajes.MensajeInformacion("Se importaron los clientes correctamente", "Entendido");
                            this.Close();
                        }
                        else
                        {
                            throw new Exception("Hubo un error al insertar los clientes en la consulta masiva, " + rpta);
                        }
                    }
                    MensajeEspera.CloseForm();
                }
            }
            catch (Exception ex)
            {
                MensajeEspera.CloseForm();
                Mensajes.MensajeErrorCompleto(this.Name, "BtnIniciar_Click",
                                              "Hubo un error al cargar los clientes", ex.Message);
            }
        }