<%@ LANGUAGE = JavaScript %>
<% /*
    $Revision$
    $Id$

    File:           prs_delete.asp
    Description:    Verwijderen alg-object

    Parameters:     key
                    level: "A" "P" "K" "G" "KPN"
    Context:        Vanuit show-schermen en of vanuit overzichten
    Result:         JSON object
    Note:

*/
var JSON_Result = true;
%>

<!-- #include file="../Shared/common.inc" -->
<!-- #include file="../Shared/json2.js" -->
<!-- #include file="../INS/ins.inc" -->

<%
protectRequest.validateToken();

var ins_key = getFParamIntArray("ins_key");
var srtcontr_key = getFParamInt("srtcontr_key");

// Mag ik het object aanpassen?
var this_ins = ins.func_enabled_deel(ins_key);
user.anything_todo_or_abort(this_ins.canChangeXcp);

var sql = "DELETE FROM ins_srtcontroledl_xcp"
        + " WHERE ins_deel_key = " + ins_key
        + "   AND ins_srtcontrole_key = " + srtcontr_key;

result = {success: true};
var err = Oracle.Execute(sql, true);
if (err.friendlyMsg)
{
  result.message = err.friendlyMsg;
}

Response.Write(JSON.stringify(result));
%>