public FindController( IPaginatedMetaService paginatedMetaService, WebDbContext Context, IAddresServices Address, WebEventoo_DomainClasses.Services.IExhibitionServices Cermoney, IColorService Color, ICommentService Comment, IEductionservices Eduction, IEventServices Event, WebExhibitionoo_DomainClasses.Services.IExhibitionServices Exhibition, IInformationService Information, IPlaceServices Place ) { FAddressServices = Address; FCermoneyServices = Cermoney; FColorServices = Color; FCommentServices = Comment; FEductionServices = Eduction; FEventServices = Event; FExhibitionServices = Exhibition; FInformtionSErvices = Information; FPlacesServices = Place; context = Context; _paginatedMetaService = paginatedMetaService; }
public DeleteController( WebDbContext Context, IAddresServices Address, WebEventoo_DomainClasses.Services.IExhibitionServices Cermoney, IColorService Color, ICommentService Comment, IEductionservices Eduction, IEventServices Event, INotPublishedServices notpublish, WebExhibitionoo_DomainClasses.Services.IExhibitionServices Exhibition, IInformationService Information, IPlaceServices Place ) { context = Context; FAddressServices = Address; FCermoneyServices = Cermoney; FColorServices = Color; FCommentServices = Comment; FEductionServices = Eduction; FEventServices = Event; FExhibitionServices = Exhibition; FInformtionSErvices = Information; FPlacesServices = Place; FnotPublished = notpublish; }
public IHttpActionResult ListFavorite([FromUri] int userId) { List <PlaceEntity> places = new List <PlaceEntity>(); if (ModelState.IsValid) { try { IPlaceServices placeService = ServiceFactory.getPlaceServices(); places = placeService.GetFavorite(userId); if (places.Count == 0) { return(Ok("Korisnik nema najdražih mjesta!")); } } catch (Exception e) { return(BadRequest(e.Message)); } } else { return(BadRequest("Neispravni podaci")); } return(Ok(places)); }
public HomeController( WebDbContext Context, IAddresServices Address, WebEventoo_DomainClasses.Services.IExhibitionServices Cermoney, IColorService Color, ICommentService Comment, IEductionservices Eduction, IEventServices Event, WebExhibitionoo_DomainClasses.Services.IExhibitionServices Exhibition, IInformationService Information, IHostingEnvironment hostingEnvironment, IReportServices ReportServices, IPlaceServices Place) { FAddressServices = Address; FCermoneyServices = Cermoney; FColorServices = Color; FCommentServices = Comment; FEductionServices = Eduction; FEventServices = Event; FExhibitionServices = Exhibition; FInformtionSErvices = Information; FPlacesServices = Place; FreportServices = ReportServices; context = Context; this._hostingEnvironment = hostingEnvironment; }
public IHttpActionResult ListFilter([FromBody] IDictionary <string, bool> filters, [FromUri] bool active, [FromUri] bool future) { List <PlaceEntity> places = new List <PlaceEntity>(); if (ModelState.IsValid) { try { IPlaceServices placeService = ServiceFactory.getPlaceServices(); places = placeService.GetByFilter(filters, active, future); if (places.Count == 0) { return(Ok("Za zadane uvjete pretrage nema događaja!")); } } catch (Exception e) { return(BadRequest(e.Message)); } } else { return(BadRequest("Neispravni podaci")); } return(Ok(places)); }
public HomeController(UserManager <ApplicationUser> userManager, IPlaceServices placeServices, IImageServices imageServices, IMapper mapper ) { _userManager = userManager; _placesService = placeServices; _imageServices = imageServices; Mapper = mapper; }
public PlacesController( IPlaceServices placeServices, IAddressServices addressService, IFacilitiesServices facilitiesServices, IImageServices imageServices, IMapper mapper, UserManager <ApplicationUser> userManager = null, SignInManager <ApplicationUser> signInManager = null) { _placesService = placeServices; _addressService = addressService; _facilitiesServices = facilitiesServices; _userManager = userManager; _imageServices = imageServices; _signInManager = signInManager; _logger = LogManager.GetCurrentClassLogger(); Mapper = mapper; }
public IHttpActionResult AddNew([FromBody] PlaceEntity place) { int Id = 0; if (ModelState.IsValid) { try { IPlaceServices placeService = ServiceFactory.getPlaceServices(); Id = placeService.Add(place); } catch (Exception e) { return(BadRequest(e.Message)); } } else { return(BadRequest("Neispravni podaci")); } return(Ok(Id)); }
public IHttpActionResult ListAll() { List <PlaceEntity> places = new List <PlaceEntity>(); if (ModelState.IsValid) { try { IPlaceServices placeService = ServiceFactory.getPlaceServices(); places = placeService.GetAll(); } catch (Exception) { return(BadRequest("Neispravni podaci")); } } else { return(BadRequest("Neispravni podaci")); } return(Ok(places)); }