Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            List <String> companies = GestorSupplier.filtrarCompanies();


            dataGridView1.ColumnCount          = 2;
            dataGridView1.ColumnHeadersVisible = true;

            DataGridViewCellStyle columnHeaderStyle = new DataGridViewCellStyle();

            columnHeaderStyle.BackColor = Color.Beige;
            columnHeaderStyle.Font      = new Font("Verdana", 8, FontStyle.Regular);
            dataGridView1.ColumnHeadersDefaultCellStyle = columnHeaderStyle;

            dataGridView1.Rows.Clear();

            foreach (var i in companies)
            {
                IQueryable <Suppliers> sup = GestorSupplier.filtrarXNombreCompañia(i);
                foreach (var j in sup)
                {
                    dataGridView1.Rows.Add(j.SupplierID, j.CompanyName);
                }
            }
        }
Beispiel #2
0
 private void button3_Click(object sender, EventArgs e)
 {
     supplier            = new Suppliers();
     supplier.SupplierID = Int32.Parse(txtId.Text);
     GestorSupplier.eliminar(supplier);
     supplier = null;
     mostrarDatos();
 }
Beispiel #3
0
 private void btn_Modificar_Click(object sender, EventArgs e)
 {
     supplier              = new Suppliers();
     supplier.SupplierID   = Int32.Parse(txtId.Text);
     supplier.CompanyName  = txtCName.Text;
     supplier.ContactName  = txtContactName.Text;
     supplier.ContactTitle = txtContactTitle.Text;
     supplier.Address      = txtAddress.Text;
     supplier.City         = txtCName.Text;
     supplier.Region       = txtRegion.Text;
     supplier.PostalCode   = txtPostalCode.Text;
     supplier.Country      = txtCountry.Text;
     supplier.Phone        = txtPhone.Text;
     supplier.Fax          = txtFax.Text;
     supplier.HomePage     = txtHomePage.Text;
     GestorSupplier.actualizar(supplier, supplier.SupplierID);
     supplier = null;
     mostrarDatos();
 }