예제 #1
0
        public AnuncioServiceIntegrationTest()
        {
            //Arrange
            string                    connectionString         = "Server=HIDEAKIUCHIDA;Database=EVERESTDB;Integrated Security=True;";
            string                    avanticaConnectionString = "Server=LIM-WS00279\\SQLEXPRESS;Database=EVERESTDB;Integrated Security=True;";
            IDbConnection             dbConnection             = new SqlConnection(avanticaConnectionString);
            IAnuncioRepository        anuncioRepository        = new AnuncioRepository(dbConnection);
            IAnuncioDetalleRepository anuncioDetalleRepository = new AnuncioDetalleRepository(dbConnection);
            IUbicacionRepository      ubicacionRepository      = new UbicacionRepository(dbConnection);
            IUsuarioRepository        usuarioRepository        = new UsuarioRepository(dbConnection);
            ITipoPropiedadRepository  tipoPropiedadRepository  = new TipoPropiedadRepository(dbConnection);
            IEvaluacionRepository     evaluacionRepository     = new EvaluacionRepository(dbConnection);
            IImagenRepository         imagenRepository         = new ImagenRepository(dbConnection);
            IMapper                   mapper = new Mapper(
                new MapperConfiguration(
                    configure => { configure.AddProfile <AutoMapperProfiles>(); }
                    )
                );

            _anuncioService = new AnuncioService(anuncioRepository, anuncioDetalleRepository, usuarioRepository,
                                                 tipoPropiedadRepository, ubicacionRepository, evaluacionRepository, imagenRepository, mapper);

            ValidCreacionAnuncioRequest = AnuncioFake.GetCreacionAnuncioRequest();
            ValidEdicionAnuncioRequest  = AnuncioFake.GetEdicionAnuncioRequest();
        }
예제 #2
0
 public FormImagenes(int productoId, string nombre)
 {
     InitializeComponent();
     _productoId       = productoId;
     _nombre           = nombre;
     _imagenRepository = new ImagenRepository();
 }
예제 #3
0
 public FormMain()
 {
     InitializeComponent();
     _productoRepository    = new ProductoRepository();
     _IngredienteRepository = new IngredienteRepository();
     _InstruccionRepository = new InstruccionRepository();
     _ImagenRepository      = new ImagenRepository();
     imagenpath             = ConfigurationManager.AppSettings["LogoPath"].ToString();
 }
예제 #4
0
        private async void consultas_Load(object sender, EventArgs e)
        {
            _productoRepository    = new ProductoRepository();
            _imagenRepository      = new ImagenRepository();
            _ingredienteRepository = new IngredienteRepository();
            _instruccionRepository = new InstruccionRepository();

            await CargarProductos();
        }
예제 #5
0
        public altas()
        {
            InitializeComponent();

            _producto              = new Producto();
            _Ingredientes          = new List <Ingrediente>();
            _Instrucciones         = new List <Instruccion>();
            _productoRepository    = new ProductoRepository();
            _instruccionRepository = new InstruccionRepository();
            _imagenRepository      = new ImagenRepository();
            _ingredienteRepository = new IngredienteRepository();
            _Imagenes              = new List <Imagen>();
            coll = new AutoCompleteStringCollection();
        }
예제 #6
0
        private void onOk(object sender, EventArgs e)
        {
            if (formValidator.Validate())
            {
                try
                {
                    using (ImagenRepository repo = new ImagenRepository())
                    {
                        repo.SaveNew(imagen);
                    }
                }
                catch (BusinessEntityRepositoryException ex)
                {
                    MessageBox.Show(this, ex.Message + ":\n\n" + ex.InnerException.Message,
                        "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                    DialogResult = DialogResult.None;

                    return;
                }

                DialogResult = DialogResult.OK;
            }
        }