Example #1
0
        public void AgregarPuntaje(Antecedente antecedente, Victima victima)
        {
            if (antecedente == null)
            {
                throw new FaultException(Lenguaje.AntecedenteNoValido);
            }

            antecedente = RepositorioAntecedentes.DevolverPorId(antecedente.Id);
            if (antecedente == null)
            {
                throw new FaultException(Lenguaje.AntecedenteNoExiste);
            }

            if (victima == null)
            {
                throw new FaultException(Lenguaje.VictimaNoValida);
            }

            victima = RepositorioVictimas.DevolverPorId(victima.Id);
            if (victima == null)
            {
                throw new FaultException(Lenguaje.VictimaNoExiste);
            }

            RepositorioAntecedentes.InsertarPuntajes(antecedente, victima);
        }
Example #2
0
 protected void btnAceptar_Click(object sender, EventArgs e)
 {
     try
     {
         var antecedente = new Antecedente();
         antecedente.Estado = new Estado {
             Id = 1
         };
         antecedente.Nombre        = txtNombre.Text;
         antecedente.Victima       = servicioWeb.DevolverVictimaPorId(Convert.ToInt32(hdnIdVictima.Value));
         antecedente.Agresor       = servicioWeb.DevolverAgresorPorId(Convert.ToInt32(hdnIdAgresor.Value), false, false, false);
         antecedente.Fecha         = Convert.ToDateTime(txtFecha.Text);
         antecedente.Observaciones = txtObservaciones.Text;
         antecedente.Perjuicios    = txtPerjuicios.Text;
         antecedente.Ubicacion     = txtUbicacion.Text;
         antecedente.Latitud       = 0;
         antecedente.Longitud      = 0;
         servicioWeb.CrearAntecedente(antecedente);
         Response.Redirect("Antecedentes.aspx");
     }
     catch (Exception ex)
     {
         lblMensaje.Visible = true;
         lblMensaje.Text    = ex.Message;
     }
 }
Example #3
0
        public ActionResult EliminarPV(string id)
        {
            int         _id         = Convert.ToInt32(id);
            Antecedente antecedente = servicioWeb.DevolverAntecedentePorId(_id, false);

            return(PartialView("EliminarPV", antecedente));
        }
Example #4
0
        public Antecedente MapDtoToAntecedente(AntecedenteDto dto)
        {
            Antecedente antecedente = new Antecedente();

            if (dto.Id > 0)
            {
                antecedente = this.sessionFactory.GetEntity<Antecedente>(dto.Id);
            }
            if (dto.ConsejeriaId > 0 && antecedente.Consejeria == null)
            {
                antecedente.Consejeria = this.sessionFactory.GetEntity<ConsejeriaEntidad>(dto.ConsejeriaId);
            }
            antecedente.AbortoEspontaneo = dto.AbortoEspontaneo;
            antecedente.AbortoVoluntario = dto.AbortoVoluntario;
            antecedente.AHEMAC = dto.AHEMAC;
            antecedente.Cesareas = dto.Cesareas;
            antecedente.FalloMAC = dto.FalloMAC;
            antecedente.Gestas = dto.Gestas;
            antecedente.MACACI = dto.MACACI;
            antecedente.MACACO = dto.MACACO;
            antecedente.MACDIU = dto.MACDIU;
            antecedente.MACImplanteHormonal = dto.MACImplanteHormonal;
            antecedente.MACNoUsa = dto.MACNoUsa;
            antecedente.MACPreservativo = dto.MACPreservativo;
            antecedente.NoUsoMAC = dto.NoUsoMAC;
            antecedente.Observaciones = dto.Observaciones;
            antecedente.PartosVaginal = dto.PartosVaginal;

            return antecedente;
        }
Example #5
0
        public ActionResult DetallePV(string id)
        {
            int         _id         = Convert.ToInt32(id);
            Antecedente antecedente = servicioWeb.DevolverAntecedentePorId(_id, true);

            return(PartialView("DetallePV", antecedente));
        }
        protected void lnkAplicarCambios_Click(object sender, EventArgs e)
        {
            try
            {
                var antecedente = new Antecedente();
                antecedente.Id     = Convert.ToInt32(hdnIdAntecedente.Value);
                antecedente.Estado = new Estado {
                    Id = Convert.ToByte(ddlEstado.SelectedValue)
                };
                antecedente.Nombre        = txtNombre.Text;
                antecedente.Fecha         = Convert.ToDateTime(txtFecha.Text);
                antecedente.Observaciones = txtObservaciones.Text;
                antecedente.Perjuicios    = txtPerjuicios.Text;
                antecedente.Ubicacion     = txtUbicacion.Text;
                antecedente.Latitud       = 0;
                antecedente.Longitud      = 0;

                antecedente.Victima = new Victima {
                    Id = Convert.ToInt32(hdnIdVictima.Value)
                };
                antecedente.Agresor = new Agresor {
                    Id = Convert.ToInt32(hdnIdAgresor.Value)
                };

                servicioWeb.ModificarAntecedente(antecedente);
                Response.Redirect(QueryStrings_Url(urlAntecedentesDetalle, "id=" + hdnIdAntecedente.Value));
            }
            catch (Exception ex)
            {
                litMensaje.Visible = true;
                litMensaje.Text    = ex.Message;
            }
        }
Example #7
0
 public void Crear(Antecedente antecedente)
 {
     antecedente.Estado = new Estado()
     {
         Id = 1
     };
     servicioWeb.CrearAntecedente(antecedente);
 }
Example #8
0
        public static AntecedenteViewModel FillAntecedenteViewModel(Antecedente antecedente)
        {
            var ante = antecedente?.MapperClass <AntecedenteViewModel>();

            if (ante != null)
            {
                ante.UsuarioId = antecedente.Usuario.Id;
            }
            return(ante);
        }
Example #9
0
        public int CrearAntecedente(Antecedente antecedente)
        {
            if (antecedente == null)
            {
                throw new FaultException(Lenguaje.AntecedenteNoValido);
            }
            if (String.IsNullOrWhiteSpace(antecedente.Nombre))
            {
                throw new FaultException(Lenguaje.NombreNoValido);
            }
            if (String.IsNullOrWhiteSpace(antecedente.Perjuicios))
            {
                throw new FaultException(Lenguaje.PerjuiciosNoValidos);
            }
            if (antecedente.Fecha > DateTime.Now)
            {
                throw new FaultException(Lenguaje.FechaNoValida);
            }
            if (String.IsNullOrWhiteSpace(antecedente.Ubicacion))
            {
                throw new FaultException(Lenguaje.UbicacionNoValida);
            }

            if (antecedente.Estado == null)
            {
                throw new FaultException(Lenguaje.EstadoNoValido);
            }

            if (RepositorioEstados.DevolverPorId(antecedente.Estado.Id) == null)
            {
                throw new FaultException(Lenguaje.EstadoNoValido);
            }

            var victima = RepositorioVictimas.DevolverPorId(antecedente.Victima.Id);

            if (victima == null || victima.EstaBorrado == true)
            {
                throw new FaultException(Lenguaje.VictimaNoExiste);
            }

            var agresor = RepositorioAgresores.DevolverPorId(antecedente.Agresor.Id);

            if (agresor == null || agresor.EstaBorrado == true)
            {
                throw new FaultException(Lenguaje.AgresorNoExiste);
            }

            antecedente.Nombre.Trim();
            antecedente.Observaciones.Trim();
            antecedente.Perjuicios.Trim();
            antecedente.Ubicacion.Trim();
            RepositorioAntecedentes.Insertar(antecedente);
            return(antecedente.Id);
        }
Example #10
0
        public virtual AntecedenteViewModel GuardarAntecedenteViewModel(AntecedenteViewModel antecedente)
        {
            Antecedente ante = null;

            ante = antecedente.Id.Equals(0) ? new Antecedente {
                Usuario = DependencyFactory.Resolve <IUsuarioDA>().GetById(antecedente.UsuarioId)
            } : DependencyFactory.Resolve <IBaseDA <Antecedente> >().GetById(antecedente.Id);
            antecedente.MapperClass(ante, TypeMapper.IgnoreCaseSensitive);
            DependencyFactory.Resolve <IBaseDA <Antecedente> >().Save(ante);

            var     listaAntecedentes = DependencyFactory.Resolve <IJugadorDA>().ObtenerAntecedentes(antecedente.UsuarioId).OrderByDescending(o => o.FechaInicio);
            Jugador jugador           = listaAntecedentes.Any() ? listaAntecedentes.First().Usuario.Jugador : null;

            if (jugador == null)
            {
                throw new Exception("No existe Jugador relacionado");
            }
            if (listaAntecedentes.Count().Equals(1))
            {
                jugador.ClubDescripcion = listaAntecedentes.First().ClubDescripcion;
                jugador.ClubLogo        = listaAntecedentes.First().ClubLogo;
            }
            else
            {
                var ultimo = listaAntecedentes.First();
                jugador.ClubDescripcion = listaAntecedentes.First().ClubDescripcion;
                jugador.ClubLogo        = listaAntecedentes.First().ClubLogo;
                foreach (var item in listaAntecedentes)
                {
                    if (item.Id.Equals(ultimo.Id))
                    {
                        continue;
                    }
                    else
                    {
                        if (!item.FechaFin.HasValue)
                        {
                            item.FechaFin = ultimo.FechaInicio.AddDays(-1);
                            DependencyFactory.Resolve <IBaseDA <Antecedente> >().Save(item);
                        }
                        ultimo = item;
                    }
                }
            }
            DependencyFactory.Resolve <IJugadorDA>().Save(jugador);
            var ret = ante?.MapperClass <AntecedenteViewModel>();

            if (ret != null)
            {
                ret.UsuarioId = ante.Usuario.Id;
            }
            return(ret);
        }
        public virtual AntecedenteViewModel GuardarAntecedenteViewModel(AntecedenteViewModel antecedente)
        {
            Antecedente ante = null;

            ante = antecedente.Id.Equals(0) ? new Antecedente {
                Usuario = DependencyFactory.Resolve <IUsuarioDA>().GetById(antecedente.UsuarioId)
            } : DependencyFactory.Resolve <IBaseDA <Antecedente> >().GetById(antecedente.Id);
            antecedente.MapperClass(ante, TypeMapper.IgnoreCaseSensitive);
            DependencyFactory.Resolve <IBaseDA <Antecedente> >().Save(ante);
            antecedente.Id = ante.Id;
            return(antecedente);
        }
Example #12
0
 public int Antecedentes_Insertar(Antecedente antecedente)
 {
     return(Convert.ToInt32(DevolverEscalar("Antecedentes_Insertar",
                                            new SqlParameter("@Nombre", antecedente.Nombre),
                                            new SqlParameter("@IdEstado", antecedente.Estado.Id),
                                            new SqlParameter("@IdVictima", antecedente.Victima.Id),
                                            new SqlParameter("@IdAgresor", antecedente.Agresor.Id),
                                            new SqlParameter("@Fecha", antecedente.Fecha),
                                            new SqlParameter("@Ubicacion", antecedente.Ubicacion),
                                            new SqlParameter("@Latitud", antecedente.Latitud),
                                            new SqlParameter("@Longitud", antecedente.Longitud),
                                            new SqlParameter("@Observaciones", antecedente.Observaciones),
                                            new SqlParameter("@Perjuicios", antecedente.Perjuicios))));
 }
Example #13
0
        public void EliminarAntecedente(Antecedente antecedente)
        {
            if (antecedente == null)
            {
                throw new FaultException(Lenguaje.AntecedenteNoValido);
            }

            antecedente = RepositorioAntecedentes.DevolverPorId(antecedente.Id);
            if (antecedente == null)
            {
                throw new FaultException(Lenguaje.AntecedenteNoExiste);
            }

            RepositorioAntecedentes.Eliminar(antecedente);
        }
Example #14
0
 public void Antecedentes_Modificar(Antecedente antecedente)
 {
     EjecutarConsulta("Antecedentes_Modificar",
                      new SqlParameter("@IdAntecedente", antecedente.Id),
                      new SqlParameter("@Nombre", antecedente.Nombre),
                      new SqlParameter("@IdEstado", antecedente.Estado.Id),
                      new SqlParameter("@IdVictima", antecedente.Victima.Id),
                      new SqlParameter("@IdAgresor", antecedente.Agresor.Id),
                      new SqlParameter("@Fecha", antecedente.Fecha),
                      new SqlParameter("@Ubicacion", antecedente.Ubicacion),
                      new SqlParameter("@Latitud", antecedente.Latitud),
                      new SqlParameter("@Longitud", antecedente.Longitud),
                      new SqlParameter("@Observaciones", antecedente.Observaciones),
                      new SqlParameter("@Perjuicios", antecedente.Perjuicios));
 }
Example #15
0
        protected Prelacion armarPrelacion(String total, DataTable Movimientos, DataTable Antecedentes)
        {
            String    valor     = txValorBase.Text.Replace('.', ',').ToString();
            Prelacion prelacion = new Prelacion();

            prelacion.IdTramitante      = int.Parse(ddlTramitantes.SelectedValue.ToString());
            prelacion.NombreTitular     = txNombreTitular.Text;
            prelacion.DescripcionBien   = txDescripcion.Text;
            prelacion.NumeroEscritura   = txNumeroEscritura.Text;
            prelacion.ValorInmueble     = Convert.ToDecimal(valor);
            prelacion.Folio             = txFolio.Text;
            prelacion.Total             = Convert.ToDecimal(total);
            prelacion.Status            = "RECEPCION";
            prelacion.Fecha             = txFecha.Text;
            prelacion.LugarOtorgamiento = txLugarOtorg.Text;
            prelacion.TipoDocumento     = txTipoDocto.Text;
            prelacion.TipoMoneda        = txMoneda.Text;
            prelacion.FechaDocumento    = txFechaOtorg.Text;
            //agregar Actos.
            prelacion.ActosPrelacion = new List <Movimientos>();
            foreach (DataRow row in Movimientos.Rows)
            {
                Movimientos mov = new Movimientos();
                mov.ClaveActo = int.Parse(row["Acto"].ToString());
                mov.Clave     = int.Parse(row["Movimiento"].ToString());
                mov.Importe   = Convert.ToDecimal(row["Subtotal"].ToString());
                prelacion.ActosPrelacion.Add(mov);
            }
            //agregarantecedentes
            prelacion.Antecedentes = new List <Antecedente>();
            foreach (DataRow row in Antecedentes.Rows)
            {
                Antecedente ant = new Antecedente();
                ant.Libro    = row["Libro"].ToString();
                ant.Tomo     = row["Tomo"].ToString();
                ant.Semestre = row["Semestre"].ToString();
                ant.Seccion  = row["Seccion"].ToString();
                ant.Serie    = row["Serie"].ToString();
                ant.Partida  = row["Partida"].ToString();
                ant.Año      = row["Año"].ToString();
                ant.Folio    = row["Folio"].ToString();
                prelacion.Antecedentes.Add(ant);
            }

            return(prelacion);
        }
Example #16
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            Antecedente a = new Antecedente();

            if (ddlBLTS.SelectedValue.Equals("Libro"))
            {
                a.Libro = txBLibro.Text;
            }
            if (ddlBLTS.SelectedValue.Equals("Tomo"))
            {
                a.Tomo = txBLibro.Text;
            }
            if (ddlBLTS.SelectedValue.Equals("Semestre"))
            {
                a.Semestre = ddlBSemestre.SelectedValue.ToString();
                a.Año      = txBASem.Text;
            }
            else
            {
                a.Seccion = ddlBSeccion.SelectedValue.ToString();
                a.Serie   = ddlBSerie.SelectedValue.ToString();
            }
            a.Partida = txBPartida.Text;
            a.Folio   = txBFolioA.Text;

            bAntecedentes = (List <Antecedente>)Session["bAntecedentes"];
            bAntecedentes.Add(a);

            Session["bAntecedentes"]   = bAntecedentes;
            gvBAntecedentes.DataSource = bAntecedentes;
            gvBAntecedentes.DataBind();

            ddlBLTS.SelectedIndex      = 0;
            ddlBSemestre.SelectedIndex = 0;
            ddlBSeccion.SelectedIndex  = 0;
            ddlBSerie.SelectedIndex    = 0;
            txBASem.Text    = "";
            txBLibro.Text   = "";
            txBPartida.Text = "";
        }
Example #17
0
        public AntecedenteDto MapAntecedenteToDto(AntecedenteDto dto, Antecedente antecedente)
        {
            dto.Id = antecedente.Id;
            dto.ConsejeriaId = antecedente.Consejeria.Id;
            dto.AbortoEspontaneo = antecedente.AbortoEspontaneo;
            dto.AbortoVoluntario = antecedente.AbortoVoluntario;
            dto.Cesareas = antecedente.Cesareas;
            dto.Gestas = antecedente.Gestas;
            dto.PartosVaginal = antecedente.PartosVaginal;

            dto.AHEMAC = antecedente.AHEMAC;
            dto.FalloMAC = antecedente.FalloMAC;
            dto.MACACI = antecedente.MACACI;
            dto.MACACO = antecedente.MACACO;
            dto.MACDIU = antecedente.MACDIU;
            dto.MACImplanteHormonal = antecedente.MACImplanteHormonal;
            dto.MACNoUsa = antecedente.MACNoUsa;
            dto.MACPreservativo = antecedente.MACPreservativo;
            dto.NoUsoMAC = antecedente.NoUsoMAC;
            dto.Observaciones = antecedente.Observaciones;

            return dto;
        }
Example #18
0
 public DataTable AntecedentesVictimas_DevolverPorAntecedente(Antecedente antecedente)
 {
     return(DevolverTabla("AntecedentesVictimas_DevolverPorAntecedente",
                          new SqlParameter("@IdAntecedente", antecedente.Id)));
 }
Example #19
0
        protected RegistroActo armarRegistro(String idPrelacion, String seccion)
        {
            RegistroActo registro = new RegistroActo();

            int tidcalle = 0, tidcolonia = 0, tidnumero = 0;

            int.TryParse(ddlColonia.SelectedValue.ToString(), out tidcolonia);
            if (ddlCalle.SelectedIndex != -1)
            {
                int.TryParse(Ubicacion.ListaCalles(tidcolonia).ElementAt(ddlCalle.SelectedIndex).IdCalle.ToString(), out tidcalle);
            }
            int.TryParse(ddlNum.SelectedValue.ToString(), out tidnumero);

            registro.IdPrelacionActo          = int.Parse(idPrelacion);
            registro.Folio                    = "Folio";
            registro.TipoPredio               = txTipoPredio.Text;
            registro.Superficie               = txSuperficie.Text;
            registro.UnidadSuperficie         = ddlUnidadSup.SelectedValue.ToString();
            registro.UbicacionInmuebleCalle   = tidcalle;
            registro.UbicacionInmuebleColonia = tidcolonia;
            registro.UbicacionInmuebleNumero  = tidnumero;
            registro.ColoniaTexto             = txColonia.Text;
            registro.CalleTexto               = txCalle.Text;
            registro.NumeroExterior           = txExterior.Text;
            registro.NumeroInterior           = txInterior.Text;
            registro.Manzana                  = txManzana.Text;
            registro.Lote                   = txLote.Text;
            registro.Municipio              = int.Parse(ddlMunicipios.SelectedValue.ToString());
            registro.Poblacion              = int.Parse(ddlPoblaciones.SelectedValue.ToString());
            registro.ClaveCatastral         = txClaveCat.Text;
            registro.Norte                  = txNorte.Text;
            registro.Sur                    = txSur.Text;
            registro.Este                   = txEste.Text;
            registro.Oeste                  = txOeste.Text;
            registro.Noreste                = txNoreste.Text;
            registro.Noroeste               = txNoroeste.Text;
            registro.Sureste                = txSureste.Text;
            registro.Suroeste               = txSuroeste.Text;
            registro.FechaRegistro          = txFechaReg.Text;
            registro.RegistroActual         = new Antecedente();
            registro.RegistroActual.Libro   = txLibroR.Text;
            registro.RegistroActual.Seccion = ddlSeccionR.SelectedValue.ToString();
            registro.RegistroActual.Partida = txPartidaR.Text;
            registro.RegistroActual.Serie   = ddlSerie.SelectedValue.ToString();
            registro.Observaciones          = txObservaciones.InnerText.ToString();
            registro.AnotacionActualizada   = txAnotacionActualizada.InnerText.ToString();
            //agregar otorgantes
            DataTable Temporal = (DataTable)Session["tablaOt"];

            registro.Otorgantes = new List <Persona>();
            foreach (DataRow row in Temporal.Rows)
            {
                Persona per = new Persona();
                per.Nombre  = row["Nombre"].ToString();
                per.Paterno = row["Paterno"].ToString();
                per.Materno = row["Materno"].ToString();
                registro.Otorgantes.Add(per);
            }
            //agregar adquirientes
            DataTable Temporal2 = (DataTable)Session["tablaAd"];

            registro.Adquirientes = new List <Persona>();
            foreach (DataRow row in Temporal2.Rows)
            {
                Persona per = new Persona();
                per.Nombre  = row["Nombre"].ToString();
                per.Paterno = row["Paterno"].ToString();
                per.Materno = row["Materno"].ToString();
                registro.Adquirientes.Add(per);
            }
            //agregar anotaciones marginales
            DataTable Temporal3 = (DataTable)Session["tablaAnotaciones"];

            registro.AnotacionesMarginales = new List <Antecedente>();
            foreach (DataRow row in Temporal3.Rows)
            {
                Antecedente ant = new Antecedente();
                ant.Libro    = row["Libro"].ToString();
                ant.Tomo     = row["Tomo"].ToString();
                ant.Seccion  = row["Seccion"].ToString();
                ant.Serie    = row["Serie"].ToString();
                ant.Semestre = row["Semestre"].ToString();
                ant.Año      = row["Año"].ToString();
                ant.Partida  = row["Partida"].ToString();
                registro.AnotacionesMarginales.Add(ant);
            }

            // id_prelacion_acto ; seccion
            switch (seccion)
            {
            case "2":
                registro.TipoPredio = "";
                registro.AnotacionesMarginales.Clear();
                break;

            case "3-1":
                registro.Superficie       = "";
                registro.UnidadSuperficie = "";
                registro.Norte            = "";
                registro.Sur      = "";
                registro.Este     = "";
                registro.Oeste    = "";
                registro.Noreste  = "";
                registro.Noroeste = "";
                registro.Sureste  = "";
                registro.Suroeste = "";
                break;

            case "3-2":
                registro.TipoPredio               = "";
                registro.Superficie               = "";
                registro.UnidadSuperficie         = "";
                registro.UbicacionInmuebleCalle   = 0;
                registro.UbicacionInmuebleColonia = 0;
                registro.UbicacionInmuebleNumero  = 0;
                registro.ColoniaTexto             = "";
                registro.CalleTexto               = "";
                registro.NumeroExterior           = "";
                registro.NumeroInterior           = "";
                registro.Manzana  = "";
                registro.Lote     = "";
                registro.Norte    = "";
                registro.Sur      = "";
                registro.Este     = "";
                registro.Oeste    = "";
                registro.Noreste  = "";
                registro.Noroeste = "";
                registro.Sureste  = "";
                registro.Suroeste = "";
                break;

            case "4":
                registro.TipoPredio               = "";
                registro.Superficie               = "";
                registro.UnidadSuperficie         = "";
                registro.UbicacionInmuebleCalle   = 0;
                registro.UbicacionInmuebleColonia = 0;
                registro.UbicacionInmuebleNumero  = 0;
                registro.ColoniaTexto             = "";
                registro.CalleTexto               = "";
                registro.NumeroExterior           = "";
                registro.NumeroInterior           = "";
                registro.Manzana  = "";
                registro.Lote     = "";
                registro.Norte    = "";
                registro.Sur      = "";
                registro.Este     = "";
                registro.Oeste    = "";
                registro.Noreste  = "";
                registro.Noroeste = "";
                registro.Sureste  = "";
                registro.Suroeste = "";
                registro.Adquirientes.Clear();
                break;
            }

            return(registro);
        }
Example #20
0
 public void Eliminar(Antecedente antecedente)
 {
     servicioWeb.EliminarAntecedente(antecedente);
 }
Example #21
0
 public void Modificar(Antecedente antecedente)
 {
     servicioWeb.ModificarAntecedente(antecedente);
 }
Example #22
0
        public void ModificarAntecedente(Antecedente antecedente)
        {
            if (antecedente == null)
            {
                throw new FaultException(Lenguaje.AntecedenteNoValido);
            }

            var antecedenteModificar = RepositorioAntecedentes.DevolverPorId(antecedente.Id);

            if (antecedenteModificar == null)
            {
                throw new FaultException(Lenguaje.AntecedenteNoExiste);
            }

            if (String.IsNullOrWhiteSpace(antecedente.Nombre))
            {
                throw new FaultException(Lenguaje.NombreNoValido);
            }

            if (String.IsNullOrWhiteSpace(antecedente.Perjuicios))
            {
                throw new FaultException(Lenguaje.PerjuiciosNoValidos);
            }

            if (antecedente.Fecha == null)
            {
                throw new FaultException(Lenguaje.FechaNoValida);
            }

            if (String.IsNullOrWhiteSpace(antecedente.Ubicacion))
            {
                throw new FaultException(Lenguaje.UbicacionNoValida);
            }

            if (antecedente.Estado == null)
            {
                throw new FaultException(Lenguaje.EstadoNoValido);
            }

            if (RepositorioEstados.DevolverPorId(antecedente.Estado.Id) == null)
            {
                throw new FaultException(Lenguaje.EstadoNoValido);
            }

            if (antecedente.Victima == null)
            {
                throw new FaultException(Lenguaje.VictimaNoValida);
            }

            var victima = RepositorioVictimas.DevolverPorId(antecedente.Victima.Id);

            if (victima == null || victima.EstaBorrado == true)
            {
                throw new FaultException(Lenguaje.VictimaNoExiste);
            }

            if (antecedente.Agresor == null)
            {
                throw new FaultException(Lenguaje.AgresorNoValido);
            }

            var agresor = RepositorioAgresores.DevolverPorId(antecedente.Agresor.Id);

            if (agresor == null || agresor.EstaBorrado == true)
            {
                throw new FaultException(Lenguaje.AgresorNoExiste);
            }

            antecedenteModificar.Estado        = antecedente.Estado;
            antecedenteModificar.Nombre        = antecedente.Nombre;
            antecedenteModificar.Victima       = antecedente.Victima;
            antecedenteModificar.Agresor       = antecedente.Agresor;
            antecedenteModificar.Fecha         = antecedente.Fecha;
            antecedenteModificar.Observaciones = antecedente.Observaciones;
            antecedenteModificar.Perjuicios    = antecedente.Perjuicios;
            antecedenteModificar.Ubicacion     = antecedente.Ubicacion;
            antecedenteModificar.Latitud       = antecedente.Latitud;
            antecedenteModificar.Longitud      = antecedente.Longitud;

            RepositorioAntecedentes.Modificar(antecedenteModificar);
        }
Example #23
0
 public void AntecedentesVictimas_EliminarPorAntecedente(Antecedente antecedente)
 {
     EjecutarConsulta("AntecedentesVictimas_EliminarPorAntecedente",
                      new SqlParameter("@IdAntecedente", antecedente.Id));
 }
Example #24
0
 public void AddAntecedente(Proposicao p)
 {
     Antecedente.Add(p);
 }
Example #25
0
 public void AntecedentesVictimas_Insertar(Antecedente antecedente, Victima victima)
 {
     EjecutarConsulta("AntecedentesVictimas_Insertar",
                      new SqlParameter("@IdAntecedente", antecedente.Id),
                      new SqlParameter("@IdVictima", victima.Id));
 }