Ejemplo n.º 1
0
        private void commentAddButton_Click(object sender, EventArgs e)
        {
            Comment comment = new Comment();

            comment.SetContent(commentTextField.Text);
            comment.SetMovieId(movie.GetId());

            CommentsServiceImpl.GetService().SendComment(comment);
            MoviesServiceImpl.GetService().DownloadMoviesList();
            List <Movie> movies = MoviesServiceImpl.GetService().GetMoviesList();

            Movie update = movies.Find(x => x.GetId() == movie.GetId());

            movie = update;
            SetLabels();
        }
Ejemplo n.º 2
0
        public MoviesListForm()
        {
            InitializeComponent();
            desingerService = DesingerServiceImpl.GetInstance();
            desingerService.AddFormToDesinger(this);


            moviesService   = MoviesServiceImpl.GetService();
            listFormService = new ListFormService();

            DownloadMoviesList();
            listFormService.SetControlButtonsAndLabel(previusPageButton, nextPageButton, pageNumberLabel);
            listFormService.SetInfoPanel(infoLabel);

            ConnectPanels();
            ConnectForms();

            listFormService.ShowForms();
        }
Ejemplo n.º 3
0
        private void DownloadDataFromServer(bool programStart)
        {
            SetProgressBar(10);

            SetText("Pobieranie ogłoszeń...");
            ArticleServiceImpl.GetService();
            SetProgressBar(20);

            SetText("Pobieranie listy filmów...");
            MoviesServiceImpl.GetService();
            SetProgressBar(40);

            SetText("Pobieranie listy sal kinowych...");
            HallsServiceImpl.GetService();
            SetProgressBar(60);

            SetText("Pobieranie listy seansów...");
            SeanceServiceImpl.GetService();
            SetProgressBar(80);

            SetText("Sprawdzanie konta użytkownika...");
            if (programStart == true)
            {
                LoginUserFromData();
            }
            SetProgressBar(100);

            MainUserService mainUserService = MainUserServiceImpl.GetInstance();
            Role            role            = mainUserService.GetUserRole();

            if (role == Role.CUSTOMER)
            {
                DownloadDataForCustomer();
            }
            else if (role == Role.ADMIN)
            {
                DownloadDataForCustomer();
                DownloadDataForAdmin();
            }
        }