Esta documentación está en fase de desarrollo y puede contener errores.

Ejemplo: agregar un cliente desde Dinaup (.NET)

Cómo agregar un cliente a la base de datos de Dinaup con el SDK para .NET y una WriteOperation sobre la sección Entidades.

Este ejemplo usa WriteOperation del SDK Dinaup (.NET) para agregar un cliente en la sección Entidades, con la opción de Cliente (bool) activada.

 
public async Task<Guid> AddCustomer()
{
 
    var datosCliente = new Dictionary<string, string>
    {
        { SectionsD.EntidadesD.EntidadesES.TextoPrincipal, $"Cliente {Guid.NewGuid()}" },
        { SectionsD.EntidadesD.EntidadesES.NombrePersonalRazonSocial, "Juan García S.A." },
        { SectionsD.EntidadesD.EntidadesES.Apellidos, "García López" },
        { SectionsD.EntidadesD.EntidadesES.Cliente, "1" }
    };

    var writeOperation = new WriteOperation(string.Empty, datosCliente);
    var seccionID = SectionsD.EntidadesD._SectionIDGUID;

    try
    {
        await Client.RunWriteOperationAsync(seccionID, writeOperation, false);
        writeOperation.EnsureSuccess();
        return writeOperation.WriteOperationResult.RowID;
    }
    catch (Exception ex)
    {
        Dinaup.Logs.Error(ex, "AddCustomer");
        throw;
    }
}