示例#1
0
 private void buttonUpdatePublisher_Click(object sender, EventArgs e)
 {
     if ((textBoxNamePublisher.Text == "") || (textBoxEmailPublisher.Text == "") || (maskedTextBoxPhoneNumber.Text == ""))
     {
         MessageBox.Show("Please fill all the fields ", "Missing Data");
         textBoxNamePublisher.Clear();
         textBoxNamePublisher.Focus();
         return;
     }
     else
     {
         Publisher publi = new Publisher();
         publi.PUBname    = textBoxNamePublisher.Text;
         publi.PUbAddress = textBoxEmailPublisher.Text;
         publi.PUBphone   = maskedTextBoxPhoneNumber.Text;
         DialogResult ans = MessageBox.Show("Do you really want to update this Publisher?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
         if (ans == DialogResult.Yes)
         {
             PublisherDA.Update(publi);
             MessageBox.Show("Publisher record has been updated successfully", "Confirmation");
         }
         textBoxNamePublisher.Enabled = true;
         ClearAll();
     }
 }
        private void buttonUpdatePublisher_Click(object sender, EventArgs e)
        {
            List <Publisher> listP = PublisherDA.ListPublisher();

            if (IsValidPublisherData())
            {
                Publisher publisher = new Publisher();
                publisher.PublisherName    = textBoxPublisherName.Text;
                publisher.PublisherEmail   = textBoxPublisherEmail.Text;
                publisher.PublisherAddress = textBoxAddressPublisher.Text;
                DialogResult ans = MessageBox.Show("Do you really want to update this Publisher?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                if (ans == DialogResult.Yes)
                {
                    PublisherDA.Update(publisher);
                    MessageBox.Show("Publisher record has been updated successfully", "Confirmation");
                    ClearAll();
                    textBoxPublisherName.Enabled = true;
                }
            }
        }
示例#3
0
 public void Update(Publisher publisher)
 {
     publisherDA.Update(publisher);
 }