private void BtnCsvInput_Click(object sender, EventArgs e) { DialogResult result = csvOpenFileDialog.ShowDialog(); List <VisitorsInformation> visitorList = new List <VisitorsInformation>(); if (result == DialogResult.OK) { using (var stream = new FileStream(csvOpenFileDialog.FileName, FileMode.Open, FileAccess.Read)) { var cs = new CsvChecker <VisitorsInformation>() { UseTextQualifier = true }; visitorList = cs.ReadFromFile(stream); WriteCheckInDataToFile(visitorList); } } DispInputGridView.Hide(); if (visitorList.Count > 0) { BindingList <VisitorsInformation> bindingList = new BindingList <VisitorsInformation>(visitorList); BindingSource source = new BindingSource(bindingList, null); DispInputGridView.DataSource = source; DispInputGridView.Show(); } }
private void BtnReportGenerate_Click(object sender, EventArgs e) { lblMainMsg.Hide(); newVisitorEntryPanel.Hide(); DispInputGridView.Hide(); if (File.Exists("CheckoutsInformation.csv")) { MainGrpBox.Text = "Report Section"; dispReportPanel.Show(); } else { MessageBox.Show("No visitors Checked Out Today !!!", "Error!"); } }
private void BtnSearch_Click(object sender, EventArgs e) { lblMnlInput.Text = "Visitor Information"; MainGrpBox.Text = "Search Result"; dispReportPanel.Hide(); newVisitorEntryPanel.Hide(); CheckOutTimepicker.Text = ""; DispInputGridView.Hide(); btnSave.Text = "Check Out"; TxtInputPanel.Hide(); string searchValue = txtSearchBox.Text; if (MuseumManagementSystem.Validators.ValidateEmailFormat(searchValue)) { CSVSearch(searchValue); } else { lblMainMsg.Text = "Visitor Not Found!!!"; lblMainMsg.Show(); } }