Computing > 10 - Requests for Assistance > Accept or decline of the estimate

10.6 Accept or decline of the estimate

The method SetAssistanceQuotationAcceptance enables the user to accept or refuse an assistance quotation made available by assistance team (the request is in status “Estimated”).

Parameters
quotationId
Type: int
Value of type int with quotation identifier

status
Type: AssistanceRequestQuotationAcceptanceStatus
VAlue of type AssistanceRequestQuotationAcceptanceStatus with the status to set: "accepted" or "refused"

 
/// IWsEndUser.SetAssistanceQuotationAcceptance Method (c# .NET)
public static string SetAssistanceQuotationAcceptance(WsEndUserClient client,
    int quotationId, AssistanceRequestQuotationAcceptanceStatus status)
{
    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "0123456789";

    StringBuilder stringBuilder = new StringBuilder();

    try
    {
        //call method SetAssistanceQuotationAcceptance, 
        //obtaining a WsResult item                
        WsResult result = client.SetAssistanceQuotationAcceptance(quotationId, status);

        //if the call is not successful, re-run the error indicating the message
        if (result.Success)
        {
            // print the result code and message
            stringBuilder.Append("code: ");
            stringBuilder.Append(result.ResultCode);
            stringBuilder.Append(" - message: ");
            stringBuilder.Append(result.ResultMessage);
        }
        else
        {
            throw new ApplicationException(result.ResultMessage);
        }
    }
    catch (Exception ex)
    {
        // re-run the error
        throw new ApplicationException(ex.Message);
    }

    return stringBuilder.ToString();
}
// IWsEndUser.SetAssistanceQuotationAcceptance Method (JAVA)
private static String setAssistanceQuotationAcceptance(IWsEndUser client,
    int quotationId, AssistanceRequestQuotationAcceptanceStatus status)
{
    //specify the account login details 
    ((BindingProvider) client).getRequestContext()
            .put(BindingProvider.USERNAME_PROPERTY, "ARU-0000");
    ((BindingProvider) client).getRequestContext()
            .put(BindingProvider.PASSWORD_PROPERTY, "0123456789");

    StringBuilder stringBuilder = new StringBuilder();

    try
    {
        //call method setAssistanceQuotationAcceptance, 
        //obtaining a WsResult item                
        WsResult result = client.setAssistanceQuotationAcceptance(quotationId, status);

        //if the call is not successful, re-run the error indicating the message
         if (result.isSuccess())
        {
            // print the result code and message
            stringBuilder.append("code: ");
            stringBuilder.append(result.getResultCode());
            stringBuilder.append(" - message: ");
            stringBuilder.append(result.getResultMessage());
        }
        else
        {
            throw new Exception(result.getResultMessage());
        }
    }
    catch (Exception ex)
    {
         // show the error
        System.out.println(ex);
    }

    return stringBuilder.toString();
}
Version
API: v2.8 URL: https://api.dc1.computing.cloud.it/WsEndUser/v2.8/WsEndUser.svc?wsdl