Exemplo n.º 1
0
    public static void DeleteConflictingGuid(Connection conn, Guid guid)
    {
        SqlSelect select = new SqlSelect(EPortGuidName, CommonFields);

        select.AddString("F_GUID", guid.ToString());

        using (Query q = new Query(conn, select))
        {
            if (q.Read())
            {
                EPortSend send = new EPortSend();

                send.GetData(q, CommonFields);
                send.DeleteGuid(conn, guid, " conflicting");
            }
        }
    }
Exemplo n.º 2
0
    public static Guid NewGuid(Connection conn)
    {
        bool exists;
        Guid guid;

        do  // though for(;;) is simpler
        {
            SqlSelect select = new SqlSelect(EPortGuidName, "F_GUID");

            guid = Guid.NewGuid();
            select.AddString("F_GUID", guid.ToString());

            using (Query q = new Query(conn, select))
                exists = q.Read();
        } while (exists);

        return(guid);
    }