예제 #1
0
        private void generateCsvFileButton_Click(object sender, EventArgs e)
        {
            var          dogDataFilterApi = new Api();
            const string versionString    = "_Version";
            const string extension        = ".csv";

            var dofDataFilterApiHelperFunctions = new DogDataFilterApiHelperFunctions();

            dogDataFilterApi.generateCsv(TableVersion.Value.Version1, fileNameTextBox.Text + versionString + "1" + extension,
                                         searchNameTextBox.Text,
                                         dofDataFilterApiHelperFunctions.getTailData(TailHighLessThanThisTextBox.Text, TailHighGreaterThanThisTextBox.Text, TailLowLessThanThisTextBox.Text, TailLowGreaterThanThisTextBox.Text),
                                         dofDataFilterApiHelperFunctions.getEarData(EarHighLessThanThisTextBox.Text, EarHighGreaterThanThisTextBox.Text, EarLowLessThanThisTextBox.Text, EarLowGreaterThanThisTextBox.Text),
                                         dofDataFilterApiHelperFunctions.getNoseData(NoseHighLessThanThisTextBox.Text, NoseHighGreaterThanThisTextBox.Text, NoseLowLessThanThisTextBox.Text, NoseLowGreaterThanThisTextBox.Text),
                                         dofDataFilterApiHelperFunctions.getDateAndTimeData(DateLessThanThisDatePicker.Value, DateGreaterThanThisDatePicker.Value),
                                         dofDataFilterApiHelperFunctions.getLatitudeData(latitudeTextBox.Text, distanceFromLatitudeTextBox.Text),
                                         dofDataFilterApiHelperFunctions.getLongitudeData(longitudeTextBox.Text, distanceFromLongitudeTextBox.Text));

            dogDataFilterApi.generateCsv(TableVersion.Value.Version2, fileNameTextBox.Text + versionString + "2" + extension,
                                         searchNameTextBox.Text,
                                         dofDataFilterApiHelperFunctions.getTailData(TailHighLessThanThisTextBox.Text, TailHighGreaterThanThisTextBox.Text, TailLowLessThanThisTextBox.Text, TailLowGreaterThanThisTextBox.Text),
                                         dofDataFilterApiHelperFunctions.getEarData(EarHighLessThanThisTextBox.Text, EarHighGreaterThanThisTextBox.Text, EarLowLessThanThisTextBox.Text, EarLowGreaterThanThisTextBox.Text),
                                         dofDataFilterApiHelperFunctions.getNoseData(NoseHighLessThanThisTextBox.Text, NoseHighGreaterThanThisTextBox.Text, NoseLowLessThanThisTextBox.Text, NoseLowGreaterThanThisTextBox.Text),
                                         dofDataFilterApiHelperFunctions.getDateAndTimeData(DateLessThanThisDatePicker.Value, DateGreaterThanThisDatePicker.Value),
                                         dofDataFilterApiHelperFunctions.getLatitudeData(latitudeTextBox.Text, distanceFromLatitudeTextBox.Text),
                                         dofDataFilterApiHelperFunctions.getLongitudeData(longitudeTextBox.Text, distanceFromLongitudeTextBox.Text));
        }
예제 #2
0
        private async Task getDataGridViewDataAsync()
        {
            var dogDataFilterApi = new Api();
            var dogDataFilterApiHelperFunctions = new DogDataFilterApiHelperFunctions();

            dataGridView1.DataSource = await Task.Run(() => dogDataFilterApi.getDataTable(dogDataFilterApiHelperFunctions.getTableVersionSelected(version1RadioButton.Checked), searchNameTextBox.Text,
                                                                                          dogDataFilterApiHelperFunctions.getTailData(TailHighLessThanThisTextBox.Text, TailHighGreaterThanThisTextBox.Text, TailLowLessThanThisTextBox.Text, TailLowGreaterThanThisTextBox.Text),
                                                                                          dogDataFilterApiHelperFunctions.getEarData(EarHighLessThanThisTextBox.Text, EarHighGreaterThanThisTextBox.Text, EarLowLessThanThisTextBox.Text, EarLowGreaterThanThisTextBox.Text),
                                                                                          dogDataFilterApiHelperFunctions.getNoseData(NoseHighLessThanThisTextBox.Text, NoseHighGreaterThanThisTextBox.Text, NoseLowLessThanThisTextBox.Text, NoseLowGreaterThanThisTextBox.Text),
                                                                                          dogDataFilterApiHelperFunctions.getDateAndTimeData(DateLessThanThisDatePicker.Value, DateGreaterThanThisDatePicker.Value),
                                                                                          dogDataFilterApiHelperFunctions.getLatitudeData(latitudeTextBox.Text, distanceFromLatitudeTextBox.Text),
                                                                                          dogDataFilterApiHelperFunctions.getLongitudeData(longitudeTextBox.Text, distanceFromLongitudeTextBox.Text)));

            TableRowCountTextBox.Text = "Row Count: " + dataGridView1.RowCount.ToString();
        }