Exemplo n.º 1
0
        private void btnUpdateWriter_Click(object sender, EventArgs e)
        {
            if (!TextFieldsAreValid())
            {
                MessageBox.Show(this, "Alanları boş bırakmayınız", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }



            bool updateSuccessful = DbWriter.UpdateWriter(new Writer()
            {
                ID        = Writer.ID,
                FullName  = txtFullName.Text,
                BirthDate = txtBirthDate.Text,
                Country   = txtCountry.Text,
                Genre     = cmbWriterGenre.SelectedItem.ToString()
            });;

            if (updateSuccessful)
            {
                MessageBox.Show(this, "Yazar güncellendi", "Başarılı", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show(this, "Yazar güncellenirken bir hata oldu", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }