parroquia 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 034abeb90a83b529921ac35e4635965176123acb22211e88b9916de514b48424
4
+ data.tar.gz: b20e16ace7b4e4647fe69c36d20053d957e05e6d47b52d2c4af250a212070bca
5
+ SHA512:
6
+ metadata.gz: 7888c3b7aac093ec06ec2accac3106388122c58fdfc775db71c3de8911f30b0d59d57a38934c19b3dcba79d9d6e55c8145c7c1191ba290f7d4f5405dc8b1a341
7
+ data.tar.gz: fe9dcb48dcf36674c0229ae09e88afc7fbcd3ced6b6e867e0740731291f41a8c7f1167974c5312dff240df41f684e945f9494656c712fbf9803087b0bd9218df
data/bin/parroquia ADDED
@@ -0,0 +1,3 @@
1
+ require_relative '../lib/parroquia/main'
2
+
3
+ Parroquia::Main.new.start
@@ -0,0 +1,213 @@
1
+ require 'fox16'
2
+ include Fox
3
+
4
+ class ActualizarBautismo < FXMainWindow
5
+ def initialize(app, registro)
6
+ super(app, "Editando Registro", :width => 1050, :height => 600)
7
+ @registro = registro
8
+ # Verifica el type de registro
9
+ puts "Registro: #{registro}"
10
+
11
+ # create label
12
+ @lbltitle = FXLabel.new(self, "Bienvenido a la Parroquia San Judas Tadeo", :opts => LAYOUT_EXPLICIT|JUSTIFY_CENTER_X, :width => 1050, :height => 20, :x => 0, :y => 20)
13
+ # create label
14
+ @lblsubtitle = FXLabel.new(self, "ARQUIDIOSESIS DE QUITO - VICARIA NORTE SERVICIO PARROQUIAL DE SAN JUDAS TADEO", :opts => LAYOUT_EXPLICIT|JUSTIFY_CENTER_X, :width => 1050, :height => 20, :x => 0, :y => 40)
15
+
16
+ #create label
17
+ @date = Time.now.strftime("%d/%m/%Y %H:%M:%S")
18
+ @lbldate = FXLabel.new(self, "Fecha: #{@date}", :opts => LAYOUT_EXPLICIT|JUSTIFY_RIGHT, :width => 1000, :height => 20, :x => 0, :y => 60)
19
+ #section libros
20
+ @lbl_tomo = FXLabel.new(self, "Tomo", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 50, :y => 100)
21
+ # EL input tomoo debe tener el valor del campo "tomo" del registro
22
+ @input_tomo = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 110, :y => 100)
23
+ @input_tomo.text = registro[15]
24
+
25
+ @lbl_page = FXLabel.new(self, "Pagina", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 170, :y => 100)
26
+ @input_page = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 230, :y => 100)
27
+ @input_page.text = registro[16]
28
+ @lbl_number = FXLabel.new(self, "Numero", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 290, :y => 100)
29
+ @input_number = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 350, :y => 100)
30
+ @input_number.text = registro[17]
31
+
32
+ #section datos
33
+ @lbl_fecha = FXLabel.new(self, "Fecha de bautismo (AAAA/MM/DD): ", :opts => LAYOUT_EXPLICIT, :width => 250, :height => 20, :x => 10, :y => 150)
34
+ @input_fecha = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 340, :y => 150)
35
+ @input_fecha.text = registro[2]
36
+ @lbl_sacramento = FXLabel.new(self, "Sacramento: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 680, :y => 150)
37
+ @input_sacramento = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 850, :y => 150)
38
+ @input_sacramento.text = registro[1]
39
+ @lbl_parroquia = FXLabel.new(self, "Iglesia parroquial: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 180)
40
+ @input_parroquia = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 180)
41
+ @input_parroquia.text = registro[25]
42
+ @lbl_sector = FXLabel.new(self, "Sector: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 340, :y => 180)
43
+ @input_sector = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 510, :y => 180)
44
+ @input_sector.text = registro[26]
45
+ @lbl_parroco = FXLabel.new(self, "Parroco: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 680, :y => 180)
46
+ @input_parroco = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 850, :y => 180)
47
+ @input_parroco.text = registro[27]
48
+ @lbl_ministro = FXLabel.new(self, "Ministro: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 210)
49
+ @input_ministro = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 210)
50
+ @input_ministro.text = registro[3]
51
+ @lbl_name = FXLabel.new(self, "Nombres: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 240)
52
+ @input_name = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 240)
53
+ @input_name.text = registro[19]
54
+ @lbl_apellidos = FXLabel.new(self, "Apellidos: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 340, :y => 240)
55
+ @input_apellidos = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 510, :y => 240)
56
+ @input_apellidos.text = registro[20]
57
+ @lbl_cedula = FXLabel.new(self, "Cédula: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 270)
58
+ @input_cedula = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 270)
59
+ @input_cedula.text = registro[23]
60
+ @lbl_lugar_nacimiento = FXLabel.new(self, "Lugar de nacimiento: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 300)
61
+ @input_lugar_nacimiento = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 300)
62
+ @input_lugar_nacimiento.text = registro[21]
63
+ @lbl_fecha_nacimiento = FXLabel.new(self, "Fecha de nacimiento (AAAA/MM/DD): ", :opts => LAYOUT_EXPLICIT, :width => 250, :height => 20, :x => 340, :y => 300)
64
+ @input_fecha_nacimiento = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 590, :y => 300)
65
+ @input_fecha_nacimiento.text = registro[22]
66
+ @lbl_padre = FXLabel.new(self, "Padre: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 330)
67
+ @input_padre = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 330)
68
+ @input_padre.text = registro[9]
69
+ @lbl_madre = FXLabel.new(self, "Madre: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 340, :y => 330)
70
+ @input_madre = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 510, :y => 330)
71
+ @input_madre.text = registro[10]
72
+ @lbl_padrino = FXLabel.new(self, "Padrino: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 360)
73
+ @input_padrino = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 360)
74
+ @input_padrino.text = registro[5]
75
+ @lbl_madrina = FXLabel.new(self, "Madrina: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 340, :y => 360)
76
+ @input_madrina = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 510, :y => 360)
77
+ @input_madrina.text = registro[6]
78
+ @lbl_certifica = FXLabel.new(self, "Certifica: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 390)
79
+ @input_certifica = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 390)
80
+ @input_certifica.text = registro[4]
81
+
82
+ #section registro civil
83
+ @lbl_reg_civ = FXLabel.new(self, "------------------------------------ REGISTRO CIVIL ------------------------------------", :opts => LAYOUT_EXPLICIT|JUSTIFY_CENTER_X, :width => 1050, :height => 20, :x => 10, :y => 420)
84
+ @lbl_provincia_rc = FXLabel.new(self, "Provincia: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 450)
85
+ @input_provincia_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170,:y => 450)
86
+ @input_provincia_rc.text = registro[29]
87
+ @lbl_canton_rc = FXLabel.new(self, "Cantón: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 340, :y => 450)
88
+ @input_canton_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 510, :y =>450)
89
+ @input_canton_rc.text = registro[30]
90
+ @lbl_parroquia_rc = FXLabel.new(self, "Parroquia: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 680, :y => 450)
91
+ @input_parroquia_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 850,:y => 450)
92
+ @input_parroquia_rc.text = registro[31]
93
+ @lbl_anio_rc = FXLabel.new(self, "Año: ", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 50, :y => 480)
94
+ @input_anio_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50,:height => 20, :x => 110,:y => 480)
95
+ @input_anio_rc.text = registro[32]
96
+ @lbl_tomo_rc = FXLabel.new(self, "Tomo: ", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 170, :y => 480)
97
+ @input_tomo_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50,:height => 20, :x => 230,:y => 480)
98
+ @input_tomo_rc.text = registro[33]
99
+ @lbl_pag_rc = FXLabel.new(self, "Página: ", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 290, :y => 480)
100
+ @input_pag_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50,:height => 20, :x => 350,:y => 480)
101
+ @input_pag_rc.text = registro[34]
102
+ @lbl_acta_rc = FXLabel.new(self, "Acta: ", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 410, :y => 480)
103
+ @input_acta_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50,:height => 20, :x => 470,:y => 480)
104
+ @input_acta_rc.text = registro[35]
105
+ @lbl_date_rc = FXLabel.new(self, "Fecha (AAAA/MM/DD): ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 510)
106
+ @input_date_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170,:y => 510)
107
+ @input_date_rc.text = registro[36]
108
+
109
+
110
+ # create buttons
111
+ @btnupdate = FXButton.new(self, "Actualizar", :opts => LAYOUT_EXPLICIT|BUTTON_NORMAL, :width => 100, :height => 30, :x => 790, :y => 540)
112
+ @btncancel = FXButton.new(self, "Cancelar", :opts => LAYOUT_EXPLICIT|BUTTON_NORMAL, :width => 100, :height => 30, :x => 900, :y => 540)
113
+
114
+ # connect buttons
115
+ @btnupdate.connect(SEL_COMMAND) do
116
+ tomo = @input_tomo.text
117
+ page = @input_page.text
118
+ number = @input_number.text
119
+ fecha = @input_fecha.text
120
+ sacramento = @input_sacramento.text
121
+ parroquia = @input_parroquia.text
122
+ sector = @input_sector.text
123
+ parroco = @input_parroco.text
124
+ ministro = @input_ministro.text
125
+ name = @input_name.text
126
+ apellidos = @input_apellidos.text
127
+ lugar_nacimiento = @input_lugar_nacimiento.text
128
+ fecha_nacimiento = @input_fecha_nacimiento.text
129
+ cedula = @input_cedula.text.empty? ? nil : @input_cedula.text
130
+ padrino = @input_padrino.text.empty? ? nil : @input_padrino.text
131
+ madrina = @input_madrina.text.empty? ? nil : @input_madrina.text
132
+ padre = @input_padre.text.empty? ? nil : @input_padre.text
133
+ madre = @input_madre.text.empty? ? nil : @input_madre.text
134
+ certifica = @input_certifica.text
135
+ provincia_rc = @input_provincia_rc.text
136
+ canton_rc = @input_canton_rc.text
137
+ parroquia_rc = @input_parroquia_rc.text
138
+ anio_rc = @input_anio_rc.text
139
+ tomo_rc = @input_tomo_rc.text
140
+ pag_rc = @input_pag_rc.text
141
+ acta_rc = @input_acta_rc.text
142
+ date_rc = @input_date_rc.text
143
+
144
+
145
+ begin
146
+ # tables
147
+ # tabla libros (id, tomo, pagina, numero)
148
+ # tabla creyentes (id, nombres, apellidos, lugar_nacimiento, fecha_nacimiento, cedula)
149
+ # tabla parroquias (id, nombre, sector, parroco)
150
+ # tabla sacramentos (id, nombre, fecha, celebrante, certifica, padrino, madrina, testigo_novio, testigo_novia, padre, madre, nombres_novia, apellidos_novia, cedula_novia, fk_creyentes, fk_parroquias, fk_registros_civiles, fk_libros)
151
+ # tabla registros_civiles (id, provincia_rc, canton_rc, parroquia_rc, anio_rc, tomo_rc, pagina_rc, acta_rc, fecha_rc)
152
+ # Iniciar una transacción
153
+ $conn.transaction do
154
+ $conn.exec('UPDATE libros SET tomo = $1, pagina = $2, numero = $3 WHERE id = $4', [tomo, page, number, registro[14]])
155
+ $conn.exec('UPDATE sacramentos SET fecha = $1, sacramento = $2, celebrante = $3, certifica = $4, padrino = $5, madrina = $6, padre = $7, madre = $8 WHERE id = $9', [fecha, sacramento, ministro, certifica, padrino, madrina, padre, madre, registro[0]])
156
+ $conn.exec('UPDATE creyentes SET nombres = $1, apellidos = $2, lugar_nacimiento = $3, fecha_nacimiento = $4, cedula = $5 WHERE id = $6', [name, apellidos, lugar_nacimiento, fecha_nacimiento, cedula, registro[18]])
157
+ $conn.exec('UPDATE parroquias SET parroquia = $1, sector = $2, parroco = $3 WHERE id = $4', [parroquia, sector, parroco, registro[24]])
158
+ $conn.exec('UPDATE registros_civiles SET provincia_rc = $1, canton_rc = $2, parroquia_rc = $3, anio_rc = $4, tomo_rc = $5, pagina_rc = $6, acta_rc = $7, fecha_rc = $8 WHERE id = $9', [provincia_rc, canton_rc, parroquia_rc, anio_rc, tomo_rc, pag_rc, acta_rc, date_rc, registro[28]])
159
+ # Confirmar la transacción
160
+ $conn.exec("COMMIT")
161
+ FXMessageBox.information(self, MBOX_OK, "Información", "Datos guardados correctamente")
162
+ clear_input_fields
163
+ end
164
+
165
+ rescue PG::Error => e
166
+ FXMessageBox.error(self, MBOX_OK, "Error", "Error al actualizar los datos")
167
+ # Imprimir el error en la consola
168
+ puts e.message
169
+ # Imprimir detalles del error en la consola
170
+ puts e.backtrace.inspect
171
+ end
172
+ end
173
+
174
+ @btncancel.connect(SEL_COMMAND) do
175
+ clear_input_fields
176
+ end
177
+
178
+ def clear_input_fields
179
+ @input_tomo.text = ""
180
+ @input_page.text = ""
181
+ @input_number.text = ""
182
+ @input_fecha.text = ""
183
+ @input_sacramento.text = ""
184
+ @input_parroquia.text = ""
185
+ @input_sector.text = ""
186
+ @input_parroco.text = ""
187
+ @input_ministro.text = ""
188
+ @input_name.text = ""
189
+ @input_apellidos.text = ""
190
+ @input_lugar_nacimiento.text = ""
191
+ @input_fecha_nacimiento.text = ""
192
+ @input_cedula.text = ""
193
+ @input_padrino.text = ""
194
+ @input_madrina.text = ""
195
+ @input_padre.text = ""
196
+ @input_madre.text = ""
197
+ @input_certifica.text = ""
198
+ @input_provincia_rc.text = ""
199
+ @input_canton_rc.text = ""
200
+ @input_parroquia_rc.text = ""
201
+ @input_anio_rc.text = ""
202
+ @input_tomo_rc.text = ""
203
+ @input_pag_rc.text = ""
204
+ @input_acta_rc.text = ""
205
+ @input_date_rc.text = ""
206
+ end
207
+ end
208
+
209
+ def create
210
+ super
211
+ show(PLACEMENT_SCREEN)
212
+ end
213
+ end
@@ -0,0 +1,157 @@
1
+ require 'pg'
2
+ require 'fox16'
3
+ include Fox
4
+
5
+ class ActualizarConfirmacion < FXMainWindow
6
+ def initialize(app, registro)
7
+ @registro = registro
8
+ super(app, "Parroquia San Judas Tadeo", :width => 1050, :height => 450)
9
+ # create label
10
+ @lbltitle = FXLabel.new(self, "Bienvenido a la Parroquia San Judas Tadeo", :opts => LAYOUT_EXPLICIT|JUSTIFY_CENTER_X, :width => 1050, :height => 20, :x => 0, :y => 20)
11
+ # create label
12
+ @lblsubtitle = FXLabel.new(self, "ARQUIDIOSESIS DE QUITO - VICARIA NORTE SERVICIO PARROQUIAL DE SAN JUDAS TADEO", :opts => LAYOUT_EXPLICIT|JUSTIFY_CENTER_X, :width => 1050, :height => 20, :x => 0, :y => 40)
13
+
14
+ #create label
15
+ @date = Time.now.strftime("%d/%m/%Y %H:%M:%S")
16
+ @lbldate = FXLabel.new(self, "Fecha: #{@date}", :opts => LAYOUT_EXPLICIT|JUSTIFY_RIGHT, :width => 1000, :height => 20, :x => 0, :y => 60)
17
+ #section libros
18
+ @lbl_tomo = FXLabel.new(self, "Tomo", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 10, :y => 100)
19
+ @input_tomo = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50,:height => 20, :x => 70, :y => 100)
20
+ @input_tomo.text = @registro[15]
21
+ @lbl_page = FXLabel.new(self, "Página", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 130, :y => 100)
22
+ @input_page = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 190, :y => 100)
23
+ @input_page.text = @registro[16]
24
+ @lbl_number = FXLabel.new(self, "Numero", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 250, :y => 100)
25
+ @input_number = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50,:height => 20, :x => 310, :y => 100)
26
+ @input_number.text = @registro[17]
27
+ #section datos
28
+ @lbl_fecha = FXLabel.new(self, "Fecha de confirmación (AAAA/MM/DD): ", :opts => LAYOUT_EXPLICIT, :width => 250, :height => 20, :x => 10, :y => 150)
29
+ @input_fecha = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 340, :y => 150)
30
+ @input_fecha.text = @registro[2]
31
+ @lbl_sacramento = FXLabel.new(self, "Sacramento: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 680, :y => 150)
32
+ @input_sacramento = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 850, :y => 150)
33
+ @input_sacramento.text = @registro[1]
34
+ @lbl_parroquia = FXLabel.new(self, "Iglesia parroquial: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 180)
35
+ @input_parroquia = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 180)
36
+ @input_parroquia.text = @registro[25]
37
+ @lbl_sector = FXLabel.new(self, "Sector: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 340, :y => 180)
38
+ @input_sector = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 510, :y => 180)
39
+ @input_sector.text = @registro[26]
40
+ @lbl_parroco = FXLabel.new(self, "Parroco: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 680, :y => 180)
41
+ @input_parroco = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 850, :y => 180)
42
+ @input_parroco.text = @registro[27]
43
+ @lbl_celebrante = FXLabel.new(self, "Celebrante: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 210)
44
+ @input_celebrante = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 210)
45
+ @input_celebrante.text = @registro[3]
46
+ @lbl_name = FXLabel.new(self, "Nombres: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 240)
47
+ @input_name = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 240)
48
+ @input_name.text = @registro[19]
49
+ @lbl_apellidos = FXLabel.new(self, "Apellidos: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 270)
50
+ @input_apellidos = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 270)
51
+ @input_apellidos.text = @registro[20]
52
+ @lbl_lugar_nacimiento = FXLabel.new(self, "Lugar de nacimiento: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 300)
53
+ @input_lugar_nacimiento = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 300)
54
+ @input_lugar_nacimiento.text = @registro[21]
55
+ @lbl_fecha_nacimiento = FXLabel.new(self, "Fecha de nacimiento (AAAA/MM/DD): ", :opts => LAYOUT_EXPLICIT, :width => 250, :height => 20, :x => 340, :y => 300)
56
+ @input_fecha_nacimiento = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 590, :y => 300)
57
+ @input_fecha_nacimiento.text = @registro[22]
58
+ @lbl_cedula = FXLabel.new(self, "Cédula: ", :opts => LAYOUT_EXPLICIT, :width => 80, :height => 20, :x => 750, :y => 300)
59
+ @input_cedula = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x =>850, :y => 300)
60
+ @input_cedula.text = @registro[23]
61
+ @lbl_padrino = FXLabel.new(self, "Padrino: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 330)
62
+ @input_padrino = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 330)
63
+ @input_padrino.text = @registro[5]
64
+ @lbl_certifica = FXLabel.new(self, "Certifica: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 360)
65
+ @input_certifica = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 360)
66
+ @input_certifica.text = @registro[4]
67
+ # create buttons
68
+ @btnupdate = FXButton.new(self, "Actualizar", :opts => LAYOUT_EXPLICIT|BUTTON_NORMAL, :width => 100, :height => 30, :x => 790, :y => 400)
69
+ @btncancel = FXButton.new(self, "Cancelar", :opts => LAYOUT_EXPLICIT|BUTTON_NORMAL, :width => 100, :height => 30, :x => 900, :y => 400)
70
+
71
+ # connect buttons
72
+ @btnupdate.connect(SEL_COMMAND) do
73
+ tomo = @input_tomo.text
74
+ page = @input_page.text
75
+ number = @input_number.text
76
+ fecha = @input_fecha.text
77
+ sacramento = @input_sacramento.text
78
+ parroquia = @input_parroquia.text
79
+ sector = @input_sector.text
80
+ parroco = @input_parroco.text
81
+ celebrante = @input_celebrante.text
82
+ name = @input_name.text
83
+ apellidos = @input_apellidos.text
84
+ lugar_nacimiento = @input_lugar_nacimiento.text
85
+ fecha_nacimiento = @input_fecha_nacimiento.text
86
+ cedula = @input_cedula.text.empty? ? nil : @input_cedula.text
87
+ padrino = @input_padrino.text.empty? ? nil : @input_padrino.text
88
+ certifica = @input_certifica.text
89
+
90
+ begin
91
+ # tables
92
+ # tabla libros (id, tomo, pagina, numero)
93
+ # tabla creyentes (id, nombres, apellidos, lugar_nacimiento, fecha_nacimiento, cedula)
94
+ # tabla parroquias (id, nombre, sector, parroco)
95
+ # tabla sacramentos (id, nombre, fecha, celebrante, certifica, padrino, madrina, testigo_novio, testigo_novia, padre, madre, nombres_novia, apellidos_novia, cedula_novia, fk_creyentes, fk_parroquias, fk_registros_civiles, fk_libros)
96
+ # tabla registros_civiles (id, provincia_rc, canton_rc, parroquia_rc, anio_rc, tomo_rc, pagina_rc, acta_rc, fecha_rc)
97
+ # Iniciar una transacción
98
+ $conn.transaction do
99
+ # Actualizar la tabla libros
100
+ $conn.exec('UPDATE libros SET tomo = $1, pagina = $2, numero = $3 WHERE id = $4', [tomo, page, number, registro[14]])
101
+
102
+ # Actualizar la tabla creyentes
103
+ $conn.exec('UPDATE creyentes SET nombres = $1, apellidos = $2, lugar_nacimiento = $3, fecha_nacimiento = $4, cedula = $5 WHERE id = $6', [name, apellidos, lugar_nacimiento, fecha_nacimiento, cedula, registro[18]])
104
+
105
+ # Actualizar la tabla parroquias
106
+ $conn.exec('UPDATE parroquias SET parroquia = $1, sector = $2, parroco = $3 WHERE id = $4', [parroquia, sector, parroco, registro[24]])
107
+
108
+ # Actualizar la tabla registros civiles, si no existen datos se crea un registro nuevo con id que corresponda y se llena los demaás datos con nil
109
+ $conn.exec('UPDATE registros_civiles SET provincia_rc = $1, canton_rc = $2, parroquia_rc = $3, anio_rc = $4, tomo_rc = $5, pagina_rc = $6, acta_rc = $7, fecha_rc = $8 WHERE id = $9', [nil, nil, nil, nil, nil, nil, nil, nil, registro[28]])
110
+
111
+ # Actualizar la tabla sacramentos
112
+ $conn.exec('UPDATE sacramentos SET sacramento = $1, fecha = $2, celebrante = $3, certifica = $4, padrino = $5 WHERE id = $6', [sacramento, fecha, celebrante, certifica, padrino, registro[0]])
113
+
114
+ # Confirmar la transacción
115
+ $conn.exec("COMMIT")
116
+ FXMessageBox.information(self, MBOX_OK, "Información", "Datos actualizados correctamente")
117
+ clear_input_fields
118
+ end
119
+ rescue PG::Error => e
120
+ # En caso de error, se realizará automáticamente un rollback
121
+ FXMessageBox.error(self, MBOX_OK, "Error", "Error al guardar los datos")
122
+ # Imprimir el error en la consola
123
+ puts e.message
124
+ # Imprimir detalles del error en la consola
125
+ puts e.backtrace.inspect
126
+ end
127
+ end
128
+
129
+ @btncancel.connect(SEL_COMMAND) do
130
+ clear_input_fields
131
+ end
132
+
133
+ def clear_input_fields
134
+ @input_tomo.text = ""
135
+ @input_page.text = ""
136
+ @input_number.text = ""
137
+ @input_fecha.text = ""
138
+ @input_sacramento.text = ""
139
+ @input_parroquia.text = ""
140
+ @input_sector.text = ""
141
+ @input_parroco.text = ""
142
+ @input_celebrante.text = ""
143
+ @input_name.text = ""
144
+ @input_apellidos.text = ""
145
+ @input_lugar_nacimiento.text = ""
146
+ @input_fecha_nacimiento.text = ""
147
+ @input_cedula.text = ""
148
+ @input_padrino.text = ""
149
+ @input_certifica.text = ""
150
+ end
151
+ end
152
+
153
+ def create
154
+ super
155
+ show(PLACEMENT_SCREEN)
156
+ end
157
+ end
@@ -0,0 +1,196 @@
1
+ require 'fox16'
2
+ include Fox
3
+
4
+ class ActualizarMatrimonio < FXMainWindow
5
+ def initialize(app, registro)
6
+ @registro = registro
7
+ super(app, "Parroquia San Judas Tadeo", :width => 1050, :height => 530)
8
+ # create label
9
+ @lbltitle = FXLabel.new(self, "Bienvenido a la Parroquia San Judas Tadeo", :opts => LAYOUT_EXPLICIT|JUSTIFY_CENTER_X, :width => 1050, :height => 20, :x => 0, :y => 20)
10
+ # create label
11
+ @lblsubtitle = FXLabel.new(self, "ARQUIDIOSESIS DE QUITO - VICARIA NORTE SERVICIO PARROQUIAL DE SAN JUDAS TADEO", :opts => LAYOUT_EXPLICIT|JUSTIFY_CENTER_X, :width => 1050, :height => 20, :x => 0, :y => 40)
12
+
13
+ #create label
14
+ @date = Time.now.strftime("%d/%m/%Y %H:%M:%S")
15
+ @lbldate = FXLabel.new(self, "Fecha: #{@date}", :opts => LAYOUT_EXPLICIT|JUSTIFY_RIGHT, :width => 1000, :height => 20, :x => 0, :y => 60)
16
+ #section libros
17
+ @lbl_tomo = FXLabel.new(self, "Tomo", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 50, :y => 100)
18
+ @input_tomo = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 110, :y => 100)
19
+ @input_tomo.text = @registro[15]
20
+ @lbl_page = FXLabel.new(self, "Pagina", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 170, :y => 100)
21
+ @input_page = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 230, :y => 100)
22
+ @input_page.text = @registro[16]
23
+ @lbl_number = FXLabel.new(self, "Numero", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 290, :y => 100)
24
+ @input_number = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 350, :y => 100)
25
+ @input_number.text = @registro[17]
26
+ #section datos
27
+ @lbl_fecha = FXLabel.new(self, "Fecha de matrimonio (AAAA/MM/DD): ", :opts => LAYOUT_EXPLICIT, :width => 250, :height => 20, :x => 10, :y => 150)
28
+ @input_fecha = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 340, :y => 150)
29
+ @input_fecha.text = @registro[2]
30
+ @lbl_sacramento = FXLabel.new(self, "Sacramento: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 680, :y => 150)
31
+ @input_sacramento = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 850, :y => 150)
32
+ @input_sacramento.text = @registro[1]
33
+ @lbl_parroquia = FXLabel.new(self, "Iglesia parroquial: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 180)
34
+ @input_parroquia = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 180)
35
+ @input_parroquia.text = @registro[25]
36
+ @lbl_sector = FXLabel.new(self, "Sector: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 340, :y => 180)
37
+ @input_sector = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 510, :y => 180)
38
+ @input_sector.text = @registro[26]
39
+ @lbl_parroco = FXLabel.new(self, "Parroco: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 680, :y => 180)
40
+ @input_parroco = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 850, :y => 180)
41
+ @input_parroco.text = @registro[27]
42
+ @lbl_celebrante = FXLabel.new(self, "Celebrante: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 210)
43
+ @input_celebrante = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 210)
44
+ @input_celebrante.text = @registro[3]
45
+ @lbl_name_novio = FXLabel.new(self, "Nombres del novio: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 240)
46
+ @input_name_novio = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 240)
47
+ @input_name_novio.text = @registro[19]
48
+ @lbl_apellido_novio = FXLabel.new(self, "Apellidos del novio: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 340, :y => 240)
49
+ @input_apellido_novio = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 510, :y => 240)
50
+ @input_apellido_novio.text = @registro[20]
51
+ @lbl_cedula_novio = FXLabel.new(self, "Cédula del novio: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 680, :y => 240)
52
+ @input_cedula_novio = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 850, :y => 240)
53
+ @input_cedula_novio.text = @registro[23]
54
+ @lbl_name_novia = FXLabel.new(self, "Nombres de la novia: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 270)
55
+ @input_name_novia = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 270)
56
+ @input_name_novia.text = @registro[11]
57
+ @lbl_apellido_novia = FXLabel.new(self, "Apellidos de la novia: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 340, :y => 270)
58
+ @input_apellido_novia = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 510, :y => 270)
59
+ @input_apellido_novia.text = @registro[12]
60
+ @lbl_cedula_novia = FXLabel.new(self, "Cédula de la novia: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 680, :y => 270)
61
+ @input_cedula_novia = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 850, :y => 270)
62
+ @input_cedula_novia.text = @registro[13]
63
+ @lbl_testigo_novio = FXLabel.new(self, "Testigo del novio: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 300)
64
+ @input_nombres_testigo_novio = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 300)
65
+ @input_nombres_testigo_novio.text = @registro[7]
66
+ @lbl_testigo_novia = FXLabel.new(self, "Testigo novia: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 340, :y => 300)
67
+ @input_nombres_testigo_novia = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 510, :y => 300)
68
+ @input_nombres_testigo_novia.text = @registro[8]
69
+ @lbl_certifica = FXLabel.new(self, "Certifica: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 680, :y => 300)
70
+ @input_certifica = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 850, :y => 300)
71
+ @input_certifica.text = @registro[4]
72
+ #section registro civil
73
+ @lbl_reg_civ = FXLabel.new(self, "------------------------------------ REGISTRO CIVIL ------------------------------------", :opts => LAYOUT_EXPLICIT|JUSTIFY_CENTER_X, :width => 1050, :height => 20, :x => 10, :y => 330)
74
+ @lbl_provincia_rc = FXLabel.new(self, "Provincia: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 360)
75
+ @input_provincia_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170,:y => 360)
76
+ @input_provincia_rc.text = @registro[29]
77
+ @lbl_canton_rc = FXLabel.new(self, "Cantón: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 340, :y => 360)
78
+ @input_canton_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 510, :y =>360)
79
+ @input_canton_rc.text = @registro[30]
80
+ @lbl_parroquia_rc = FXLabel.new(self, "Parroquia: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 680, :y => 360)
81
+ @input_parroquia_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 850,:y => 360)
82
+ @input_parroquia_rc.text = @registro[31]
83
+ @lbl_anio_rc = FXLabel.new(self, "Año: ", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 50, :y => 390)
84
+ @input_anio_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50,:height => 20, :x => 110,:y => 390)
85
+ @input_anio_rc.text = @registro[32]
86
+ @lbl_tomo_rc = FXLabel.new(self, "Tomo: ", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 170, :y => 390)
87
+ @input_tomo_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50,:height => 20, :x => 230,:y => 390)
88
+ @input_tomo_rc.text = @registro[33]
89
+ @lbl_pag_rc = FXLabel.new(self, "Página: ", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 290, :y => 390)
90
+ @input_pag_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50,:height => 20, :x => 350,:y => 390)
91
+ @input_pag_rc.text = @registro[34]
92
+ @lbl_acta_rc = FXLabel.new(self, "Acta: ", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 410, :y => 390)
93
+ @input_acta_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50,:height => 20, :x => 470,:y => 390)
94
+ @input_acta_rc.text = @registro[35]
95
+ @lbl_date_rc = FXLabel.new(self, "Fecha (AAAA/MM/DD): ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 420)
96
+ @input_date_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170,:y => 420)
97
+ @input_date_rc.text = @registro[36]
98
+
99
+ # create buttons
100
+ @btnupdate = FXButton.new(self, "Actualizar", :opts => LAYOUT_EXPLICIT|BUTTON_NORMAL, :width => 100, :height => 30, :x => 790, :y => 480)
101
+ @btncancel = FXButton.new(self, "Cancelar", :opts => LAYOUT_EXPLICIT|BUTTON_NORMAL, :width => 100, :height => 30, :x => 900, :y => 480)
102
+
103
+ # connect buttons
104
+ @btnupdate.connect(SEL_COMMAND) do
105
+ tomo = @input_tomo.text
106
+ page = @input_page.text
107
+ number = @input_number.text
108
+ fecha = @input_fecha.text
109
+ sacramento = @input_sacramento.text
110
+ parroquia = @input_parroquia.text
111
+ sector = @input_sector.text
112
+ parroco = @input_parroco.text
113
+ celebrante = @input_celebrante.text
114
+ name_novio = @input_name_novio.text
115
+ apellido_novio = @input_apellido_novio.text
116
+ cedula_novio = @input_cedula_novio.text.empty? ? nil : @input_cedula_novio.text
117
+ nombres_novia = @input_name_novia.text.empty? ? nil : @input_name_novia.text
118
+ apellidos_novia = @input_apellido_novia.text.empty? ? nil : @input_apellido_novia.text
119
+ cedula_novia = @input_cedula_novia.text.empty? ? nil : @input_cedula_novia.text
120
+ testigo_novio = @input_nombres_testigo_novio.text.empty? ? nil : @input_nombres_testigo_novio.text
121
+ testigo_novia = @input_nombres_testigo_novia.text.empty? ? nil : @input_nombres_testigo_novia.text
122
+ certifica = @input_certifica.text
123
+ provincia_rc = @input_provincia_rc.text
124
+ canton_rc = @input_canton_rc.text
125
+ parroquia_rc = @input_parroquia_rc.text
126
+ anio_rc = @input_anio_rc.text
127
+ tomo_rc = @input_tomo_rc.text
128
+ pagina_rc = @input_pag_rc.text
129
+ acta_rc = @input_acta_rc.text
130
+ fecha_rc = @input_date_rc.text
131
+
132
+ begin
133
+ # tables
134
+ # tabla libros (id, tomo, pagina, numero)
135
+ # tabla creyentes (id, nombres, apellidos, lugar_nacimiento, fecha_nacimiento, cedula)
136
+ # tabla parroquias (id, nombre, sector, parroco)
137
+ # tabla sacramentos (id, nombre, fecha, celebrante, certifica, padrino, madrina, testigo_novio, testigo_novia, padre, madre, nombres_novia, apellidos_novia, cedula_novia, fk_creyentes, fk_parroquias, fk_registros_civiles, fk_libros)
138
+ # tabla registros_civiles (id, provincia_rc, canton_rc, parroquia_rc, anio_rc, tomo_rc, pagina_rc, acta_rc, fecha_rc)
139
+ $conn.transaction do
140
+ $conn.exec('UPDATE libros SET tomo = $1, pagina = $2, numero = $3 WHERE id = $4', [tomo, page, number, registro[14]])
141
+ $conn.exec('UPDATE sacramentos SET sacramento = $1, fecha = $2, celebrante = $3, certifica = $4, testigo_novio = $5, testigo_novia = $6, nombres_novia = $7, apellidos_novia = $8, cedula_novia = $9 WHERE id = $10', [sacramento, fecha, celebrante, certifica, testigo_novio, testigo_novia, nombres_novia, apellidos_novia, cedula_novia, registro[0]])
142
+ $conn.exec('UPDATE creyentes SET nombres = $1, apellidos = $2, cedula = $3 WHERE id = $4', [name_novio, apellido_novio, cedula_novio, registro[18]])
143
+ $conn.exec('UPDATE parroquias SET parroquia = $1, sector = $2, parroco = $3 WHERE id = $4', [parroquia, sector, parroco, registro[24]])
144
+ $conn.exec('UPDATE registros_civiles SET provincia_rc = $1, canton_rc = $2, parroquia_rc = $3, anio_rc = $4, tomo_rc = $5, pagina_rc = $6, acta_rc = $7, fecha_rc = $8 WHERE id = $9', [provincia_rc, canton_rc, parroquia_rc, anio_rc, tomo_rc, pagina_rc, acta_rc, fecha_rc, registro[28]])
145
+ $conn.exec("COMMIT")
146
+ FXMessageBox.information(self, MBOX_OK, "Información", "Datos actualizados correctamente")
147
+ clear_input_fields
148
+ end
149
+ rescue PG::Error => e
150
+ FXMessageBox.error(self, MBOX_OK, "Error", "Error al guardar los datos")
151
+ # Imprimir el error en la consola
152
+ puts e.message
153
+ # Imprimir detalles del error en la consola
154
+ puts e.backtrace.inspect
155
+ end
156
+ end
157
+
158
+ @btncancel.connect(SEL_COMMAND) do
159
+ clear_input_fields
160
+ end
161
+
162
+ def clear_input_fields
163
+ @input_tomo.text = ""
164
+ @input_page.text = ""
165
+ @input_number.text = ""
166
+ @input_fecha.text = ""
167
+ @input_sacramento.text = ""
168
+ @input_parroquia.text = ""
169
+ @input_sector.text = ""
170
+ @input_parroco.text = ""
171
+ @input_celebrante.text = ""
172
+ @input_name_novio.text = ""
173
+ @input_apellido_novio.text = ""
174
+ @input_cedula_novio.text = ""
175
+ @input_name_novia.text = ""
176
+ @input_apellido_novia.text = ""
177
+ @input_cedula_novia.text = ""
178
+ @input_nombres_testigo_novio.text = ""
179
+ @input_nombres_testigo_novia.text = ""
180
+ @input_certifica.text = ""
181
+ @input_provincia_rc.text = ""
182
+ @input_canton_rc.text = ""
183
+ @input_parroquia_rc.text = ""
184
+ @input_anio_rc.text = ""
185
+ @input_tomo_rc.text = ""
186
+ @input_pag_rc.text = ""
187
+ @input_acta_rc.text = ""
188
+ @input_date_rc.text = ""
189
+ end
190
+ end
191
+
192
+ def create
193
+ super
194
+ show(PLACEMENT_SCREEN)
195
+ end
196
+ end