private void InitLv() { ListViewItem item = null; var t_proveedores = _proveedoreshelper.GetProveedores(); foreach (var P in t_proveedores.OrderByDescending(x => x.Estado)) { item = this.ProveedoresLV.Items.Add(P.Idproveedor.ToString()); item.SubItems.Add(P.Empresa.ToString()); item.SubItems.Add(P.IdpersonaNavigation.Nombre); item.SubItems.Add(P.IdpersonaNavigation.Apellido); item.SubItems.Add(P.IdpersonaNavigation.Cedula); item.SubItems.Add(P.IdpersonaNavigation.Telefono); item.SubItems.Add(P.IdpersonaNavigation.Email); item.SubItems.Add(P.IdpersonaNavigation.Direccion); if (P.Estado) { item.SubItems.Add("Activo"); item.BackColor = System.Drawing.Color.LightGreen; } else { item.SubItems.Add("Inactivo"); item.BackColor = System.Drawing.Color.IndianRed; } } }
private void Initialize() { this.MarcaCB.DataSource = _marcahelper.Get(); this.MarcaCB.ValueMember = "Idmarca"; MarcaCB.DisplayMember = "Nombre"; this.CategoriaCB.DataSource = _categoriahelper.Get(); CategoriaCB.ValueMember = "Idcategoria"; CategoriaCB.DisplayMember = "Nombre"; this.MedidaCB.DataSource = _presentacionhelper.Get(); this.MedidaCB.ValueMember = "Idpresentacion"; this.MedidaCB.DisplayMember = "Medida"; AutoCompleteStringCollection autoComplete = new AutoCompleteStringCollection(); var Collection = _proveedorhelper.GetProveedores(); foreach (var iter in Collection) { autoComplete.Add($"{iter.IdpersonaNavigation.Nombre} - {iter.Empresa}"); } this.ProveedorCb.DataSource = autoComplete; ProveedorCb.DisplayMember = "autoComplete"; }
private void Init() { //combobox productos AutoCompleteStringCollection autoComplete = new AutoCompleteStringCollection(); var collectionproducts = _productoservices.ConsultProduct(); foreach (var iter in collectionproducts) { autoComplete.Add($"{iter.Nombre} - {iter.IdmarcaNavigation.Nombre}"); } this.ProductoCB.DataSource = autoComplete; ProductoCB.DisplayMember = "autoComplete"; // combobox proveedores AutoCompleteStringCollection auto = new AutoCompleteStringCollection(); var Collection = _proveedorservices.GetProveedores(); foreach (var iter in Collection) { auto.Add($"{iter.IdpersonaNavigation.Nombre} - {iter.Empresa}"); } this.ProveedorCB.DataSource = auto; ProveedorCB.DisplayMember = "auto"; }