Beispiel #1
0
        public bool SubirInmuebleWeb(int inmuebleId)
        {
            try
            {
                WebHelper       helper    = new WebHelper();
                List <Inmueble> inmuebles = InmuebleDAO.GetInmuebles();
                Inmueble        inmueble  = inmuebles.Find(x => x.Id == inmuebleId);
                int             webId     = helper.InsertInmueble(inmueble);

                inmueble.WebId = webId;
                InmuebleDAO.GuardarInmueble(inmueble);

                List <Foto> fotos = FotoDAO.GetFotosDelInmueble(inmueble.Id);
                foreach (Foto foto in fotos)
                {
                    helper.InsertFoto(foto, inmueble.WebId);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(true);
        }
Beispiel #2
0
 public Foto[] GetFotosDelInmueble(int inmuebleId)
 {
     try
     {
         return(FotoDAO.GetFotosDelInmueble(inmuebleId).ToArray());
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #3
0
 public bool GuardarFoto(Foto foto)
 {
     try
     {
         FotoDAO.CrearFoto(foto);
         return(true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        internal static bool DeleteInmueble(Inmueble inmueble)
        {
            int inmuebleId = inmueble.Id;

            List <Foto> fotos = FotoDAO.GetFotosDelInmueble(inmuebleId);

            for (int i = 0; i < fotos.Count; i++)
            {
                Foto foto = fotos[i];
                DAOBase.DeleteEntity(foto);
            }

            bool pudoEliminar = DAOBase.DeleteEntity(inmueble);

            return(pudoEliminar);
        }