Exemplo n.º 1
0
    public void AddPost(Post post)
    {
        bool exists = IsUsernamePresentQuery <bool> .Execute(new { profile.Username });

        if (exists)
        {
            AddPostCommand.Execute(new
            {
                post.Author,
                post.Content,
                post.Timestamp
            });
        }
    }
Exemplo n.º 2
0
    public void EditProfile(Profile profile)
    {
        bool exists = IsUsernamePresentQuery <bool> .Execute(new { profile.Username });

        if (exists)
        {
            UpdateProfileCommand.Execute(new
            {
                profile.Username,
                profile.FirstName,
                profile.LastName,
                profile.Email,
                profile.Mobile,
                profile.Description
            });
        }
    }
Exemplo n.º 3
0
    public void Register(Profile profile)
    {
        bool exists = IsUsernamePresentQuery <bool> .Execute(new { profile.Username });

        if (!exists)
        {
            _paymentPortal.ProcessPayment(profile.Username);
            InsertProfileCommand.Execute(new
            {
                profile.Username,
                profile.FirstName,
                profile.LastName,
                profile.Email,
                profile.Mobile,
                profile.Description
            });
        }
    }
Exemplo n.º 4
0
    public void AddPost(Post post)
    {
        bool exists = IsUsernamePresentQuery <bool> .Execute(new { profile.Username });

        if (exists)
        {
            var id = AddPostCommand.Execute(new
            {
                post.Author,
                post.Content,
                post.Timestamp
            });

            var hash = HashObject(post).ToHexString();

            Connector connector = new Connector(credentialManager.PublicKey, credentialManager.PrivateKey);
            connector.Call("addPostHash", id, hash);
        }
    }
Exemplo n.º 5
0
    public void Register(Profile profile)
    {
        bool exists = IsUsernamePresentQuery <bool> .Execute(new { profile.Username });

        if (!exists)
        {
            _paymentPortal.ProcessPayment(profile.Username);
            var id = InsertProfileCommand.Execute(new
            {
                profile.Username,
                profile.FirstName,
                profile.LastName,
                profile.Email,
                profile.Mobile,
                profile.Description
            });

            var hash = HashObject(profile).ToHexString();

            Connector connector = new Connector(credentialManager.PublicKey, credentialManager.PrivateKey);
            connector.Call("addProfileHash", id, hash);
        }
    }
Exemplo n.º 6
0
    public void EditProfile(Profile profile)
    {
        bool exists = IsUsernamePresentQuery <bool> .Execute(new { profile.Username });

        if (exists)
        {
            UpdateProfileCommand.Execute(new
            {
                profile.Id,
                profile.Username,
                profile.FirstName,
                profile.LastName,
                profile.Email,
                profile.Mobile,
                profile.Description
            });

            var hash = HashObject(profile).ToHexString();

            Connector connector = new Connector(credentialManager.PublicKey, credentialManager.PrivateKey);
            connector.Call("editProfileHash", profile.Id, hash);
        }
    }