Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        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;
        }
Exemplo n.º 5
0
        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));
        }
Exemplo n.º 6
0
 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;
        }
Exemplo n.º 8
0
        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));
        }
Exemplo n.º 9
0
        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));
        }