/
Form_procesos_incubadora.cs
768 lines (618 loc) · 38.7 KB
/
Form_procesos_incubadora.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraGrid.Views.Grid;
namespace sistema
{
public partial class Form_procesos_incubadora : Form
{
int id_doc;
int maximo_id;
public Form_procesos_incubadora()
{
InitializeComponent();
cb_doc.SelectedIndex = 0;
}
private void Form_procesos_incubadora_Load(object sender, EventArgs e)
{
// TODO: esta línea de código carga datos en la tabla 'dS_DataEmprende.alumno' Puede moverla o quitarla según sea necesario.
this.alumnoTableAdapter.Fill(this.dS_DataEmprende.alumno);
this.doc_int_asesoria_incTableAdapter.Fill(this.dS_DataEmprende.doc_int_asesoria_inc);
this.doc_int_asesoria_pre_incTableAdapter.Fill(this.dS_DataEmprende.doc_int_asesoria_pre_inc);
this.detalle_expedienteTableAdapter.Fill(this.dS_DataEmprende.detalle_expediente);
this.doc_int_check_detalleTableAdapter.Fill(this.dS_DataEmprende.doc_int_check_detalle);
this.doc_int_detalle_tipo_checkTableAdapter.Fill(this.dS_DataEmprende.doc_int_detalle_tipo_check);
this.doc_int_check_listTableAdapter.Fill(this.dS_DataEmprende.doc_int_check_list);
this.estadoTableAdapter.filtra_mayor_6(this.dS_DataEmprende.estado);
this.inc_vista_persona_proyectoTableAdapter.filtra_estado(this.dS_DataEmprende.inc_vista_persona_proyecto, 7);
filtrado();
}
private void filtrado()
{
try
{
int id = Convert.ToInt32(lbestados.SelectedValue.ToString());
inc_vista_persona_proyectoTableAdapter.filtra_estado(dS_DataEmprende.inc_vista_persona_proyecto, id);
DataRowView view1 = (DataRowView)incvistapersonaproyectoBindingSource.Current;
int id_alumno = Convert.ToInt32(view1["id_alumno"].ToString());
string nombre = view1["nombre_solo"].ToString();
inc_documentos_internosTableAdapter.filtra_alumno(dS_DataEmprende.inc_documentos_internos, id_alumno);
groupControl3.Text = "Documentos Internos de: " + nombre;
}
catch
{
inc_documentos_internosTableAdapter.filtra_alumno(dS_DataEmprende.inc_documentos_internos, 0);
groupControl3.Text = "Documentos Internos de: (no existes alumnos en este estado) ";
}
}
private void lbestados_MouseClick(object sender, MouseEventArgs e)
{
filtrado();
}
private void button1_Click(object sender, EventArgs e)
{
int id = Convert.ToInt32(lbestados.SelectedValue.ToString());
string estado = lbestados.Text.ToString();
Form_cambiar_estado Form_cambiar_estado1 = new Form_cambiar_estado(id, estado);
Form_cambiar_estado1.ShowDialog();
try
{
inc_vista_persona_proyectoTableAdapter.filtra_estado(dS_DataEmprende.inc_vista_persona_proyecto, id);
int id_alumno = Convert.ToInt32(gridView1.GetFocusedRowCellValue("id_alumno").ToString());
inc_documentos_internosTableAdapter.filtra_alumno(dS_DataEmprende.inc_documentos_internos, id_alumno);
string nombre = gridView1.GetFocusedRowCellValue("nombre_solo").ToString();
groupControl3.Text = "Documentos Internos de: " + nombre;
}
catch { };
}
private void gridView1_Click(object sender, EventArgs e)
{
try
{
int id_alumno = Convert.ToInt32(gridView1.GetFocusedRowCellValue("id_alumno").ToString());
string nombre = gridView1.GetFocusedRowCellValue("nombre_solo").ToString();
groupControl3.Text = "Documentos Internos de: " + nombre;
inc_documentos_internosTableAdapter.filtra_alumno(dS_DataEmprende.inc_documentos_internos, id_alumno);
}
catch { }
}
private void dime_maximo(int max)
{
if (max >= 10000) max = max + 1;
else max = Convert.ToInt32(Convert.ToString(mia.id_centro) + "0001");
maximo_id = max;
}
private void insertar_chek(int id_alumno,int id_proyecto)
{
DateTime Hoy = DateTime.Today;
string fecha_actual = Hoy.ToString("dd-MM-yyyy");
dime_maximo(Convert.ToInt32(this.detalle_expedienteTableAdapter.maximo()));
int id_detalle = maximo_id;
dime_maximo(Convert.ToInt32(this.doc_int_check_listTableAdapter.maximo()));
doc_int_check_listTableAdapter.inserta(id_alumno, fecha_actual, id_proyecto, id_detalle,maximo_id);
id_doc = Convert.ToInt32(this.doc_int_check_listTableAdapter.maximo());
int cant = Convert.ToInt32(doc_int_detalle_tipo_checkBindingSource.Count.ToString());
doc_int_detalle_tipo_checkBindingSource.MoveFirst();
for (int i = 1; i <= cant; i++ )
{
DataRowView view1 = (DataRowView)doc_int_detalle_tipo_checkBindingSource.Current;
//MessageBox.Show(view1["detalle_tipo_chek"].ToString());
int id_detalle_tipo = Convert.ToInt32(view1["id"].ToString());
int id_tipo = Convert.ToInt32(view1["id_tipo_chek"].ToString());
dime_maximo(Convert.ToInt32(this.doc_int_check_detalleTableAdapter.maximo()));
doc_int_check_detalleTableAdapter.inserta(id_doc,id_detalle_tipo,id_tipo, maximo_id);
doc_int_detalle_tipo_checkBindingSource.MoveNext();
}
}
private void button5_Click(object sender, EventArgs e)
{
try
{
int id_alumno = Convert.ToInt32(gridView1.GetFocusedRowCellValue("id_alumno").ToString());
string alumno = gridView1.GetFocusedRowCellValue("nombre_solo").ToString();
string id_persona = gridView1.GetFocusedRowCellValue("id_persona").ToString();
if (cb_doc.Text == "Acta de Confidencialidad")
{
Form_doc_interno Form_doc_interno1 = new Form_doc_interno(cb_doc.SelectedIndex, id_alumno, alumno, id_persona, "Acta de Confidencialidad");
Form_doc_interno1.Size = new Size(970, 310);
Form_doc_interno1.ShowDialog();
}
if (cb_doc.Text == "Acta de Entrega")
{
int id_proyecto = Convert.ToInt32(gridView1.GetFocusedRowCellValue("id_proyecto").ToString());
string proyecto = gridView1.GetFocusedRowCellValue("proyecto").ToString();
Form_doc_interno Form_doc_interno1 = new Form_doc_interno(cb_doc.SelectedIndex, id_alumno, alumno, id_proyecto, proyecto, id_persona, "Acta de Entrega");
Form_doc_interno1.Size = new Size(970, 333);
Form_doc_interno1.ShowDialog();
}
if (cb_doc.Text == "Check List")
{
int id_proyecto = Convert.ToInt32(gridView1.GetFocusedRowCellValue("id_proyecto").ToString());
string proyecto = gridView1.GetFocusedRowCellValue("proyecto").ToString();
insertar_chek(id_alumno,id_proyecto);
Form_doc_interno Form_doc_interno1 = new Form_doc_interno(cb_doc.SelectedIndex, id_alumno, alumno, id_proyecto, proyecto, id_doc, id_persona, "Check List");
Form_doc_interno1.Size = new Size(995, 580);
Form_doc_interno1.ShowDialog();
}
if (cb_doc.Text == "Resumen Ejecutivo")
{
int id_proyecto = Convert.ToInt32(gridView1.GetFocusedRowCellValue("id_proyecto").ToString());
string proyecto = gridView1.GetFocusedRowCellValue("proyecto").ToString();
Form_doc_interno Form_doc_interno1 = new Form_doc_interno(cb_doc.SelectedIndex, id_alumno, alumno, id_proyecto, proyecto, id_persona, "Resumen Ejecutivo");
Form_doc_interno1.Size = new Size(870, 490);
Form_doc_interno1.ShowDialog();
}
if (cb_doc.Text == "Carta de Finiquito")
{
int id_proyecto = Convert.ToInt32(gridView1.GetFocusedRowCellValue("id_proyecto").ToString());
string proyecto = gridView1.GetFocusedRowCellValue("proyecto").ToString();
Form_doc_interno Form_doc_interno1 = new Form_doc_interno(cb_doc.SelectedIndex, id_alumno, alumno, id_proyecto, proyecto, id_persona, "Carta de Finiquito");
Form_doc_interno1.Size = new Size(870, 490);
Form_doc_interno1.ShowDialog();
}
if (cb_doc.Text == "Dictamen")
{
int id_proyecto = Convert.ToInt32(gridView1.GetFocusedRowCellValue("id_proyecto").ToString());
string proyecto = gridView1.GetFocusedRowCellValue("proyecto").ToString();
Form_doc_interno Form_doc_interno1 = new Form_doc_interno(cb_doc.SelectedIndex, id_alumno, alumno, id_proyecto, proyecto, id_persona, "Dictamen");
Form_doc_interno1.Size = new Size(870, 420);
Form_doc_interno1.ShowDialog();
}
if (cb_doc.Text == "Acuerdo")
{
int id_proyecto = Convert.ToInt32(gridView1.GetFocusedRowCellValue("id_proyecto").ToString());
string proyecto = gridView1.GetFocusedRowCellValue("proyecto").ToString();
Form_doc_interno Form_doc_interno1 = new Form_doc_interno(cb_doc.SelectedIndex, id_alumno, alumno, id_proyecto, proyecto, id_persona, "Acuerdo");
Form_doc_interno1.Size = new Size(870, 330);
Form_doc_interno1.ShowDialog();
}
if (cb_doc.Text == "Criterio de Evaluación")
{
int id_proyecto = Convert.ToInt32(gridView1.GetFocusedRowCellValue("id_proyecto").ToString());
string proyecto = gridView1.GetFocusedRowCellValue("proyecto").ToString();
Form_doc_interno Form_doc_interno1 = new Form_doc_interno(cb_doc.SelectedIndex, id_alumno, alumno, id_proyecto, proyecto, id_persona, "Criterio de Evaluación");
Form_doc_interno1.Size = new Size(870, 710);
Form_doc_interno1.ShowDialog();
}
if (cb_doc.Text == "Plan de Incubación")
{
int id_proyecto = Convert.ToInt32(gridView1.GetFocusedRowCellValue("id_proyecto").ToString());
string proyecto = gridView1.GetFocusedRowCellValue("proyecto").ToString();
Form_doc_interno Form_doc_interno1 = new Form_doc_interno(cb_doc.SelectedIndex, id_alumno, alumno, id_proyecto, proyecto, id_persona, "Plan de Incubación");
Form_doc_interno1.Size = new Size(870, 530);
Form_doc_interno1.ShowDialog();
}
if (cb_doc.Text == "Informe de Asesoría Pre Inc.")
{
Form_doc_interno Form_doc_interno1 = new Form_doc_interno(cb_doc.SelectedIndex, id_alumno, alumno, id_persona, "Informe de Asesoría Pre Inc.");
Form_doc_interno1.Size = new Size(960, 500);
Form_doc_interno1.ShowDialog();
}
if (cb_doc.Text == "Informe de Asesoría Inc.")
{
Form_doc_interno Form_doc_interno1 = new Form_doc_interno(cb_doc.SelectedIndex, id_alumno, alumno, id_persona, "Informe de Asesoría Inc.");
Form_doc_interno1.Size = new Size(960, 500);
Form_doc_interno1.ShowDialog();
}
inc_documentos_internosTableAdapter.filtra_alumno(dS_DataEmprende.inc_documentos_internos, id_alumno);
}
catch { MessageBox.Show("No existen Alumnos en este estado, por favor verifique.", "Error al crear nuevo documento", MessageBoxButtons.OK, MessageBoxIcon.Information); }
}
private void acta_conf(reporte_doc_int_acta_confid frm)
{
frm.CreateDocument();
Form_reportes Form_reportes1 = new Form_reportes();
Form_reportes1.printBarManager1.PrintControl.PrintingSystem = frm.PrintingSystem;
Form_reportes1.ShowDialog();
}
private void acta_entrega(reporte_doc_int_acta_entrega frm)
{
frm.CreateDocument();
Form_reportes Form_reportes1 = new Form_reportes();
Form_reportes1.printBarManager1.PrintControl.PrintingSystem = frm.PrintingSystem;
Form_reportes1.ShowDialog();
}
private void check_list(reporte_doc_int_check_list frm)
{
frm.CreateDocument();
Form_reportes Form_reportes1 = new Form_reportes();
Form_reportes1.printBarManager1.PrintControl.PrintingSystem = frm.PrintingSystem;
Form_reportes1.ShowDialog();
}
private void acuerdo(reporte_doc_int_acuerdo frm)
{
frm.CreateDocument();
Form_reportes Form_reportes1 = new Form_reportes();
Form_reportes1.printBarManager1.PrintControl.PrintingSystem = frm.PrintingSystem;
Form_reportes1.ShowDialog();
}
private void dictamen(reporte_doc_int_dictamen frm)
{
frm.CreateDocument();
Form_reportes Form_reportes1 = new Form_reportes();
Form_reportes1.printBarManager1.PrintControl.PrintingSystem = frm.PrintingSystem;
Form_reportes1.ShowDialog();
}
private void criterio_evaluacion(reporte_doc_int_criterio_evaluacion frm)
{
frm.CreateDocument();
Form_reportes Form_reportes1 = new Form_reportes();
Form_reportes1.printBarManager1.PrintControl.PrintingSystem = frm.PrintingSystem;
Form_reportes1.ShowDialog();
}
private void plan_incubacion(reporte_doc_int_plan_incubacion frm)
{
frm.CreateDocument();
Form_reportes Form_reportes1 = new Form_reportes();
Form_reportes1.printBarManager1.PrintControl.PrintingSystem = frm.PrintingSystem;
Form_reportes1.ShowDialog();
}
private void resumen(reporte_doc_int_resumen_ejecutivo frm)
{
frm.CreateDocument();
Form_reportes Form_reportes1 = new Form_reportes();
Form_reportes1.printBarManager1.PrintControl.PrintingSystem = frm.PrintingSystem;
Form_reportes1.ShowDialog();
}
private void carta(reporte_doc_int_carta_finiquito frm)
{
frm.CreateDocument();
Form_reportes Form_reportes1 = new Form_reportes();
Form_reportes1.printBarManager1.PrintControl.PrintingSystem = frm.PrintingSystem;
Form_reportes1.ShowDialog();
}
private void asesoria_pre_inc(reporte_doc_int_asesoria_pre_inc frm)
{
frm.CreateDocument();
Form_reportes Form_reportes1 = new Form_reportes();
Form_reportes1.printBarManager1.PrintControl.PrintingSystem = frm.PrintingSystem;
Form_reportes1.ShowDialog();
}
private void asesoria_inc(reporte_doc_int_asesoria_inc frm)
{
frm.CreateDocument();
Form_reportes Form_reportes1 = new Form_reportes();
Form_reportes1.printBarManager1.PrintControl.PrintingSystem = frm.PrintingSystem;
Form_reportes1.ShowDialog();
}
private void button7_Click(object sender, EventArgs e)
{
try
{
int id_doc = Convert.ToInt32(gridView4.GetFocusedRowCellValue("id").ToString());
string anulado =gridView4.GetFocusedRowCellValue("anulado").ToString();
string nombre = gridView4.GetFocusedRowCellValue("nombre").ToString();
if (anulado == "No")
{
if (nombre == "Acta de Confidencialidad")
{
reporte_doc_int_acta_confid reporte1 = new reporte_doc_int_acta_confid(id_doc);
acta_conf(reporte1);
}
if (nombre == "Acta de Entrega")
{
reporte_doc_int_acta_entrega reporte1 = new reporte_doc_int_acta_entrega(id_doc);
acta_entrega(reporte1);
}
if (nombre == "Check List")
{
reporte_doc_int_check_list reporte1 = new reporte_doc_int_check_list(id_doc);
check_list(reporte1);
}
if (nombre == "Dictamen")
{
reporte_doc_int_dictamen reporte1 = new reporte_doc_int_dictamen(id_doc);
dictamen(reporte1);
}
if (nombre == "Acuerdo")
{
reporte_doc_int_acuerdo reporte1 = new reporte_doc_int_acuerdo(id_doc);
acuerdo(reporte1);
}
if (nombre == "Resumen Ejecutivo")
{
reporte_doc_int_resumen_ejecutivo reporte1 = new reporte_doc_int_resumen_ejecutivo(id_doc);
resumen(reporte1);
}
if (nombre == "Carta de Finiquito")
{
reporte_doc_int_carta_finiquito reporte1 = new reporte_doc_int_carta_finiquito(id_doc);
carta(reporte1);
}
if (nombre == "Criterio de Evaluación")
{
reporte_doc_int_criterio_evaluacion reporte1 = new reporte_doc_int_criterio_evaluacion(id_doc);
criterio_evaluacion(reporte1);
}
if (nombre == "Plan de Incubación")
{
reporte_doc_int_plan_incubacion reporte1 = new reporte_doc_int_plan_incubacion(id_doc);
plan_incubacion(reporte1);
}
if (nombre == "Informe de Asesoría Pre Inc.")
{
reporte_doc_int_asesoria_pre_inc reporte1 = new reporte_doc_int_asesoria_pre_inc(id_doc);
asesoria_pre_inc(reporte1);
}
if (nombre == "Informe de Asesoría Inc.")
{
reporte_doc_int_asesoria_inc reporte1 = new reporte_doc_int_asesoria_inc(id_doc);
asesoria_inc(reporte1);
}
}
else { MessageBox.Show("Este Documento no se puede imprimir porque fue ANULADO.", "Error al imprimir reporte", MessageBoxButtons.OK, MessageBoxIcon.Information); }
}
catch { MessageBox.Show("Este Alumno no posee Documentos internos o no ha seleccionado aún un Alumno.", "Error al imprimir reporte", MessageBoxButtons.OK, MessageBoxIcon.Information); }
}
private void button8_Click(object sender, EventArgs e)
{
try
{
string firmado = gridView4.GetFocusedRowCellValue("firmado").ToString();
if (firmado == "No")
{
DialogResult Resp;
Resp = MessageBox.Show("Se eliminará un documento interno ¿Está seguro?", mia.mensaje_eliminando_superior, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
if (Resp == DialogResult.Yes)
{
try
{
string documento = gridView4.GetFocusedRowCellValue("nombre").ToString();
int id = Convert.ToInt32(gridView4.GetFocusedRowCellValue("id").ToString());
int id_alumno = Convert.ToInt32(gridView1.GetFocusedRowCellValue("id_alumno").ToString());
int id_expediente = Convert.ToInt32(gridView4.GetFocusedRowCellValue("id_expediente").ToString());
if (documento == "Acta de Confidencialidad") { doc_int_acta_confidencialidadTableAdapter1.borrar(id); }
if (documento == "Acta de Entrega") { doc_int_acta_entregaTableAdapter1.borrar(id); }
if (documento == "Check List") { doc_int_check_listTableAdapter1.borrar(id); }
if (documento == "Resumen Ejecutivo") { doc_int_resumen_ejecutivoTableAdapter1.borrar(id); }
if (documento == "Carta de Finiquito") { doc_int_carta_finiquitoTableAdapter1.borrar(id); }
if (documento == "Dictamen") { doc_int_dictamenTableAdapter1.borrar(id); }
if (documento == "Acuerdo") { doc_int_acuerdoTableAdapter1.borrar(id); }
if (documento == "Criterio de Evaluación") { doc_int_criterio_evaluacionTableAdapter1.borrar(id); }
if (documento == "Plan de Incubación") { doc_int_plan_encubacionTableAdapter1.borrar(id); }
if (documento == "Informe de Asesoría Pre Inc.") { doc_int_asesoria_pre_incTableAdapter.borrar(id); }
if (documento == "Informe de Asesoría Inc.") { doc_int_asesoria_incTableAdapter.borrar(id); }
///////////////////////// para borrar del disco duro ///////////
string id_persona = gridView4.GetFocusedRowCellValue("id_persona").ToString();
string rutaDestino = @mia.camino + "\\Alumnos\\" + Convert.ToString(id_persona) + "\\";
string archivoDestino = System.IO.Path.Combine(rutaDestino, gridView4.GetFocusedRowCellValue("url").ToString());
System.IO.File.Delete(archivoDestino);
detalle_expedienteTableAdapter.borrar(id_expediente);
inc_documentos_internosTableAdapter.filtra_alumno(dS_DataEmprende.inc_documentos_internos, id_alumno);
}
catch { MessageBox.Show("Este Alumno no posee Documentos internos a borrar.", "Error al borrar documento interno", MessageBoxButtons.OK, MessageBoxIcon.Information); }
}
}
else { MessageBox.Show("Este Documento no puede ser Borrado porque está Firmado, solo se puede ANULAR.", "Error al borrar documento interno", MessageBoxButtons.OK, MessageBoxIcon.Information); }
}
catch { MessageBox.Show("Este Alumno no posee Documentos internos a borrar.", "Error al borrar documento interno", MessageBoxButtons.OK, MessageBoxIcon.Information); }
}
private void reporte_listado_persona_estado(reporte_doc_int_listado_persona_estado frm)
{
frm.CreateDocument();
Form_reportes Form_reportes1 = new Form_reportes();
Form_reportes1.printBarManager1.PrintControl.PrintingSystem = frm.PrintingSystem;
Form_reportes1.ShowDialog();
}
private void button2_Click(object sender, EventArgs e)
{
try
{
int id_estado = Convert.ToInt32(gridView1.GetFocusedRowCellValue("id_estado").ToString());
reporte_doc_int_listado_persona_estado reporte1 = new reporte_doc_int_listado_persona_estado(id_estado);
reporte_listado_persona_estado(reporte1);
}
catch { MessageBox.Show("No existen Alumnos en este Estado.", "Error al generar reporte", MessageBoxButtons.OK, MessageBoxIcon.Information); }
}
private void button6_Click(object sender, EventArgs e)
{
try
{
string idalumno = gridView1.GetFocusedRowCellValue("id_persona").ToString();
string nombre = gridView1.GetFocusedRowCellValue("nombre_solo").ToString();
Form_detalle_expediente Form_detalle_expediente1 = new Form_detalle_expediente(idalumno, nombre);
Form_detalle_expediente1.ShowDialog();
}
catch { MessageBox.Show("No existen Alumnos en este Estado.", "Error al ver Expediente", MessageBoxButtons.OK, MessageBoxIcon.Information); }
}
private void button9_Click(object sender, EventArgs e)
{
DialogResult Resp;
Resp = MessageBox.Show("Este documento pasará a ser un DOCUMENTO FIRMADO ¿Está seguro?", "Documento firmado", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
if (Resp == DialogResult.Yes)
{
try
{
int id_doc = Convert.ToInt32(gridView4.GetFocusedRowCellValue("id").ToString());
string tipo_doc = gridView4.GetFocusedRowCellValue("nombre").ToString();
int id_alumno = Convert.ToInt32(gridView1.GetFocusedRowCellValue("id_alumno").ToString());
if (tipo_doc == "Acta de Confidencialidad") { doc_int_acta_confidencialidadTableAdapter1.firma("Si", id_doc); }
if (tipo_doc == "Acta de Entrega") { doc_int_acta_entregaTableAdapter1.firma("Si", id_doc); }
if (tipo_doc == "Check List") { doc_int_check_listTableAdapter1.firma("Si", id_doc); }
if (tipo_doc == "Resumen Ejecutivo") { doc_int_resumen_ejecutivoTableAdapter1.firma("Si", id_doc); }
if (tipo_doc == "Carta de Finiquito") { doc_int_carta_finiquitoTableAdapter1.firma("Si", id_doc); }
if (tipo_doc == "Dictamen") { doc_int_dictamenTableAdapter1.firma("Si", id_doc); }
if (tipo_doc == "Acuerdo") { doc_int_acuerdoTableAdapter1.firma("Si", id_doc); }
if (tipo_doc == "Criterio de Evaluación") { doc_int_criterio_evaluacionTableAdapter1.firma("Si", id_doc); }
if (tipo_doc == "Plan de Incubación") { doc_int_plan_encubacionTableAdapter1.firma("Si", id_doc); }
if (tipo_doc == "Informe de Asesoría Pre Inc.") { doc_int_asesoria_pre_incTableAdapter.firma("Si", id_doc); }
if (tipo_doc == "Informe de Asesoría Inc.") { doc_int_asesoria_incTableAdapter.firma("Si", id_doc); }
inc_documentos_internosTableAdapter.filtra_alumno(dS_DataEmprende.inc_documentos_internos, id_alumno);
}
catch { MessageBox.Show("No existen Alumnos en este Estado.", "Error al firmar documento", MessageBoxButtons.OK, MessageBoxIcon.Information); }
}
}
private void button3_Click(object sender, EventArgs e)
{
try
{
string firmado = gridView4.GetFocusedRowCellValue("firmado").ToString();
if (firmado == "Si")
{
DialogResult Resp;
Resp = MessageBox.Show("¿Está seguro que desea ANULAR este DOCUMENTO FIRMADO ?", "Anulando Documento firmado.", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
if (Resp == DialogResult.Yes)
{
try
{
int id_doc = Convert.ToInt32(gridView4.GetFocusedRowCellValue("id").ToString());
string tipo_doc = gridView4.GetFocusedRowCellValue("nombre").ToString();
int id_alumno = Convert.ToInt32(gridView1.GetFocusedRowCellValue("id_alumno").ToString());
int id_expediente = Convert.ToInt32(gridView4.GetFocusedRowCellValue("id_expediente").ToString());
if (tipo_doc == "Acta de Confidencialidad") { doc_int_acta_confidencialidadTableAdapter1.anular("Si", id_doc); }
if (tipo_doc == "Acta de Entrega") { doc_int_acta_entregaTableAdapter1.anular("Si", id_doc); }
if (tipo_doc == "Check List") { doc_int_check_listTableAdapter1.anular("Si", id_doc); }
if (tipo_doc == "Resumen Ejecutivo") { doc_int_resumen_ejecutivoTableAdapter1.anular("Si", id_doc); }
if (tipo_doc == "Carta de Finiquito") { doc_int_carta_finiquitoTableAdapter1.anular("Si", id_doc); }
if (tipo_doc == "Dictamen") { doc_int_dictamenTableAdapter1.anular("Si", id_doc); }
if (tipo_doc == "Acuerdo") { doc_int_acuerdoTableAdapter1.anular("Si", id_doc); }
if (tipo_doc == "Criterio de Evaluación") { doc_int_criterio_evaluacionTableAdapter1.anular("Si", id_doc); }
if (tipo_doc == "Plan de Incubación") { doc_int_plan_encubacionTableAdapter1.anular("Si", id_doc); }
if (tipo_doc == "Informe de Asesoría Pre Inc.") { doc_int_asesoria_pre_incTableAdapter.anular("Si", id_doc); }
if (tipo_doc == "Informe de Asesoría Inc.") { doc_int_asesoria_incTableAdapter.anular("Si", id_doc); }
detalle_expedienteTableAdapter.anular("Si", "",id_expediente);
string id_persona = gridView4.GetFocusedRowCellValue("id_persona").ToString();
string rutaDestino = @mia.camino + "\\Alumnos\\" + Convert.ToString(id_persona) + "\\";
string archivoDestino = System.IO.Path.Combine(rutaDestino, gridView4.GetFocusedRowCellValue("url").ToString());
System.IO.File.Delete(archivoDestino);
inc_documentos_internosTableAdapter.filtra_alumno(dS_DataEmprende.inc_documentos_internos, id_alumno);
}
catch { MessageBox.Show("No existen Alumnos en este Estado.", "Error al anular documento", MessageBoxButtons.OK, MessageBoxIcon.Information); }
}
}
else { MessageBox.Show("Este Documento no puede ser Anulado porque NO está Firmado, Se puede Borrar sin problemas.", "Error al Anular documento interno", MessageBoxButtons.OK, MessageBoxIcon.Information); }
}
catch { MessageBox.Show("Este Alumno no posee Documentos internos a Anular.", "Error al Anular documento interno", MessageBoxButtons.OK, MessageBoxIcon.Information); }
}
private void gridView4_RowStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs e)
{
GridView View = sender as GridView;
if (e.RowHandle >= 0)
{
string anulado = View.GetRowCellDisplayText(e.RowHandle, View.Columns["anulado"]);
string firmado = View.GetRowCellDisplayText(e.RowHandle, View.Columns["firmado"]);
if (firmado == "Si")
{
e.Appearance.BackColor = Color.DeepSkyBlue;
e.Appearance.BackColor2 = Color.Azure;
//e.Appearance.Font = new Font(e.Appearance.Font, FontStyle.Bold);
e.Appearance.Font = new Font(e.Appearance.Font, FontStyle.Bold);
}
if (anulado == "Si")
{
e.Appearance.BackColor = Color.Salmon;
e.Appearance.BackColor2 = Color.SeaShell;
//e.Appearance.Font = new Font(e.Appearance.Font, FontStyle.Bold);
e.Appearance.Font = new Font(e.Appearance.Font, FontStyle.Italic);
}
}
}
private void button10_Click(object sender, EventArgs e)
{
try
{
int id_alumno = Convert.ToInt32(gridView1.GetFocusedRowCellValue("id_alumno").ToString());
string nombre = gridView1.GetFocusedRowCellValue("nombres_completo").ToString();
Form_asesoria Form_asesoria1 = new Form_asesoria(id_alumno, nombre, "1");
Form_asesoria1.ShowDialog();
}
catch { MessageBox.Show("No existen Alumnos en este Estado.", "Error al crear una asesoría", MessageBoxButtons.OK, MessageBoxIcon.Information); }
}
private void gridView1_DoubleClick(object sender, EventArgs e)
{
try
{
string idpersona = gridView1.GetFocusedRowCellValue("id_persona").ToString();
Form_persona Form_persona1 = new Form_persona(idpersona, 1);
Form_persona1.Size = new Size(1020, 330);
Form_persona1.ShowDialog();
}
catch { MessageBox.Show("No existen Alumnos en este Estado.", "Error al editar alumno", MessageBoxButtons.OK, MessageBoxIcon.Information); }
}
private void limpiar_doc_interno()
{
try
{
string documento = gridView4.GetFocusedRowCellValue("nombre").ToString();
int id = Convert.ToInt32(gridView4.GetFocusedRowCellValue("id").ToString());
int id_alumno = Convert.ToInt32(gridView1.GetFocusedRowCellValue("id_alumno").ToString());
int id_expediente = Convert.ToInt32(gridView4.GetFocusedRowCellValue("id_expediente").ToString());
if (documento == "Acta de Confidencialidad") { doc_int_acta_confidencialidadTableAdapter1.borrar(id); }
if (documento == "Acta de Entrega") { doc_int_acta_entregaTableAdapter1.borrar(id); }
if (documento == "Check List") { doc_int_check_listTableAdapter1.borrar(id); }
if (documento == "Resumen Ejecutivo") { doc_int_resumen_ejecutivoTableAdapter1.borrar(id); }
if (documento == "Carta de Finiquito") { doc_int_carta_finiquitoTableAdapter1.borrar(id); }
if (documento == "Dictamen") { doc_int_dictamenTableAdapter1.borrar(id); }
if (documento == "Acuerdo") { doc_int_acuerdoTableAdapter1.borrar(id); }
if (documento == "Criterio de Evaluación") { doc_int_criterio_evaluacionTableAdapter1.borrar(id); }
if (documento == "Plan de Incubación") { doc_int_plan_encubacionTableAdapter1.borrar(id); }
if (documento == "Informe de Asesoría Pre Inc.") { doc_int_asesoria_pre_incTableAdapter.borrar(id); }
if (documento == "Informe de Asesoría Inc.") { doc_int_asesoria_incTableAdapter.borrar(id); }
///////////////////////// para borrar del disco duro ///////////
string id_persona = gridView4.GetFocusedRowCellValue("id_persona").ToString();
string rutaDestino = @mia.camino + "\\Alumnos\\" + Convert.ToString(id_persona) + "\\";
string archivoDestino = System.IO.Path.Combine(rutaDestino, gridView4.GetFocusedRowCellValue("url").ToString());
System.IO.File.Delete(archivoDestino);
detalle_expedienteTableAdapter.borrar(id_expediente);
// inc_documentos_internosTableAdapter.filtra_alumno(dS_DataEmprende.inc_documentos_internos, id_alumno);
}
catch
{
// MessageBox.Show("Este Alumno no posee Documentos internos a borrar.", "Error al borrar documento interno", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
private void button12_Click(object sender, EventArgs e)
{
if (incvistapersonaproyectoBindingSource.Count != 0)
{
DialogResult Resp;
Resp = MessageBox.Show("¿Está seguro que desea ELIMINAR este Alumno de este ESTADO y colocarlo en el estado anterior ?", "Eliminado alumno de estado.", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
if (Resp == DialogResult.Yes)
{
int id_estado_CB = Convert.ToInt32(lbestados.SelectedValue.ToString());
int id_alumno = Convert.ToInt32(gridView1.GetFocusedRowCellValue("id_alumno").ToString());
int id_estado = Convert.ToInt32(gridView1.GetFocusedRowCellValue("id_estado").ToString());
/* falta hacer lo de eleiminar otods los doc internos */
if (id_estado == 7)
{
if (inc_documentos_internosBindingSource.Count != 0)
{
inc_documentos_internosBindingSource.MoveFirst();
for (int i = 1; i <= inc_documentos_internosBindingSource.Count; i++)
{
limpiar_doc_interno();
inc_documentos_internosBindingSource.MoveNext();
}
}
}
alumnoTableAdapter.actualiza_estado(id_estado - 1, id_alumno);
inc_vista_persona_proyectoTableAdapter.filtra_estado(dS_DataEmprende.inc_vista_persona_proyecto, id_estado_CB);
try
{
id_alumno = Convert.ToInt32(gridView1.GetFocusedRowCellValue("id_alumno").ToString());
inc_documentos_internosTableAdapter.filtra_alumno(dS_DataEmprende.inc_documentos_internos, id_alumno);
string nombre = gridView1.GetFocusedRowCellValue("nombre_solo").ToString();
groupControl3.Text = "Documentos Internos de: " + nombre;
}
catch { groupControl3.Text = "Documentos Internos "; inc_documentos_internosTableAdapter.filtra_alumno(dS_DataEmprende.inc_documentos_internos, 99999999); }
}
}
}
private void button11_Click(object sender, EventArgs e)
{
try
{
int id_alumno = Convert.ToInt32(gridView1.GetFocusedRowCellValue("id_alumno").ToString());
string nombre = gridView1.GetFocusedRowCellValue("nombres_completo").ToString();
Form_asesoria Form_asesoria1 = new Form_asesoria(id_alumno, nombre, "1");
Form_asesoria1.ShowDialog();
}
catch { MessageBox.Show("No existen Alumnos en este Estado.", "Error al generar cita", MessageBoxButtons.OK, MessageBoxIcon.Information); }
}
}
}