Example #1
0
        private void buttonUpdateauthor_Click(object sender, EventArgs e)
        {
            if ((textBoxFirstName.Text == "") || (textBoxLastName.Text == "") || (textBoxEmail.Text == ""))

            {
                MessageBox.Show("Please fill all the fields ", "Missing Data");
                textBoxNamePublisher.Clear();
                textBoxNamePublisher.Focus();
                return;
            }
            else
            {
                Author auth = new Author();
                auth.AuthorID = Convert.ToInt32(textBoxAuthorID.Text);
                auth.FName    = textBoxFirstName.Text;
                auth.LName    = textBoxLastName.Text;
                auth.Email    = textBoxEmail.Text;
                DialogResult ans = MessageBox.Show("Do you really want to update this author?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                if (ans == DialogResult.Yes)
                {
                    AuthorDA.Update(auth);
                    MessageBox.Show("author record has been updated successfully", "Confirmation");
                }
                textBoxAuthorID.Enabled = true;
                ClearAll3();
            }
        }
Example #2
0
        //Update
        private void buttonAutUpd_Click(object sender, EventArgs e)
        {
            AuthorDA.Update(createAuthor());
            AuthorDA.ListAuthors(listViewAuthor);

            UpdateComboBoxes();
        }
 private void buttonUpdateAuthor_Click(object sender, EventArgs e)
 {
     if (IsValidAuthorData())
     {
         Author author = new Author();
         author.AuthorID  = Convert.ToInt32(textBoxAuthorID.Text);
         author.FirstName = textBoxFirstNameAuthor.Text;
         author.LastName  = textBoxLastNameAuthor.Text;
         DialogResult ans = MessageBox.Show("Do you really want to update this Employee?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
         if (ans == DialogResult.Yes)
         {
             AuthorDA.Update(author);
             MessageBox.Show("Author record has been updated successfully", "Confirmation");
             ClearAll();
             textBoxAuthorID.Enabled = true;
         }
     }
 }
Example #4
0
 public void Update(Author author)
 {
     authorDA.Update(author);
 }