Ejemplo n.º 1
0
        private void getAndShowDataGridViews()
        {
            //DataGridViewMedia.DataSource = mediaLogic.getAllMedia();
            //DataGridViewDirector.DataSource = mediaLogic.getAllDirectorTable();
            //DataGridViewLanguage.DataSource = mediaLogic.getAllLanguageTable();
            //DataGridViewGenre.DataSource = mediaLogic.getAllGenreTable();

            DataGridViewMedia.DataSource    = ws.getAllMedia();
            DataGridViewDirector.DataSource = ws.getAllDirectorTable();
            DataGridViewLanguage.DataSource = ws.GetAllLanguageTable();
            DataGridViewGenre.DataSource    = ws.GetAllGenreTable();
        }
        public DataGridViewRow activeMediaViewRow = null; //init as no row selected

        public MainMenu()
        {
            InitializeComponent();

            if (currentUser.Userlevel != 1)   // check if user is admin
            {
                isAdmin = true;
            }

            if (!isAdmin)    // depending on user level show different content
            {
                LabelStudentUsername.Text  = currentUser.Username;
                LabelStudentId.Text        = currentUser.Id.ToString();
                LabelAdminUsername.Visible = false;

                PanelMediaLibaryAdminBtns.Visible       = false;
                PanelStudentRowShowAdminContent.Visible = false;
            }
            else
            {
                LabelAdminUsername.Text = "Admin: " + currentUser.Username;
                PanelStudentRowShowStudentContent.Visible = false;
            }



            //inits
            dtFunc = new DTFunc();
            ws     = new WebService.WebService();


            //show all media
            // set data  source for data grid view
            // In this case a List<media>


            //DataGridViewMediaLibary.DataSource = mediaLogic.getAllMedia();
            DataGridViewMediaLibary.DataSource = ws.getAllMedia();
        }
 private void BtnResetMediaLibary_Click(object sender, EventArgs e)
 {
     //DataGridViewMediaLibary.DataSource = mediaLogic.getAllMedia();
     DataGridViewMediaLibary.DataSource = ws.getAllMedia();
 }