parroquia 1.1.0 → 1.1.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 +4 -4
- data/lib/parroquia/actualizar_bautismo.rb +74 -11
- data/lib/parroquia/actualizar_confirmacion.rb +72 -16
- data/lib/parroquia/actualizar_matrimonio.rb +78 -11
- data/lib/parroquia/assets/images/Logo-SJT.png +0 -0
- data/lib/parroquia/bautizo.rb +82 -13
- data/lib/parroquia/confirmacion.rb +75 -18
- data/lib/parroquia/consultas.rb +49 -4
- data/lib/parroquia/main.rb +73 -24
- data/lib/parroquia/matrimonio.rb +79 -12
- data/lib/parroquia/resultados.rb +1 -1
- metadata +1 -1
data/lib/parroquia/bautizo.rb
CHANGED
@@ -4,73 +4,113 @@ include Fox
|
|
4
4
|
class Bautizo < FXMainWindow
|
5
5
|
def initialize(app)
|
6
6
|
super(app, "Parroquia San Judas Tadeo", :width => 1050, :height => 600)
|
7
|
+
self.backColor = FXRGB(3,187,133)
|
7
8
|
# create label
|
9
|
+
# Title
|
8
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)
|
9
|
-
|
10
|
-
@
|
11
|
-
|
12
|
-
|
13
|
-
@
|
14
|
-
@
|
15
|
-
#
|
11
|
+
@lbltitle.font = FXFont.new(app, "Geneva", 16, FONTWEIGHT_BOLD)
|
12
|
+
@lbltitle.backColor = FXRGB(3,187,133)
|
13
|
+
# Subtitle
|
14
|
+
@lblsubtitle = FXLabel.new(self, "ARQUIDIOSESIS DE QUITO - SERVICIO PARROQUIAL DE SAN JUDAS TADEO", :opts => LAYOUT_EXPLICIT|JUSTIFY_CENTER_X, :width => 1050, :height => 20, :x => 0, :y => 40)
|
15
|
+
@lblsubtitle.font = FXFont.new(app, "Geneva", 10, FONTWEIGHT_BOLD)
|
16
|
+
@lblsubtitle.backColor = FXRGB(3,187,133)
|
17
|
+
# Date
|
18
|
+
@date = Time.now.strftime("%d/%m/%Y")
|
19
|
+
@lbldate = FXLabel.new(self, "Fecha: #{cambiar_formato_fecha(@date)}", :opts => LAYOUT_EXPLICIT|JUSTIFY_RIGHT, :width => 1050, :height => 20, :x => 0, :y => 60, :padRight => 20)
|
20
|
+
@lbldate.font = FXFont.new(app, "Geneva", 12, FONTWEIGHT_BOLD)
|
21
|
+
@lbldate.backColor = FXRGB(3,187,133)
|
22
|
+
# section libros
|
16
23
|
@lbl_tomo = FXLabel.new(self, "Tomo", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 50, :y => 100)
|
24
|
+
@lbl_tomo.backColor = FXRGB(3,187,133)
|
17
25
|
@input_tomo = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 110, :y => 100)
|
18
26
|
@lbl_page = FXLabel.new(self, "Pagina", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 170, :y => 100)
|
27
|
+
@lbl_page.backColor = FXRGB(3,187,133)
|
19
28
|
@input_page = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 230, :y => 100)
|
20
29
|
@lbl_number = FXLabel.new(self, "Numero", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 290, :y => 100)
|
30
|
+
@lbl_number.backColor = FXRGB(3,187,133)
|
21
31
|
@input_number = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 350, :y => 100)
|
22
32
|
|
23
|
-
#section datos
|
33
|
+
# section datos
|
24
34
|
@lbl_fecha = FXLabel.new(self, "Fecha de bautismo (AAAA/MM/DD): ", :opts => LAYOUT_EXPLICIT, :width => 250, :height => 20, :x => 10, :y => 150)
|
35
|
+
@lbl_fecha.backColor = FXRGB(3,187,133)
|
25
36
|
@input_fecha = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 340, :y => 150)
|
26
37
|
@lbl_sacramento = FXLabel.new(self, "Sacramento: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 680, :y => 150)
|
38
|
+
@lbl_sacramento.backColor = FXRGB(3,187,133)
|
27
39
|
@input_sacramento = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 850, :y => 150)
|
40
|
+
@input_sacramento.text = "Bautismo"
|
41
|
+
@input_sacramento.disable
|
28
42
|
@lbl_parroquia = FXLabel.new(self, "Iglesia parroquial: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 180)
|
43
|
+
@lbl_parroquia.backColor = FXRGB(3,187,133)
|
29
44
|
@input_parroquia = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 180)
|
45
|
+
@input_parroquia.text = "San Judas Tadeo"
|
46
|
+
@input_parroquia.disable
|
30
47
|
@lbl_sector = FXLabel.new(self, "Sector: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 340, :y => 180)
|
48
|
+
@lbl_sector.backColor = FXRGB(3,187,133)
|
31
49
|
@input_sector = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 510, :y => 180)
|
50
|
+
@input_sector.text = "La Roldós"
|
32
51
|
@lbl_parroco = FXLabel.new(self, "Parroco: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 680, :y => 180)
|
52
|
+
@lbl_parroco.backColor = FXRGB(3,187,133)
|
33
53
|
@input_parroco = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 850, :y => 180)
|
34
54
|
@lbl_ministro = FXLabel.new(self, "Ministro: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 210)
|
55
|
+
@lbl_ministro.backColor = FXRGB(3,187,133)
|
35
56
|
@input_ministro = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 210)
|
36
57
|
@lbl_name = FXLabel.new(self, "Nombres: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 240)
|
58
|
+
@lbl_name.backColor = FXRGB(3,187,133)
|
37
59
|
@input_name = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 240)
|
38
60
|
@lbl_apellidos = FXLabel.new(self, "Apellidos: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 340, :y => 240)
|
61
|
+
@lbl_apellidos.backColor = FXRGB(3,187,133)
|
39
62
|
@input_apellidos = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 510, :y => 240)
|
40
63
|
@lbl_cedula = FXLabel.new(self, "Cédula: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 270)
|
64
|
+
@lbl_cedula.backColor = FXRGB(3,187,133)
|
41
65
|
@input_cedula = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 270)
|
42
66
|
@lbl_lugar_nacimiento = FXLabel.new(self, "Lugar de nacimiento: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 300)
|
67
|
+
@lbl_lugar_nacimiento.backColor = FXRGB(3,187,133)
|
43
68
|
@input_lugar_nacimiento = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 300)
|
44
69
|
@lbl_fecha_nacimiento = FXLabel.new(self, "Fecha de nacimiento (AAAA/MM/DD): ", :opts => LAYOUT_EXPLICIT, :width => 250, :height => 20, :x => 340, :y => 300)
|
70
|
+
@lbl_fecha_nacimiento.backColor = FXRGB(3,187,133)
|
45
71
|
@input_fecha_nacimiento = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 590, :y => 300)
|
46
72
|
@lbl_padre = FXLabel.new(self, "Padre: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 330)
|
73
|
+
@lbl_padre.backColor = FXRGB(3,187,133)
|
47
74
|
@input_padre = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 330)
|
48
75
|
@lbl_madre = FXLabel.new(self, "Madre: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 340, :y => 330)
|
76
|
+
@lbl_madre.backColor = FXRGB(3,187,133)
|
49
77
|
@input_madre = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 510, :y => 330)
|
50
78
|
@lbl_padrino = FXLabel.new(self, "Padrino: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 360)
|
79
|
+
@lbl_padrino.backColor = FXRGB(3,187,133)
|
51
80
|
@input_padrino = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 360)
|
52
81
|
@lbl_madrina = FXLabel.new(self, "Madrina: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 340, :y => 360)
|
82
|
+
@lbl_madrina.backColor = FXRGB(3,187,133)
|
53
83
|
@input_madrina = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 510, :y => 360)
|
54
84
|
@lbl_certifica = FXLabel.new(self, "Certifica: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 390)
|
85
|
+
@lbl_certifica.backColor = FXRGB(3,187,133)
|
55
86
|
@input_certifica = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 390)
|
56
87
|
|
57
|
-
#section registro civil
|
88
|
+
# section registro civil
|
58
89
|
@lbl_reg_civ = FXLabel.new(self, "------------------------------------ REGISTRO CIVIL ------------------------------------", :opts => LAYOUT_EXPLICIT|JUSTIFY_CENTER_X, :width => 1050, :height => 20, :x => 10, :y => 420)
|
90
|
+
@lbl_reg_civ.backColor = FXRGB(3,187,133)
|
59
91
|
@lbl_provincia_rc = FXLabel.new(self, "Provincia: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 450)
|
92
|
+
@lbl_provincia_rc.backColor = FXRGB(3,187,133)
|
60
93
|
@input_provincia_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170,:y => 450)
|
61
94
|
@lbl_canton_rc = FXLabel.new(self, "Cantón: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 340, :y => 450)
|
95
|
+
@lbl_canton_rc.backColor = FXRGB(3,187,133)
|
62
96
|
@input_canton_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 510, :y =>450)
|
63
97
|
@lbl_parroquia_rc = FXLabel.new(self, "Parroquia: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 680, :y => 450)
|
98
|
+
@lbl_parroquia_rc.backColor = FXRGB(3,187,133)
|
64
99
|
@input_parroquia_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 850,:y => 450)
|
65
100
|
@lbl_anio_rc = FXLabel.new(self, "Año: ", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 50, :y => 480)
|
101
|
+
@lbl_anio_rc.backColor = FXRGB(3,187,133)
|
66
102
|
@input_anio_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50,:height => 20, :x => 110,:y => 480)
|
67
103
|
@lbl_tomo_rc = FXLabel.new(self, "Tomo: ", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 170, :y => 480)
|
104
|
+
@lbl_tomo_rc.backColor = FXRGB(3,187,133)
|
68
105
|
@input_tomo_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50,:height => 20, :x => 230,:y => 480)
|
69
106
|
@lbl_pag_rc = FXLabel.new(self, "Página: ", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 290, :y => 480)
|
107
|
+
@lbl_pag_rc.backColor = FXRGB(3,187,133)
|
70
108
|
@input_pag_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50,:height => 20, :x => 350,:y => 480)
|
71
109
|
@lbl_acta_rc = FXLabel.new(self, "Acta: ", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 410, :y => 480)
|
110
|
+
@lbl_acta_rc.backColor = FXRGB(3,187,133)
|
72
111
|
@input_acta_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50,:height => 20, :x => 470,:y => 480)
|
73
112
|
@lbl_date_rc = FXLabel.new(self, "Fecha (AAAA/MM/DD): ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 510)
|
113
|
+
@lbl_date_rc.backColor = FXRGB(3,187,133)
|
74
114
|
@input_date_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170,:y => 510)
|
75
115
|
|
76
116
|
|
@@ -128,8 +168,8 @@ class Bautizo < FXMainWindow
|
|
128
168
|
FXMessageBox.information(self, MBOX_OK, "Información", "Datos guardados correctamente")
|
129
169
|
clear_input_fields
|
130
170
|
end
|
131
|
-
|
132
171
|
rescue PG::Error => e
|
172
|
+
$conn.exec("ROLLBACK")
|
133
173
|
FXMessageBox.error(self, MBOX_OK, "Error", "Error al guardar los datos")
|
134
174
|
# Imprimir el error en la consola
|
135
175
|
puts e.message
|
@@ -147,9 +187,6 @@ class Bautizo < FXMainWindow
|
|
147
187
|
@input_page.text = ""
|
148
188
|
@input_number.text = ""
|
149
189
|
@input_fecha.text = ""
|
150
|
-
@input_sacramento.text = ""
|
151
|
-
@input_parroquia.text = ""
|
152
|
-
@input_sector.text = ""
|
153
190
|
@input_parroco.text = ""
|
154
191
|
@input_ministro.text = ""
|
155
192
|
@input_name.text = ""
|
@@ -173,6 +210,38 @@ class Bautizo < FXMainWindow
|
|
173
210
|
end
|
174
211
|
end
|
175
212
|
|
213
|
+
# Nombre del mes
|
214
|
+
def nombre_mes(mes)
|
215
|
+
meses = {
|
216
|
+
"01" => "enero",
|
217
|
+
"02" => "febrero",
|
218
|
+
"03" => "marzo",
|
219
|
+
"04" => "abril",
|
220
|
+
"05" => "mayo",
|
221
|
+
"06" => "junio",
|
222
|
+
"07" => "julio",
|
223
|
+
"08" => "agosto",
|
224
|
+
"09" => "septiembre",
|
225
|
+
"10" => "octubre",
|
226
|
+
"11" => "noviembre",
|
227
|
+
"12" => "diciembre"
|
228
|
+
}
|
229
|
+
meses[mes]
|
230
|
+
end
|
231
|
+
|
232
|
+
|
233
|
+
# Cambiar el formato de la fecga de YYYY-MM-DD a DD de nombre_mes de YYYY
|
234
|
+
def cambiar_formato_fecha(fecha)
|
235
|
+
# split "-" or "/"
|
236
|
+
fecha = fecha.split(/-|\//)
|
237
|
+
# si el formato de fecha es YYYY-MM-DD o YYYY/MM/DD, sino si es DD-MM-YYYY o DD/MM/YYYY
|
238
|
+
if fecha[0].length == 4
|
239
|
+
"#{fecha[2]} de #{nombre_mes(fecha[1])} de #{fecha[0]}"
|
240
|
+
else
|
241
|
+
"#{fecha[0]} de #{nombre_mes(fecha[1])} de #{fecha[2]}"
|
242
|
+
end
|
243
|
+
end
|
244
|
+
|
176
245
|
def create
|
177
246
|
super
|
178
247
|
show(PLACEMENT_SCREEN)
|
@@ -6,50 +6,77 @@ class Confirmacion < FXMainWindow
|
|
6
6
|
def initialize(app)
|
7
7
|
@app = app
|
8
8
|
super(app, "Parroquia San Judas Tadeo", :width => 1050, :height => 450)
|
9
|
-
|
9
|
+
self.backColor = FXRGB(3,187,133)
|
10
|
+
# Title
|
10
11
|
@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
|
-
|
12
|
-
@
|
13
|
-
|
14
|
-
|
15
|
-
@
|
16
|
-
@
|
17
|
-
#
|
18
|
-
@
|
19
|
-
@
|
20
|
-
@
|
21
|
-
@
|
22
|
-
|
23
|
-
@
|
12
|
+
@lbltitle.font = FXFont.new(app, "Geneva", 16, FONTWEIGHT_BOLD)
|
13
|
+
@lbltitle.backColor = FXRGB(3,187,133)
|
14
|
+
# Subtitle
|
15
|
+
@lblsubtitle = FXLabel.new(self, "ARQUIDIOSESIS DE QUITO - SERVICIO PARROQUIAL DE SAN JUDAS TADEO", :opts => LAYOUT_EXPLICIT|JUSTIFY_CENTER_X, :width => 1050, :height => 20, :x => 0, :y => 40)
|
16
|
+
@lblsubtitle.font = FXFont.new(app, "Geneva", 10, FONTWEIGHT_BOLD)
|
17
|
+
@lblsubtitle.backColor = FXRGB(3,187,133)
|
18
|
+
# Date
|
19
|
+
@date = Time.now.strftime("%d/%m/%Y")
|
20
|
+
@lbldate = FXLabel.new(self, "Fecha: #{cambiar_formato_fecha(@date)}", :opts => LAYOUT_EXPLICIT|JUSTIFY_RIGHT, :width => 1050, :height => 20, :x => 0, :y => 60, :padRight => 20)
|
21
|
+
@lbldate.font = FXFont.new(app, "Geneva", 12, FONTWEIGHT_BOLD)
|
22
|
+
@lbldate.backColor = FXRGB(3,187,133)
|
23
|
+
# section libros
|
24
|
+
@lbl_tomo = FXLabel.new(self, "Tomo", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 50, :y => 100)
|
25
|
+
@lbl_tomo.backColor = FXRGB(3,187,133)
|
26
|
+
@input_tomo = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 110, :y => 100)
|
27
|
+
@lbl_page = FXLabel.new(self, "Pagina", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 170, :y => 100)
|
28
|
+
@lbl_page.backColor = FXRGB(3,187,133)
|
29
|
+
@input_page = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 230, :y => 100)
|
30
|
+
@lbl_number = FXLabel.new(self, "Numero", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 290, :y => 100)
|
31
|
+
@lbl_number.backColor = FXRGB(3,187,133)
|
32
|
+
@input_number = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 350, :y => 100)
|
24
33
|
|
25
34
|
#section datos
|
26
35
|
@lbl_fecha = FXLabel.new(self, "Fecha de confirmación (AAAA/MM/DD): ", :opts => LAYOUT_EXPLICIT, :width => 250, :height => 20, :x => 10, :y => 150)
|
36
|
+
@lbl_fecha.backColor = FXRGB(3,187,133)
|
27
37
|
@input_fecha = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 340, :y => 150)
|
28
38
|
@lbl_sacramento = FXLabel.new(self, "Sacramento: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 680, :y => 150)
|
39
|
+
@lbl_sacramento.backColor = FXRGB(3,187,133)
|
29
40
|
@input_sacramento = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 850, :y => 150)
|
41
|
+
@input_sacramento.text = "Confirmación"
|
42
|
+
@input_sacramento.disable
|
30
43
|
@lbl_parroquia = FXLabel.new(self, "Iglesia parroquial: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 180)
|
44
|
+
@lbl_parroquia.backColor = FXRGB(3,187,133)
|
31
45
|
@input_parroquia = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 180)
|
46
|
+
@input_parroquia.text = "San Judas Tadeo"
|
47
|
+
@input_parroquia.disable
|
32
48
|
@lbl_sector = FXLabel.new(self, "Sector: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 340, :y => 180)
|
49
|
+
@lbl_sector.backColor = FXRGB(3,187,133)
|
33
50
|
@input_sector = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 510, :y => 180)
|
51
|
+
@input_sector.text = "La Roldós"
|
52
|
+
@input_sector.disable
|
34
53
|
@lbl_parroco = FXLabel.new(self, "Parroco: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 680, :y => 180)
|
54
|
+
@lbl_parroco.backColor = FXRGB(3,187,133)
|
35
55
|
@input_parroco = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 850, :y => 180)
|
36
56
|
@lbl_celebrante = FXLabel.new(self, "Celebrante: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 210)
|
57
|
+
@lbl_celebrante.backColor = FXRGB(3,187,133)
|
37
58
|
@input_celebrante = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 210)
|
38
59
|
@lbl_name = FXLabel.new(self, "Nombres: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 240)
|
60
|
+
@lbl_name.backColor = FXRGB(3,187,133)
|
39
61
|
@input_name = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 240)
|
40
62
|
@lbl_apellidos = FXLabel.new(self, "Apellidos: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 270)
|
63
|
+
@lbl_apellidos.backColor = FXRGB(3,187,133)
|
41
64
|
@input_apellidos = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 270)
|
42
65
|
@lbl_lugar_nacimiento = FXLabel.new(self, "Lugar de nacimiento: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 300)
|
66
|
+
@lbl_lugar_nacimiento.backColor = FXRGB(3,187,133)
|
43
67
|
@input_lugar_nacimiento = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 300)
|
44
68
|
@lbl_fecha_nacimiento = FXLabel.new(self, "Fecha de nacimiento (AAAA/MM/DD): ", :opts => LAYOUT_EXPLICIT, :width => 250, :height => 20, :x => 340, :y => 300)
|
69
|
+
@lbl_fecha_nacimiento.backColor = FXRGB(3,187,133)
|
45
70
|
@input_fecha_nacimiento = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 590, :y => 300)
|
46
71
|
@lbl_cedula = FXLabel.new(self, "Cédula: ", :opts => LAYOUT_EXPLICIT, :width => 80, :height => 20, :x => 750, :y => 300)
|
72
|
+
@lbl_cedula.backColor = FXRGB(3,187,133)
|
47
73
|
@input_cedula = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x =>850, :y => 300)
|
48
74
|
@lbl_padrino = FXLabel.new(self, "Padrino: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 330)
|
75
|
+
@lbl_padrino.backColor = FXRGB(3,187,133)
|
49
76
|
@input_padrino = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 330)
|
50
77
|
@lbl_certifica = FXLabel.new(self, "Certifica: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 360)
|
78
|
+
@lbl_certifica.backColor = FXRGB(3,187,133)
|
51
79
|
@input_certifica = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 360)
|
52
|
-
|
53
80
|
# create buttons
|
54
81
|
@btnsave = FXButton.new(self, "Guardar", :opts => LAYOUT_EXPLICIT|BUTTON_NORMAL, :width => 100, :height => 30, :x => 790, :y => 400)
|
55
82
|
@btncancel = FXButton.new(self, "Cancelar", :opts => LAYOUT_EXPLICIT|BUTTON_NORMAL, :width => 100, :height => 30, :x => 900, :y => 400)
|
@@ -104,6 +131,7 @@ class Confirmacion < FXMainWindow
|
|
104
131
|
end
|
105
132
|
rescue PG::Error => e
|
106
133
|
# En caso de error, se realizará automáticamente un rollback
|
134
|
+
$conn.exec("ROLLBACK")
|
107
135
|
FXMessageBox.error(self, MBOX_OK, "Error", "Error al guardar los datos")
|
108
136
|
# Imprimir el error en la consola
|
109
137
|
puts e.message
|
@@ -121,9 +149,6 @@ class Confirmacion < FXMainWindow
|
|
121
149
|
@input_page.text = ""
|
122
150
|
@input_number.text = ""
|
123
151
|
@input_fecha.text = ""
|
124
|
-
@input_sacramento.text = ""
|
125
|
-
@input_parroquia.text = ""
|
126
|
-
@input_sector.text = ""
|
127
152
|
@input_parroco.text = ""
|
128
153
|
@input_celebrante.text = ""
|
129
154
|
@input_name.text = ""
|
@@ -136,6 +161,38 @@ class Confirmacion < FXMainWindow
|
|
136
161
|
end
|
137
162
|
end
|
138
163
|
|
164
|
+
# Nombre del mes
|
165
|
+
def nombre_mes(mes)
|
166
|
+
meses = {
|
167
|
+
"01" => "enero",
|
168
|
+
"02" => "febrero",
|
169
|
+
"03" => "marzo",
|
170
|
+
"04" => "abril",
|
171
|
+
"05" => "mayo",
|
172
|
+
"06" => "junio",
|
173
|
+
"07" => "julio",
|
174
|
+
"08" => "agosto",
|
175
|
+
"09" => "septiembre",
|
176
|
+
"10" => "octubre",
|
177
|
+
"11" => "noviembre",
|
178
|
+
"12" => "diciembre"
|
179
|
+
}
|
180
|
+
meses[mes]
|
181
|
+
end
|
182
|
+
|
183
|
+
|
184
|
+
# Cambiar el formato de la fecga de YYYY-MM-DD a DD de nombre_mes de YYYY
|
185
|
+
def cambiar_formato_fecha(fecha)
|
186
|
+
# split "-" or "/"
|
187
|
+
fecha = fecha.split(/-|\//)
|
188
|
+
# si el formato de fecha es YYYY-MM-DD o YYYY/MM/DD, sino si es DD-MM-YYYY o DD/MM/YYYY
|
189
|
+
if fecha[0].length == 4
|
190
|
+
"#{fecha[2]} de #{nombre_mes(fecha[1])} de #{fecha[0]}"
|
191
|
+
else
|
192
|
+
"#{fecha[0]} de #{nombre_mes(fecha[1])} de #{fecha[2]}"
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
139
196
|
def create
|
140
197
|
super
|
141
198
|
show(PLACEMENT_SCREEN)
|
data/lib/parroquia/consultas.rb
CHANGED
@@ -6,30 +6,42 @@ class Consulta < FXMainWindow
|
|
6
6
|
def initialize(app)
|
7
7
|
super(app, "Parroquia San Judas Tadeo", :width => 700, :height => 500)
|
8
8
|
@app = app
|
9
|
+
self.backColor = FXRGB(3,187,133)
|
9
10
|
|
10
11
|
# seccion encabezado
|
11
12
|
# create label
|
12
13
|
@lbltitle = FXLabel.new(self, "Bienvenido a la Parroquia San Judas Tadeo", :opts => LAYOUT_EXPLICIT | JUSTIFY_CENTER_X, :width => 700, :height => 20, :x => 0, :y => 20)
|
14
|
+
@lbltitle.font = FXFont.new(app, "Geneva", 16, FONTWEIGHT_BOLD)
|
15
|
+
@lbltitle.backColor = FXRGB(3,187,133)
|
13
16
|
# create label
|
14
17
|
@lblsubtitle = FXLabel.new(self, "ARQUIDIOSESIS DE QUITO - VICARIA NORTE SERVICIO PARROQUIAL DE SAN JUDAS TADEO", :opts => LAYOUT_EXPLICIT | JUSTIFY_CENTER_X, :width => 700, :height => 20, :x => 0, :y => 40)
|
15
|
-
|
18
|
+
@lblsubtitle.font = FXFont.new(app, "Geneva", 10, FONTWEIGHT_BOLD)
|
19
|
+
@lblsubtitle.backColor = FXRGB(3,187,133)
|
16
20
|
# create label
|
17
|
-
@date = Time.now.strftime("%d/%m/%Y
|
18
|
-
@lbldate = FXLabel.new(self, "Fecha: #{@date}", :opts => LAYOUT_EXPLICIT | JUSTIFY_RIGHT, :width => 680, :height => 20, :x => 0, :y => 60)
|
19
|
-
|
21
|
+
@date = Time.now.strftime("%d/%m/%Y")
|
22
|
+
@lbldate = FXLabel.new(self, "Fecha: #{cambiar_formato_fecha(@date)} ", :opts => LAYOUT_EXPLICIT | JUSTIFY_RIGHT, :width => 680, :height => 20, :x => 0, :y => 60)
|
23
|
+
@lbldate.font = FXFont.new(app, "Geneva", 12, FONTWEIGHT_BOLD)
|
24
|
+
@lbldate.backColor = FXRGB(3,187,133)
|
20
25
|
# seccioan consulta
|
21
26
|
@lbl_consulta = FXLabel.new(self, "Consultar por: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 150)
|
27
|
+
@lbl_consulta.backColor = FXRGB(3,187,133)
|
22
28
|
@lbl_apellidos = FXLabel.new(self, "Apellidos: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 180)
|
29
|
+
@lbl_apellidos.backColor = FXRGB(3,187,133)
|
23
30
|
@input_apellidos = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 170, :y => 180)
|
24
31
|
@lbl_nombres = FXLabel.new(self, "Nombres: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 340, :y => 180)
|
32
|
+
@lbl_nombres.backColor = FXRGB(3,187,133)
|
25
33
|
@input_nombres = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 510, :y => 180)
|
26
34
|
@lbl_cedula = FXLabel.new(self, "Cédula: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 210)
|
35
|
+
@lbl_cedula.backColor = FXRGB(3,187,133)
|
27
36
|
@input_cedula = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 170, :y => 210)
|
28
37
|
@lbl_fecha_desde = FXLabel.new(self, "Fecha desde (AAAA/MM/DD): ", :opts => LAYOUT_EXPLICIT, :width => 250, :height => 20, :x => 10, :y => 240)
|
38
|
+
@lbl_fecha_desde.backColor = FXRGB(3,187,133)
|
29
39
|
@input_fecha_desde = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 340, :y => 240)
|
30
40
|
@lbl_fecha_hasta = FXLabel.new(self, "Fecha hasta (AAAA/MM/DD): ", :opts => LAYOUT_EXPLICIT, :width => 250, :height => 20, :x => 10, :y => 270)
|
41
|
+
@lbl_fecha_hasta.backColor = FXRGB(3,187,133)
|
31
42
|
@input_fecha_hasta = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 340, :y => 270)
|
32
43
|
@lbl_sacramento = FXLabel.new(self, "Sacramento: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 300)
|
44
|
+
@lbl_sacramento.backColor = FXRGB(3,187,133)
|
33
45
|
@input_sacramento = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 170, :y => 300)
|
34
46
|
|
35
47
|
# create buttons
|
@@ -96,6 +108,39 @@ class Consulta < FXMainWindow
|
|
96
108
|
end
|
97
109
|
end
|
98
110
|
|
111
|
+
# Nombre del mes
|
112
|
+
def nombre_mes(mes)
|
113
|
+
meses = {
|
114
|
+
"01" => "enero",
|
115
|
+
"02" => "febrero",
|
116
|
+
"03" => "marzo",
|
117
|
+
"04" => "abril",
|
118
|
+
"05" => "mayo",
|
119
|
+
"06" => "junio",
|
120
|
+
"07" => "julio",
|
121
|
+
"08" => "agosto",
|
122
|
+
"09" => "septiembre",
|
123
|
+
"10" => "octubre",
|
124
|
+
"11" => "noviembre",
|
125
|
+
"12" => "diciembre"
|
126
|
+
}
|
127
|
+
meses[mes]
|
128
|
+
end
|
129
|
+
|
130
|
+
|
131
|
+
# Cambiar el formato de la fecga de YYYY-MM-DD a DD de nombre_mes de YYYY
|
132
|
+
def cambiar_formato_fecha(fecha)
|
133
|
+
# split "-" or "/"
|
134
|
+
fecha = fecha.split(/-|\//)
|
135
|
+
# si el formato de fecha es YYYY-MM-DD o YYYY/MM/DD, sino si es DD-MM-YYYY o DD/MM/YYYY
|
136
|
+
if fecha[0].length == 4
|
137
|
+
"#{fecha[2]} de #{nombre_mes(fecha[1])} de #{fecha[0]}"
|
138
|
+
else
|
139
|
+
"#{fecha[0]} de #{nombre_mes(fecha[1])} de #{fecha[2]}"
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
|
99
144
|
def create
|
100
145
|
super
|
101
146
|
show(PLACEMENT_SCREEN)
|
data/lib/parroquia/main.rb
CHANGED
@@ -11,28 +11,55 @@ end
|
|
11
11
|
|
12
12
|
class Home < FXMainWindow
|
13
13
|
def initialize(app)
|
14
|
-
|
15
|
-
super(app, "Parroquia San Judas Tadeo", :width => 700, :height => 400)
|
14
|
+
super(app, "Parroquia San Judas Tadeo", :width => 700, :height => 500)
|
16
15
|
@app = app
|
16
|
+
self.backColor = FXRGB(3,187,133)
|
17
17
|
|
18
|
-
|
18
|
+
# Font
|
19
|
+
@font = FXFont.new(app, "Geneva", 12, FONTWEIGHT_BOLD)
|
20
|
+
|
21
|
+
# Inserar imagen del logo
|
22
|
+
@image = File.open("lib/parroquia/assets/images/Logo-SJT.png", "rb")
|
23
|
+
@image = FXPNGIcon.new(app, @image.read)
|
24
|
+
@logo = FXImageFrame.new(self, @image, :opts => LAYOUT_EXPLICIT|LAYOUT_CENTER_X|LAYOUT_CENTER_Y, :width => 400, :height => 250, :x => 10, :y => 100)
|
25
|
+
# Color de fondo de image frame es el mismo que el de la ventana
|
26
|
+
@logo.backColor = FXRGB(3,187,133)
|
27
|
+
# Escalar imagen
|
28
|
+
@image.scale(400, 250)
|
29
|
+
|
30
|
+
# Title
|
19
31
|
@lbltitle = FXLabel.new(self, "Bienvenido a la Parroquia San Judas Tadeo", :opts => LAYOUT_EXPLICIT|JUSTIFY_CENTER_X, :width => 700, :height => 20, :x => 0, :y => 20)
|
20
|
-
|
21
|
-
@
|
32
|
+
@lbltitle.font = FXFont.new(app, "Geneva", 16, FONTWEIGHT_BOLD)
|
33
|
+
@lbltitle.backColor = FXRGB(3,187,133)
|
34
|
+
# Subtitle
|
35
|
+
@lblsubtitle = FXLabel.new(self, "ARQUIDIOSESIS DE QUITO - SERVICIO PARROQUIAL DE SAN JUDAS TADEO", :opts => LAYOUT_EXPLICIT|JUSTIFY_CENTER_X, :width => 700, :height => 20, :x => 0, :y => 40)
|
36
|
+
@lblsubtitle.font = FXFont.new(app, "Geneva", 10, FONTWEIGHT_BOLD)
|
37
|
+
@lblsubtitle.backColor = FXRGB(3,187,133)
|
38
|
+
# Date
|
39
|
+
@date = Time.now.strftime("%d/%m/%Y")
|
40
|
+
@lbldate = FXLabel.new(self, "Fecha: #{cambiar_formato_fecha(@date)}", :opts => LAYOUT_EXPLICIT|JUSTIFY_RIGHT, :width => 700, :height => 20, :x => 0, :y => 60, :padRight => 20)
|
41
|
+
@lbldate.font = FXFont.new(app, "Geneva", 12, FONTWEIGHT_BOLD)
|
42
|
+
@lbldate.backColor = FXRGB(3,187,133)
|
22
43
|
|
23
|
-
#create label
|
24
|
-
@date = Time.now.strftime("%d/%m/%Y %H:%M:%S")
|
25
|
-
@lbldate = FXLabel.new(self, "Fecha: #{@date}", :opts => LAYOUT_EXPLICIT|JUSTIFY_RIGHT, :width => 680, :height => 20, :x => 0, :y => 60)
|
26
44
|
#section lista
|
27
|
-
@
|
28
|
-
@
|
29
|
-
@
|
30
|
-
@
|
31
|
-
@lblmatrimonio = FXLabel.new(self, "Ingresar Matrimonio", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 210)
|
32
|
-
@btnmatrimonio = FXButton.new(self, "Ingresar", :opts => LAYOUT_EXPLICIT|BUTTON_NORMAL, :width => 150,:height => 20, :x => 170, :y => 210)
|
33
|
-
@lblconsulta = FXLabel.new(self, "Realizar una consulta", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 240)
|
34
|
-
@btnconsulta = FXButton.new(self, "Consultar", :opts => LAYOUT_EXPLICIT|BUTTON_NORMAL, :width => 150,:height => 20, :x => 170, :y => 240)
|
45
|
+
@btnbautizo = FXButton.new(self, "Ingresar Bautismo", :opts => LAYOUT_EXPLICIT|BUTTON_NORMAL, :width => 150,:height => 30, :x => 460, :y => 150)
|
46
|
+
@btnconfirmacion = FXButton.new(self, "Ingresar Confirmación", :opts => LAYOUT_EXPLICIT|BUTTON_NORMAL, :width => 150,:height => 30, :x => 460, :y => 190)
|
47
|
+
@btnmatrimonio = FXButton.new(self, "Ingresar Matrimonio", :opts => LAYOUT_EXPLICIT|BUTTON_NORMAL, :width => 150,:height => 30, :x => 460, :y => 230)
|
48
|
+
@btnconsulta = FXButton.new(self, "Consultar", :opts => LAYOUT_EXPLICIT|BUTTON_NORMAL, :width => 150,:height => 30, :x => 460, :y => 270)
|
35
49
|
|
50
|
+
# Footer
|
51
|
+
@lblfooter = FXLabel.new(self, "Web Minds Studio - 2023", :opts => LAYOUT_EXPLICIT|JUSTIFY_CENTER_X, :width =>700, :height => 20, :x => 0, :y => 400)
|
52
|
+
@lblfooter.font = FXFont.new(app, "Geneva", 10)
|
53
|
+
@lblfooter.backColor = FXRGB(3,187,133)
|
54
|
+
@lblauthor = FXLabel.new(self, "Desarrollado por Ing. Francisco J. Borja L.", :opts => LAYOUT_EXPLICIT|JUSTIFY_CENTER_X, :width =>700, :height => 20, :x => 0, :y => 420)
|
55
|
+
@lblauthor.font = FXFont.new(app, "Geneva", 10)
|
56
|
+
@lblauthor.backColor = FXRGB(3,187,133)
|
57
|
+
@lblweb = FXLabel.new(self, "www.webmindsstudio.com", :opts => LAYOUT_EXPLICIT|JUSTIFY_CENTER_X, :width =>700, :height => 20, :x => 0, :y => 440)
|
58
|
+
@lblweb.font = FXFont.new(app, "Geneva", 10)
|
59
|
+
@lblweb.backColor = FXRGB(3,187,133)
|
60
|
+
@lbllicence = FXLabel.new(self, "MIT License", :opts => LAYOUT_EXPLICIT|JUSTIFY_CENTER_X, :width =>700, :height => 20, :x => 0, :y => 460)
|
61
|
+
@lbllicence.font = FXFont.new(app, "Geneva", 10)
|
62
|
+
@lbllicence.backColor = FXRGB(3,187,133)
|
36
63
|
#section buttons executions
|
37
64
|
@btnbautizo.connect(SEL_COMMAND) do
|
38
65
|
require_relative 'bautizo.rb'
|
@@ -58,17 +85,39 @@ class Home < FXMainWindow
|
|
58
85
|
vtnconsulta.create
|
59
86
|
vtnconsulta.show(PLACEMENT_SCREEN)
|
60
87
|
end
|
88
|
+
end
|
61
89
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
90
|
+
# Nombre del mes
|
91
|
+
def nombre_mes(mes)
|
92
|
+
meses = {
|
93
|
+
"01" => "enero",
|
94
|
+
"02" => "febrero",
|
95
|
+
"03" => "marzo",
|
96
|
+
"04" => "abril",
|
97
|
+
"05" => "mayo",
|
98
|
+
"06" => "junio",
|
99
|
+
"07" => "julio",
|
100
|
+
"08" => "agosto",
|
101
|
+
"09" => "septiembre",
|
102
|
+
"10" => "octubre",
|
103
|
+
"11" => "noviembre",
|
104
|
+
"12" => "diciembre"
|
105
|
+
}
|
106
|
+
meses[mes]
|
107
|
+
end
|
69
108
|
|
70
109
|
|
71
|
-
|
110
|
+
# Cambiar el formato de la fecga de YYYY-MM-DD a DD de nombre_mes de YYYY
|
111
|
+
def cambiar_formato_fecha(fecha)
|
112
|
+
# split "-" or "/"
|
113
|
+
fecha = fecha.split(/-|\//)
|
114
|
+
# si el formato de fecha es YYYY-MM-DD o YYYY/MM/DD, sino si es DD-MM-YYYY o DD/MM/YYYY
|
115
|
+
if fecha[0].length == 4
|
116
|
+
"#{fecha[2]} de #{nombre_mes(fecha[1])} de #{fecha[0]}"
|
117
|
+
else
|
118
|
+
"#{fecha[0]} de #{nombre_mes(fecha[1])} de #{fecha[2]}"
|
119
|
+
end
|
120
|
+
end
|
72
121
|
|
73
122
|
def create
|
74
123
|
super
|