public static void InsertMysqlInsuredAutorization()
        {
            ConectarEpslog();
            string          query         = "select * from seguros_datosgenerales where flag = '0' and cautocode <> '0000'";
            OleDbCommand    commandselect = new OleDbCommand(query, Conex);
            OleDbDataReader reader        = commandselect.ExecuteReader();

            while (reader.Read())
            {
                if (!CompanyInsuredExists(reader))
                {
                    ConnectionMySQL.Connect();
                    //CAMBIAR EL COMPANY_RUC POR COMPANY_CODE
                    ConnectionMySQL.InsertCompanyInsured(reader.GetValue(24).ToString(), reader.GetValue(23).ToString(), reader.GetString(16), reader.GetString(25));
                    ConnectionMySQL.Disconnect();
                }
                if (!InsuredExists(reader))
                {
                    string clinic_history_code = GetClinicHistoryCode();
                    ConnectionMySQL.Connect();
                    ConnectionMySQL.InsertInsuredInsured("5", reader.GetString(24), reader.GetString(0), reader.GetString(32), reader.GetString(1), reader.GetString(35), reader.GetString(6), reader.GetString(7), reader.GetString(8), reader.GetString(9), reader.GetString(10), reader.GetString(11), Helper.GetDate(reader.GetString(12)), reader.GetInt16(13).ToString(), reader.GetString(14).ToString(), Helper.GetDate("19900101"), Helper.GetDate("19900101"), Helper.GetDate("19900101"), reader.GetString(41), "", clinic_history_code);
                    ConnectionMySQL.Disconnect();
                }
                string intern_code = GetInternCode();
                ConnectionMySQL.Connect();
                ConnectionMySQL.InsertAuthorization(reader.GetString(1), "2", reader.GetString(5), reader.GetString(2), Helper.GetDateTime(reader.GetString(3)), reader.GetString(8), reader.GetString(6), reader.GetString(7), Helper.GetDate(reader.GetString(12)), "99999", intern_code, reader.GetValue(20).ToString());
                ConnectionMySQL.Disconnect();
                UpdateAfterInsert("seguros_datosgenerales", "cAutoCode", 2, reader);
            }
            Desconectar();
        }
        public static void InsertMysqlAutorization()
        {
            ConectarEpslog();
            string          query         = "select * from datosgenerales where flag = '0' and cautocode <> '0000'";
            OleDbCommand    commandselect = new OleDbCommand(query, Conex);
            OleDbDataReader reader        = commandselect.ExecuteReader();

            while (reader.Read())
            {
                if (!CompanyExists(reader))
                {
                    ConnectionMySQL.Connect();
                    ConnectionMySQL.InsertCompany(reader.GetString(24), reader.GetString(17), reader.GetString(16), reader.GetString(18));
                    ConnectionMySQL.Disconnect();
                }
                if (!InsuredExists(reader))
                {
                    string clinic_history_code = GetClinicHistoryCode();
                    ConnectionMySQL.Connect();
                    ConnectionMySQL.InsertInsured(reader.GetString(27), reader.GetString(17), reader.GetString(0), reader.GetString(22), reader.GetString(1), reader.GetString(23), reader.GetString(6), reader.GetString(7), reader.GetString(8), reader.GetString(9), reader.GetString(10), reader.GetString(11), Helper.GetDate(reader.GetString(12)), reader.GetInt16(13).ToString(), reader.GetString(14).ToString(), Helper.GetDate(reader.GetString(19)), Helper.GetDate(reader.GetString(20)), Helper.GetDate(reader.GetString(21)), reader.GetString(29), "", clinic_history_code);
                    ConnectionMySQL.Disconnect();
                }
                string intern_code = GetInternCode();
                ConnectionMySQL.Connect();
                ConnectionMySQL.InsertAuthorization(reader.GetString(1), reader.GetString(25), reader.GetString(5), reader.GetString(2), Helper.GetDateTime(reader.GetString(3)), reader.GetString(8), reader.GetString(6), reader.GetString(7), Helper.GetDate(reader.GetString(12)), reader.GetValue(35).ToString(), intern_code, null);
                ConnectionMySQL.Disconnect();
                ConnectionMySQL.Connect();
                ConnectionMySQL.UpdateCompany(reader.GetValue(3).ToString(), reader.GetValue(17).ToString());
                ConnectionMySQL.Disconnect();
                UpdateAfterInsert("DatosGenerales", "cAutoCode", 2, reader);
            }
            Desconectar();
        }