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(); }
public FormImagenes(int productoId, string nombre) { InitializeComponent(); _productoId = productoId; _nombre = nombre; _imagenRepository = new ImagenRepository(); }
public FormMain() { InitializeComponent(); _productoRepository = new ProductoRepository(); _IngredienteRepository = new IngredienteRepository(); _InstruccionRepository = new InstruccionRepository(); _ImagenRepository = new ImagenRepository(); imagenpath = ConfigurationManager.AppSettings["LogoPath"].ToString(); }
private async void consultas_Load(object sender, EventArgs e) { _productoRepository = new ProductoRepository(); _imagenRepository = new ImagenRepository(); _ingredienteRepository = new IngredienteRepository(); _instruccionRepository = new InstruccionRepository(); await CargarProductos(); }
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(); }
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; } }