Ejemplo n.º 1
0
        public NewsListForm()
        {
            InitializeComponent();
            desingerService = DesingerServiceImpl.GetInstance();
            desingerService.AddFormToDesinger(this);

            articleService  = ArticleServiceImpl.GetService();
            listFormService = new ListFormService();

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

            ConnectPanels();
            ConnectForms();

            listFormService.ShowForms();
        }
Ejemplo n.º 2
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();
            }
        }