<%@ language="javascript"%>
<% /*
     $Revision$
     $Id$

     File:               PRJ/rap_prj5_save.asp
     Description:
     Parameters:
     Note:
*/ %>

<%
var JSON_Result = true;
%>

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

<%
protectRequest.validateToken();
/***** Get webform parameters *****/
var actie = getFParam("actie");
/***** End get webform parameters *****/


function doMove()
{
  var deel_key = getFParamInt("deel_key");
  var room_key = getFParamInt("room_key");
  dwgX = getFParamFloat("dwgX");
  dwgY = getFParamFloat("dwgY");
  __Log("deel_key: " + deel_key + " naar: " + room_key);
  sql = "UPDATE prj_deel SET prj_ruimte_key = " + room_key
      + "     , prj_deel_dwgx = " + dwgX
      + "     , prj_deel_dwgy = " + dwgY
      + "     , prj_deel_verwijder = NULL" // revive
      + " WHERE prj_deel_key = " + deel_key
  Oracle.Execute(sql);
}


var message = "";
switch (actie)
{
  case 'domove': doMove();
       break;
}
var result = {message: message};
Response.Write(JSON.stringify(result));
Response.End;
%>
