/// <summary> /// SocialMediaSystem on load /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SocialMediaSystemForm_Load(object sender, EventArgs e) { var timeLine = new TimeLine(_user, _event) {Dock = DockStyle.Fill}; tbTimeLine.Controls.Add(timeLine); var makePost = new MakePost(_user, _event) { Anchor = (AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top) }; tbMakePost.Controls.Add(makePost); // Loads the tags section var tbSearch = new TabPage("Zoek op tags"); var searchByTag = new SearchByTag(_user, _event) { Dock = DockStyle.Fill }; tbControlSMSF.TabPages.Add(tbSearch); tbSearch.Controls.Add(searchByTag); // Loads the catalogue var tbMedia = new TabPage("Catalogus"); var catlogue = new Catalogue(_event, _user) { Dock = DockStyle.Fill }; tbControlSMSF.TabPages.Add(tbMedia); tbMedia.Controls.Add(catlogue); // Loads the report section if (_user.Permission == PermissionType.Employee || _user.Permission == PermissionType.Administrator) { TabPage reports = new TabPage("Gerapporteerde Posts"); tbControlSMSF.TabPages.Add(reports); reports.Controls.Add(new ReportSection(_user, _event)); } }
private void SocialMediaSystemForm_Load(object sender, EventArgs e) { if (_user != null) { var timeLine = new TimeLine(_user, _event) {Dock = DockStyle.Fill}; tbTimeLine.Controls.Add(timeLine); var makePost = new MakePost(_user, _event) { Anchor = (AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top) }; tbMakePost.Controls.Add(makePost); } else { var timeLine = new TimeLine(_admin, _event) {Dock = DockStyle.Fill}; tbTimeLine.Controls.Add(timeLine); var makePost = new MakePost(_admin, _event) { Anchor = (AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top) }; tbMakePost.Controls.Add(makePost); TabPage reports = new TabPage("Gerapporteerde Posts"); tbControlSMSF.TabPages.Add(reports); reports.Controls.Add(new ReportSection(_admin, _event)); } var tbSearch = new TabPage("Zoek op tags"); var searchByTag = new SearchByTag(_user, _event) { Dock = DockStyle.Fill }; tbControlSMSF.TabPages.Add(tbSearch); tbSearch.Controls.Add(searchByTag); }