Skip to content

Commit

Permalink
v1.043
Browse files Browse the repository at this point in the history
  • Loading branch information
andiazher committed Apr 12, 2017
1 parent c140f7a commit d0b3325
Showing 1 changed file with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re
registro = registro.getEntitieParam("POLIZA", poliza).get(0);
registro.getData().set(registro.getColums().indexOf("ESTADOP"),"ANULADA");
registro.update();
//FALTA
String npoliza = request.getParameter("npoliza").toUpperCase();
Calendar fecha = new GregorianCalendar();
String f= fecha.get(Calendar.YEAR) +"-"+(fecha.get(Calendar.MONTH)+1)+"-"+fecha.get(Calendar.DAY_OF_MONTH);
Expand Down Expand Up @@ -119,9 +118,9 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re
Entitie ad = new Entitie(App.TABLE_ASIS_DENTAL);
try{
ad = ad.getEntitieParam("POLIZA", poliza).get(0);
ad.getData().set(ad.getColums().indexOf("ESTADO"), "3");
ad.getData().set(ad.getColums().indexOf("ESTADOPOL"), "ANULADA");
ad.update(); //ACTUALIZAR LA POLZIA CANCELADA
//ad.getData().set(ad.getColums().indexOf("ESTADO"), "3");
//ad.getData().set(ad.getColums().indexOf("ESTADOPOL"), "ANULADA");
//ad.update(); //ACTUALIZAR LA POLZIA CANCELADA
int ram=(int) (Math.random()*100000);
ad.getData().set(ad.getColums().indexOf("POLIZA"), "*NV*"+ram);
ad.create(); //CREAR LA NUEVA POLIZA
Expand Down Expand Up @@ -168,9 +167,18 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re
System.out.println("Respuesta del Servicio Crear: "+messagge);

if(messagge.equals("1")){

ad.getData().set(ad.getColums().indexOf("ESTADO"), "2");
ad.getData().set(ad.getColums().indexOf("ESTADOPOL"), "VIGENTE");
//SEND MAIL
try{
ad = ad.getEntitieParam("POLIZA", poliza).get(0);
ad.getData().set(ad.getColums().indexOf("ESTADO"), "3");
ad.getData().set(ad.getColums().indexOf("ESTADOPOL"), "ANULADA");
ad.update(); //ACTUALIZAR LA POLZIA CANCELADA
}catch(IndexOutOfBoundsException s){
s.printStackTrace();
}
Mail mail = new Mail();
String mc= cliente.getDataOfLabel("CORREO");
mc = mc.toLowerCase();
Expand Down Expand Up @@ -217,7 +225,7 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re
out.println("<script type=\"text/javascript\">\n"
+" swal(\n" +
"'Error al renovar!',\n" +
"'Las Polizas "+poliza+" y AD"+idPoliza+" han sido anuladas. Razón: "+messagge+" ',\n" +
"'La Poliza "+poliza+" no ha se ha renovado. Razón: "+messagge+" ',\n" +
"'error'\n" +
")\n"
+ "</script>");
Expand Down

0 comments on commit d0b3325

Please sign in to comment.