private void GetSuppliers() { SuppliersDAO oDAO = new SuppliersDAO(); proveedores = oDAO.RetrieveAll(); if (proveedores != null) { if (proveedores.Count != 0) { proveedorCmBox.DisplayMember = "CompanyName"; proveedorCmBox.ValueMember = "SupplierID"; proveedorCmBox.DataSource = (from c in proveedores select new { c.SupplierID, c.CompanyName }).ToList(); } } productoTxt.MaxLength = 40; CUnitariaTxt.MaxLength = 20; PUnitarioTxt.MaxLength = 15; UCaminoTxt.MaxLength = 4; SmPermitidoTxt.MaxLength = 4; existenciaTxt.MaxLength = 4; }
private void GetProveedores() { try { SuppliersDAO oDAO = new SuppliersDAO(); proveedores = oDAO.RetrieveAll(); var tmpProveedores = (from prov in proveedores select new { Compañia = prov.CompanyName, Contacto = prov.ContactName, TitContacto = prov.ContactTitle, Direccion = prov.Address, Ciudad = prov.City, //Region = prov.Region, CodigoPostal = prov.PostalCode, Pais = prov.Country, Telefono = prov.Phone }).ToList(); dgvDatos.DataSource = null; dgvDatos.DataSource = tmpProveedores; } catch (Exception e) { MessageBox.Show(e.Message, "MyStoreDesktop"); } }
private void GetSuppliers() { SuppliersDAO oDAO = new SuppliersDAO(); proveedores = oDAO.RetrieveAll(); if (proveedores != null) { if (proveedores.Count != 0) { proveedorCmBox.DisplayMember = "CompanyName"; proveedorCmBox.ValueMember = "SupplierID"; proveedorCmBox.DataSource = (from c in proveedores select new { c.SupplierID, c.CompanyName }).ToList(); } } }