PageRenderTime 44ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/src/umsa/capricornio/gui/transacciones/Adquisiciones/tramites/JD_PLAZOS.java

https://gitlab.com/Alexs14/capricornio-re-sabs
Java | 280 lines | 204 code | 31 blank | 45 comment | 4 complexity | 5b4cdf977353641fcf5f7ab84ccd2075 MD5 | raw file
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package umsa.capricornio.gui.transacciones.Adquisiciones.tramites;
  7. import java.util.Map;
  8. import umsa.capricornio.gui.ConnectADQUI.AdquiWSServiceLocator;
  9. import umsa.capricornio.gui.ConnectADQUI.AdquiWS_PortType;
  10. /**
  11. *
  12. * @author Henrry
  13. */
  14. public class JD_PLAZOS extends javax.swing.JDialog {
  15. /**
  16. * Creates new form JD_CONTRATADO
  17. */
  18. private int cod_transaccion;
  19. public JD_PLAZOS(java.awt.Frame parent, boolean modal, int cod_transaccion) {
  20. super(parent, modal);
  21. initComponents();
  22. this.cod_transaccion = cod_transaccion;
  23. this.setLocationRelativeTo(null);
  24. CargaContratado(this.cod_transaccion);
  25. }
  26. private void CargaContratado(int cod_transaccion){
  27. try {
  28. AdquiWSServiceLocator servicio = new AdquiWSServiceLocator();
  29. AdquiWS_PortType puerto = servicio.getAdquiWS();
  30. Map[] datos = puerto.getContratoPlazos(cod_transaccion);
  31. if (datos != null) {
  32. // System.err.println("Con Datos");
  33. this.JTF_PLAZO_PRESTACION.setText(datos[0].get("PLAZO_PRESTACION").toString());
  34. this.JTF_PLAZO_OBSERVACIONES.setText(datos[0].get("PLAZO_OBSERVACIONES").toString());
  35. this.JC_TIPO_PLAZO_PRESTACION.setSelectedIndex(Integer.valueOf(datos[0].get("SW_TIPO_PLAZO_PRESTACION").toString()));
  36. //this.JTF_APROBADO.setText(datos[0].get("APROBADO").toString());
  37. //this.JTF_CARGO.setText(datos[0].get("CARGO").toString());
  38. // this.JTF_DIRECCION_CONTRATADO.setText(datos[0].get("DIR_PROPONENTE_ADJUDICADO").toString());
  39. // this.JTF_DENOMINACION_CONTRATADO.setText(datos[0].get("DENO_PROPONENTE_ADJUDICADO").toString());
  40. }
  41. else
  42. System.err.println("Vacio!!!");
  43. } catch (Exception e) {
  44. System.err.println("Error :O");
  45. }
  46. }
  47. private void GuardaContratado(int cod_transaccion){
  48. try {
  49. AdquiWSServiceLocator servicio = new AdquiWSServiceLocator();
  50. AdquiWS_PortType puerto = servicio.getAdquiWS();
  51. Map[] datos = puerto.updateContratoPlazos(cod_transaccion
  52. ,this.JTF_PLAZO_PRESTACION.getText()
  53. ,this.JTF_PLAZO_OBSERVACIONES.getText()
  54. ,String.valueOf(this.JC_TIPO_PLAZO_PRESTACION.getSelectedIndex())
  55. );
  56. javax.swing.JOptionPane.showMessageDialog(this, "Se actualizo el tramite de forma exitosa!!! ", "SYSTEM CAPRICORN",
  57. javax.swing.JOptionPane.INFORMATION_MESSAGE);
  58. // Map[] datos =null;
  59. // if (datos != null) {
  60. // System.err.println("Con Datos");
  61. // }
  62. // else
  63. // System.err.println("Vacio!!!");
  64. } catch (Exception e) {
  65. javax.swing.JOptionPane.showMessageDialog(this, "<html> error :O <br> " + e, "SYSTEM CAPRICORN",
  66. javax.swing.JOptionPane.ERROR_MESSAGE);
  67. }
  68. }
  69. /**
  70. * This method is called from within the constructor to initialize the form.
  71. * WARNING: Do NOT modify this code. The content of this method is always
  72. * regenerated by the Form Editor.
  73. */
  74. @SuppressWarnings("unchecked")
  75. // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  76. private void initComponents() {
  77. jLabel1 = new javax.swing.JLabel();
  78. jLabel5 = new javax.swing.JLabel();
  79. JTF_PLAZO_PRESTACION = new javax.swing.JTextField();
  80. JTF_PLAZO_OBSERVACIONES = new javax.swing.JTextField();
  81. jPanel1 = new javax.swing.JPanel();
  82. JD_GUARDAR = new javax.swing.JButton();
  83. JD_SALIR = new javax.swing.JButton();
  84. JC_TIPO_PLAZO_PRESTACION = new javax.swing.JComboBox();
  85. JC_TIPO_PLAZO_PRESTACION1 = new javax.swing.JComboBox();
  86. setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
  87. setTitle("PLAZOS");
  88. jLabel1.setText("PLAZO PRESTACION (DIAS):");
  89. jLabel5.setText("PLAZO OBERVACIONES:");
  90. JTF_PLAZO_PRESTACION.addActionListener(new java.awt.event.ActionListener() {
  91. public void actionPerformed(java.awt.event.ActionEvent evt) {
  92. JTF_PLAZO_PRESTACIONActionPerformed(evt);
  93. }
  94. });
  95. JTF_PLAZO_OBSERVACIONES.addActionListener(new java.awt.event.ActionListener() {
  96. public void actionPerformed(java.awt.event.ActionEvent evt) {
  97. JTF_PLAZO_OBSERVACIONESActionPerformed(evt);
  98. }
  99. });
  100. JD_GUARDAR.setIcon(new javax.swing.ImageIcon(getClass().getResource("/umsa/capricornio/gui/images/save_16.png"))); // NOI18N
  101. JD_GUARDAR.setText("Guardar");
  102. JD_GUARDAR.addActionListener(new java.awt.event.ActionListener() {
  103. public void actionPerformed(java.awt.event.ActionEvent evt) {
  104. JD_GUARDARActionPerformed(evt);
  105. }
  106. });
  107. JD_SALIR.setIcon(new javax.swing.ImageIcon(getClass().getResource("/umsa/capricornio/gui/images/book_previous.png"))); // NOI18N
  108. JD_SALIR.setText("SALIR");
  109. JD_SALIR.addActionListener(new java.awt.event.ActionListener() {
  110. public void actionPerformed(java.awt.event.ActionEvent evt) {
  111. JD_SALIRActionPerformed(evt);
  112. }
  113. });
  114. javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
  115. jPanel1.setLayout(jPanel1Layout);
  116. jPanel1Layout.setHorizontalGroup(
  117. jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  118. .addGroup(jPanel1Layout.createSequentialGroup()
  119. .addGap(15, 15, 15)
  120. .addComponent(JD_GUARDAR)
  121. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 18, Short.MAX_VALUE)
  122. .addComponent(JD_SALIR)
  123. .addContainerGap())
  124. );
  125. jPanel1Layout.setVerticalGroup(
  126. jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  127. .addGroup(jPanel1Layout.createSequentialGroup()
  128. .addGap(28, 28, 28)
  129. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  130. .addComponent(JD_GUARDAR)
  131. .addComponent(JD_SALIR))
  132. .addContainerGap(32, Short.MAX_VALUE))
  133. );
  134. JC_TIPO_PLAZO_PRESTACION.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Escoja una opción de Plazo", "A partir de la emisión del orden de proceder", "A partir del desembolso del anticipo", "A partir del dia siguiente habil de la suscripcion del contrato", "En un Rango de Fecha" }));
  135. JC_TIPO_PLAZO_PRESTACION.setMinimumSize(new java.awt.Dimension(320, 26));
  136. JC_TIPO_PLAZO_PRESTACION.setPreferredSize(new java.awt.Dimension(320, 26));
  137. JC_TIPO_PLAZO_PRESTACION1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Escoja una opción de Plazo", "A partir de la suscripcion del presente documento", "En un Rango de fecha" }));
  138. JC_TIPO_PLAZO_PRESTACION1.setMinimumSize(new java.awt.Dimension(320, 26));
  139. JC_TIPO_PLAZO_PRESTACION1.setPreferredSize(new java.awt.Dimension(320, 26));
  140. javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  141. getContentPane().setLayout(layout);
  142. layout.setHorizontalGroup(
  143. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  144. .addGroup(layout.createSequentialGroup()
  145. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  146. .addGroup(layout.createSequentialGroup()
  147. .addGap(31, 31, 31)
  148. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  149. .addComponent(jLabel1)
  150. .addComponent(jLabel5))
  151. .addGap(38, 38, 38)
  152. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  153. .addComponent(JC_TIPO_PLAZO_PRESTACION1, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE)
  154. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
  155. .addComponent(JC_TIPO_PLAZO_PRESTACION, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE)
  156. .addComponent(JTF_PLAZO_PRESTACION)
  157. .addComponent(JTF_PLAZO_OBSERVACIONES, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE))))
  158. .addGroup(layout.createSequentialGroup()
  159. .addGap(156, 156, 156)
  160. .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
  161. .addContainerGap(22, Short.MAX_VALUE))
  162. );
  163. layout.setVerticalGroup(
  164. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  165. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
  166. .addGap(17, 17, 17)
  167. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  168. .addComponent(jLabel1)
  169. .addComponent(JTF_PLAZO_PRESTACION, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  170. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  171. .addComponent(JC_TIPO_PLAZO_PRESTACION, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  172. .addGap(3, 3, 3)
  173. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  174. .addComponent(jLabel5)
  175. .addComponent(JTF_PLAZO_OBSERVACIONES, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  176. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  177. .addComponent(JC_TIPO_PLAZO_PRESTACION1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  178. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  179. .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  180. .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  181. );
  182. pack();
  183. }// </editor-fold>//GEN-END:initComponents
  184. private void JTF_PLAZO_PRESTACIONActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JTF_PLAZO_PRESTACIONActionPerformed
  185. // TODO add your handling code here:
  186. }//GEN-LAST:event_JTF_PLAZO_PRESTACIONActionPerformed
  187. private void JTF_PLAZO_OBSERVACIONESActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JTF_PLAZO_OBSERVACIONESActionPerformed
  188. // TODO add your handling code here:
  189. }//GEN-LAST:event_JTF_PLAZO_OBSERVACIONESActionPerformed
  190. private void JD_GUARDARActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JD_GUARDARActionPerformed
  191. // TODO add your handling code here:
  192. this.GuardaContratado(this.cod_transaccion);
  193. }//GEN-LAST:event_JD_GUARDARActionPerformed
  194. private void JD_SALIRActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JD_SALIRActionPerformed
  195. // TODO add your handling code here:
  196. this.setVisible(false);
  197. }//GEN-LAST:event_JD_SALIRActionPerformed
  198. /**
  199. * @param args the command line arguments
  200. */
  201. public static void main(String args[]) {
  202. /* Set the Nimbus look and feel */
  203. //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
  204. /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
  205. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
  206. */
  207. try {
  208. for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
  209. if ("Nimbus".equals(info.getName())) {
  210. javax.swing.UIManager.setLookAndFeel(info.getClassName());
  211. break;
  212. }
  213. }
  214. } catch (ClassNotFoundException ex) {
  215. java.util.logging.Logger.getLogger(JD_CONTRATADO.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  216. } catch (InstantiationException ex) {
  217. java.util.logging.Logger.getLogger(JD_CONTRATADO.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  218. } catch (IllegalAccessException ex) {
  219. java.util.logging.Logger.getLogger(JD_CONTRATADO.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  220. } catch (javax.swing.UnsupportedLookAndFeelException ex) {
  221. java.util.logging.Logger.getLogger(JD_CONTRATADO.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  222. }
  223. //</editor-fold>
  224. /* Create and display the dialog */
  225. java.awt.EventQueue.invokeLater(new Runnable() {
  226. public void run() {
  227. JD_CONTRATADO dialog = new JD_CONTRATADO(new javax.swing.JFrame(), true,0);
  228. dialog.addWindowListener(new java.awt.event.WindowAdapter() {
  229. @Override
  230. public void windowClosing(java.awt.event.WindowEvent e) {
  231. System.exit(0);
  232. }
  233. });
  234. dialog.setVisible(true);
  235. }
  236. });
  237. }
  238. // Variables declaration - do not modify//GEN-BEGIN:variables
  239. private javax.swing.JComboBox JC_TIPO_PLAZO_PRESTACION;
  240. private javax.swing.JComboBox JC_TIPO_PLAZO_PRESTACION1;
  241. private javax.swing.JButton JD_GUARDAR;
  242. private javax.swing.JButton JD_SALIR;
  243. private javax.swing.JTextField JTF_PLAZO_OBSERVACIONES;
  244. private javax.swing.JTextField JTF_PLAZO_PRESTACION;
  245. private javax.swing.JLabel jLabel1;
  246. private javax.swing.JLabel jLabel5;
  247. private javax.swing.JPanel jPanel1;
  248. // End of variables declaration//GEN-END:variables
  249. }