Exemple #1
0
        /// <summary>
        /// Creates a new pollutant with some characteristics defined
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonNewPollutant_Click(object sender, EventArgs e)
        {
            IGas pollutant = _dataHelper.CreateNewPollutant("Example4 Gas", "Some notes");
            bool success   = _dataHelper.PollutantSetCRatio(pollutant, 0.56); //56% by mass

            success &= _dataHelper.PollutantSetSRatio(pollutant, 0.003);      //0.3% by mass
            success &= _dataHelper.PollutantSetGWP100(pollutant, 1.20);       //120% relatively to CO2
            success &= _dataHelper.DataInsertOrUpdatePollutant(pollutant);

            if (success)
            {
                MessageBox.Show("Pollutant named : '" + pollutant.Name + "' inserted in dataset");
            }
            else
            {
                MessageBox.Show("Failure");
            }
        }