private void MySecButton_Click(object sender, EventArgs e) { Sections grp = new Sections(); Topics top = new Topics(); grp = DependencyFacade.GetMySection(LoginPanel.albumNumber); if (grp != null && grp.TopicID != null) { top.ID = (int)grp.TopicID; top = DependencyFacade.GetTopicData(top); } MoreInfo mri = new MoreInfo(1, grp, top); mri.ShowDialog(); }
private void AddFileButton_Click(object sender, EventArgs e) { System.Boolean noErrors = false; while (!noErrors) { if (openFileDialog1.ShowDialog() == DialogResult.OK) { switch (Path.GetExtension(openFileDialog1.FileName).ToLower()) { case ".pdf": case ".zip": case ".txt": FilenameLabel.Text = openFileDialog1.SafeFileName; noErrors = true; break; default: MessageBox.Show("Please choose file with pdf/txt extension or archive file.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); break; } file = GetFile(openFileDialog1.FileName); } else { noErrors = true; } } Sections sec = new Sections(); sec = DependencyFacade.GetMySection(LoginPanel.albumNumber); if (sec != null && openFileDialog1.FileName != "") { FileDetails fld = new FileDetails(file, sec.ID, Path.GetExtension(openFileDialog1.FileName).ToLower().Substring(1)); fld.ShowDialog(); } }