示例#1
0
        public bool Update(RCasilla casilla)
        {
            bool Result = false;

            using (var r = new Repositorio <RCasilla>())
            {
                RCasilla item = r.Retrieve(p => p.idSeccion == casilla.idSeccion && p.tipoEleccion == casilla.tipoEleccion && p.idRegistroCasilla != casilla.idRegistroCasilla);
                if (item == null)
                {
                    Result = r.Update(casilla);
                }
                else
                {
                    throw (
                              new Exception("El registro ya existe.")
                              );
                }
            }
            return(Result);
        }
示例#2
0
        public bool Update(Seccione seccione)
        {
            bool Result = false;

            using (var r = new Repositorio <Seccione>())
            {
                Seccione item = r.Retrieve(p => p.seccion == seccione.seccion && p.casilla == seccione.casilla && p.idSeccion != seccione.idSeccion);
                if (item == null)
                {
                    Result = r.Update(seccione);
                }
                else
                {
                    throw (
                              new Exception("La Sección ya existe.")
                              );
                }
            }
            return(Result);
        }
示例#3
0
        public bool Update(Municipio municipio)
        {
            bool Result = false;

            using (var r = new Repositorio <Municipio>())
            {
                Municipio item = r.Retrieve(p => p.nombre == municipio.nombre && p.idMunicipio != municipio.idMunicipio);
                if (item == null)
                {
                    Result = r.Update(municipio);
                }
                else
                {
                    throw (
                              new Exception("El Municipio ya existe.")
                              );
                }
            }
            return(Result);
        }
示例#4
0
        public bool Update(Usuario usuario)
        {
            bool Result = false;

            using (var r = new Repositorio <Usuario>())
            {
                Usuario item = r.Retrieve(p => p.username == usuario.username && p.idUsuario != usuario.idUsuario);
                if (item == null)
                {
                    Result = r.Update(usuario);
                }
                else
                {
                    throw (
                              new Exception("El Usuario ya existe.")
                              );
                }
            }
            return(Result);
        }