Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            TipoParentesco tipoParentesco = db.TipoParentesco.Find(id);

            db.TipoParentesco.Remove(tipoParentesco);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "Codigo_par,Descricao_par")] TipoParentesco tipoParentesco)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tipoParentesco).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tipoParentesco));
 }
        public TipoParentesco Recuperar(long Id)
        {
            TipoParentesco tipoparentesco = null;

            tipoparentesco = (from tp in context.TiposParentescos
                              where tp.Id == Id
                              select tp).FirstOrDefault();

            return(tipoparentesco);
        }
Exemple #4
0
        public ActionResult Create([Bind(Include = "Codigo_par,Descricao_par")] TipoParentesco tipoParentesco)
        {
            if (ModelState.IsValid)
            {
                db.TipoParentesco.Add(tipoParentesco);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tipoParentesco));
        }
Exemple #5
0
        // GET: TipoParentescoes/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TipoParentesco tipoParentesco = db.TipoParentesco.Find(id);

            if (tipoParentesco == null)
            {
                return(HttpNotFound());
            }
            return(View(tipoParentesco));
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            CantidadDeControles = 4;

            ////this.lblDepartamento.Content = "";
            ////this.lblEstablecimiento.Content = "";

            ModeloMadre modelomadre = new ModeloMadre();
            Madre       madre       = new Madre();

            madre = modelomadre.Recuperar(IdSeleccionado);

            if (madre != null)
            {
                this.lblNombresMadre.Content         = madre.NombreCompleto;
                this.lblFechaNacimientoMadre.Content = string.Format("{0:dd/MM/yyyy}", madre.FechaNacimiento);
            }
            else
            {
                this.lblNombresMadre.Content         = "";
                this.lblFechaNacimientoMadre.Content = "";
            }

            ModeloGrupoFamiliar modelogrupofamiliar = new ModeloGrupoFamiliar();

            _grupofamiliar = modelogrupofamiliar.RecuperarPorMadreDeFamilia(IdFamilia, IdSeleccionado);

            if (_grupofamiliar.TitularPagoVigente == true)
            {
                this.lblNombreTitular.Content     = this.lblNombresMadre.Content;
                this.lblParentesco.Content        = "";
                this.lblParentescoTitular.Content = "MADRE GESTANTE";
            }
            else
            {
                _grupofamiliar = modelogrupofamiliar.RecuperarTitularHabilitado(IdFamilia);

                if (_grupofamiliar != null)
                {
                    ModeloTutor modelotutor = new ModeloTutor();
                    Tutor       tutor       = new Tutor();
                    tutor = modelotutor.Recuperar(_grupofamiliar.IdTutor.Value);
                    this.lblNombreTitular.Content = tutor.NombreCompleto;

                    ModeloTipoParentesco modelotipoparentesco = new ModeloTipoParentesco();
                    TipoParentesco       tipoparentesco       = new TipoParentesco();

                    tipoparentesco = modelotipoparentesco.Recuperar(_grupofamiliar.IdTipoParentesco.Value);
                    this.lblParentescoTitular.Content = tipoparentesco.Descripcion;
                }
                else
                {
                    this.lblNombreTitular.Content     = "";
                    this.lblParentescoTitular.Content = "";
                }
            }

            ModeloCorresponsabilidadMadre modelocorresponsabilidadmadre = new ModeloCorresponsabilidadMadre();

            IdCorresponsabilidadMadre = modelocorresponsabilidadmadre.RecuperarLaUltimaCorresponsabilidadValidaDeMadre(IdSeleccionado);

            ValoresPorDefecto();

            if (IdCorresponsabilidadMadre > 0)
            {
                RecuperarCorresponsabilidadMadre();
            }
            else
            {
                this.txtCodigoFormulario.IsEnabled = true;
                this.dtpFechaFUM.IsEnabled         = true;
                this.dtpFechaInscripcion.IsEnabled = true;
                this.dtpFechaUltimoParto.IsEnabled = true;
                this.txtNumeroEmbarazo.IsEnabled   = true;
                this.chkARO.IsEnabled           = true;
                this.rdbNueva.IsEnabled         = true;
                this.rdbTransferencia.IsEnabled = true;
                this.cmdGuardar.IsEnabled       = true;
            }

            if (TipoAccion == TipoAccion.Detalle)
            {
                this.txtCodigoFormulario.IsEnabled = false;
                this.dtpFechaFUM.IsEnabled         = false;
                this.dtpFechaInscripcion.IsEnabled = false;
                this.dtpFechaSalida.IsEnabled      = false;
                this.dtpFechaUltimoParto.IsEnabled = false;
                this.txtNumeroEmbarazo.IsEnabled   = false;
                this.chkARO.IsEnabled                 = false;
                this.chkSalida.IsEnabled              = false;
                this.rdbAborto.IsEnabled              = false;
                this.rdbCumplimiento.IsEnabled        = false;
                this.rdbFallecimiento.IsEnabled       = false;
                this.rdbIncumplimiento.IsEnabled      = false;
                this.rdbNueva.IsEnabled               = false;
                this.rdbObitoFetal.IsEnabled          = false;
                this.rdbTransferencia.IsEnabled       = false;
                this.rdbTransferenciaSalida.IsEnabled = false;
                this.txtAutorizado.IsEnabled          = false;
                this.txtCargo.IsEnabled               = false;
                this.cmdGuardar.IsEnabled             = false;
            }
        }
Exemple #7
0
 public void SetParentesco(TipoParentesco parentesco)
 {
     this.Parentesco = parentesco;
 }
Exemple #8
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            CantidadDeControles = 12;

            ////this.lblDepartamento.Content = "";
            ////this.lblEstablecimiento.Content = "";

            ModeloMenor modelomenor = new ModeloMenor();
            Menor       menor       = new Menor();

            menor = modelomenor.Recuperar(IdSeleccionado);

            if (menor != null)
            {
                this.lblNombresMenor.Content         = menor.PrimerApellido + " " + menor.SegundoApellido + " " + menor.Nombres;
                this.lblFechaNacimientoMenor.Content = string.Format("{0:dd/MM/yyyy}", menor.FechaNacimiento);
            }
            else
            {
                this.lblNombresMenor.Content         = "";
                this.lblFechaNacimientoMenor.Content = "";
            }

            ModeloGrupoFamiliar modelogrupofamiliar = new ModeloGrupoFamiliar();

            _grupofamiliar      = modelogrupofamiliar.RecuperarTitularHabilitado(IdFamilia);
            _grupofamiliarmadre = modelogrupofamiliar.RecuperarMadreDeFamilia(IdFamilia);

            if (_grupofamiliar != null)
            {
                if (_grupofamiliar.TipoGrupoFamiliar == TipoGrupoFamiliar.Madre)
                {
                    ModeloMadre modelomadre = new ModeloMadre();
                    Madre       madre       = new Madre();

                    madre = modelomadre.Recuperar(_grupofamiliar.IdMadre.Value);
                    this.lblNombreTitular.Content = madre.NombreCompleto;

                    this.lblParentescoTitular.Content = "MADRE";
                }
                else if (_grupofamiliar.TipoGrupoFamiliar == TipoGrupoFamiliar.Tutor)
                {
                    ModeloTutor modelotutor = new ModeloTutor();
                    Tutor       tutor       = new Tutor();
                    tutor = modelotutor.Recuperar(_grupofamiliar.IdTutor.Value);
                    this.lblNombreTitular.Content = tutor.NombreCompleto;

                    ModeloTipoParentesco modelotipoparentesco = new ModeloTipoParentesco();
                    TipoParentesco       tipoparentesco       = new TipoParentesco();

                    tipoparentesco = modelotipoparentesco.Recuperar(_grupofamiliar.IdTipoParentesco.Value);
                    this.lblParentescoTitular.Content = tipoparentesco.Descripcion;
                }
                else
                {
                    this.lblNombreTitular.Content     = "";
                    this.lblParentescoTitular.Content = "";
                }
            }
            else
            {
                this.lblNombreTitular.Content     = "";
                this.lblParentescoTitular.Content = "";
            }

            ModeloCorresponsabilidadMenor modelocorresponsabilidadmenor = new ModeloCorresponsabilidadMenor();

            IdCorresponsabilidadMenor = modelocorresponsabilidadmenor.RecuperarLaUltimaCorresponsabilidadValidaDeMenor(IdSeleccionado);

            ValoresPorDefecto();

            if (IdCorresponsabilidadMenor > 0)
            {
                RecuperarCorresponsabilidadMenor();
            }
            else
            {
                this.txtCodigoFormulario.IsEnabled = true;
                this.dtpFechaInscripcion.IsEnabled = true;
                this.rdbNueva.IsEnabled            = true;
                this.rdbTransferencia.IsEnabled    = true;
                this.cmdGuardar.IsEnabled          = true;
            }

            if (TipoAccion == TipoAccion.Detalle)
            {
                this.txtCodigoFormulario.IsEnabled    = false;
                this.dtpFechaInscripcion.IsEnabled    = false;
                this.dtpFechaSalida.IsEnabled         = false;
                this.chkSalida.IsEnabled              = false;
                this.rdbCumplimiento.IsEnabled        = false;
                this.rdbFallecimiento.IsEnabled       = false;
                this.rdbIncumplimiento.IsEnabled      = false;
                this.rdbNueva.IsEnabled               = false;
                this.rdbTransferencia.IsEnabled       = false;
                this.rdbTransferenciaSalida.IsEnabled = false;
                this.txtAutorizado.IsEnabled          = false;
                this.txtCargo.IsEnabled               = false;
                this.cmdGuardar.IsEnabled             = false;
            }
        }