Пример #1
0
        public void UpdateCountryPollution(CountryPollution countryPollution)
        {
            if (countryPollution.ID != 0)
            {
                string sql = "update CountryPollution set Pollution = @Pollution, Year = @Year, CountryId = @CountryId where Id = @Id";

                db.Execute(sql, new { countryPollution.Pollution, countryPollution.Year, countryPollution.CountryId, countryPollution.ID });
            }
        }
Пример #2
0
        public void DeleteCountryPollution(CountryPollution countryPollution)
        {
            string sql = "Delete CountryPollution where Id = @Id";

            db.Execute(sql, new { countryPollution.ID });
        }
Пример #3
0
        public void InsertCountryPollution(CountryPollution countryPollution)
        {
            string sql = "insert into CountryPollution values (@CountryId,@Year,@Pollution)";

            db.Execute(sql, new { countryPollution.CountryId, countryPollution.Year, countryPollution.Pollution });
        }