示例#1
0
        private void BtnModificar_Click(object sender, EventArgs e)
        {
            try
            {
                Suppliers supp = new Suppliers();
                supp.Id           = Int32.Parse(txtId.Text);
                supp.CompanyName  = txtCompName.Text;
                supp.ContactName  = textContactName.Text;
                supp.ContactTitle = textContactT.Text;
                supp.Address      = txtAddress.Text;
                supp.City         = txtCity.Text;
                supp.Country      = textCountry.Text;
                supp.CodPostal    = textPostal.Text;
                supp.Phone        = textPhone.Text;
                supp.Fax          = textFax.Text;
                supp.Region       = textRegion.Text;
                supp.HomePage     = textHomeP.Text;

                GestorSupp gs = new GestorSupp();
                gs.modificarDatos(supp);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
            }
        }
示例#2
0
 private void BtnEliminar_Click(object sender, EventArgs e)
 {
     try
     {
         String     idPubli = txtId.Text;
         GestorSupp gs      = new GestorSupp();
         gs.eliminarDatos(idPubli);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.StackTrace);
         MessageBox.Show("El campo que desea eliminar tiene una relacion con otra tabla, no es posible realizar la operacion");
     }
 }