Пример #1
0
        // DELETE api/<controller>/5
        public IHttpActionResult Delete(int id)
        {
            var content = new ResponseContent <Arac>(null);

            using (var aracBusiness = new AracBusiness())
            {
                content.Result = aracBusiness.AracSilById(id) ? "1" : "0";

                return(new StandartResult <Arac>(content, Request));
            }
        }
Пример #2
0
        private void btnSeciliSil_Click(object sender, EventArgs e)
        {
            try
            {
                bool success;
                using (var aracBusiness = new AracBusiness())
                {
                    success = aracBusiness.AracSilById(int.Parse(dgAracListesi.CurrentRow.Cells[0].Value.ToString()));
                }
                var message = success ? "Başarıyla silindi" : "Hata oluştu";

                MessageBox.Show(message);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error happened: " + ex.Message);
            }

            aracListele();
            inputTemizle();
        }