private void GetDropCentroCusto() { try { CENTROCUSTOSCollection CENTROCUSTOSColl = new CENTROCUSTOSCollection(); CENTROCUSTOSProvider CENTROCUSTOSP = new CENTROCUSTOSProvider(); CENTROCUSTOSColl = CENTROCUSTOSP.ReadCollectionByParameter(null, "DESCRICAO"); cbCentroCusto.DisplayMember = "DESCRICAO"; cbCentroCusto.ValueMember = "IDCENTROCUSTOS"; CENTROCUSTOSEntity CENTROCUSTOSTy = new CENTROCUSTOSEntity(); CENTROCUSTOSTy.DESCRICAO = ConfigMessage.Default.MsgDrop; CENTROCUSTOSTy.IDCENTROCUSTOS = -1; CENTROCUSTOSColl.Add(CENTROCUSTOSTy); Phydeaux.Utilities.DynamicComparer <CENTROCUSTOSEntity> comparer = new Phydeaux.Utilities.DynamicComparer <CENTROCUSTOSEntity>(cbCentroCusto.DisplayMember); CENTROCUSTOSColl.Sort(comparer.Comparer); cbCentroCusto.DataSource = CENTROCUSTOSColl; } catch (Exception ex) { MessageBox.Show("Erro técnico: " + ex.Message); } }
private void GetDropCentroCusto() { CENTROCUSTOSProvider CENTROCUSTOSP = new CENTROCUSTOSProvider(); CENTROCUSTOSColl = CENTROCUSTOSP.ReadCollectionByParameter(null, "DESCRICAO"); cbCentroCusto.DisplayMember = "DESCRICAO"; cbCentroCusto.ValueMember = "IDCENTROCUSTOS"; CENTROCUSTOSEntity CENTROCUSTOSTy = new CENTROCUSTOSEntity(); CENTROCUSTOSTy.DESCRICAO = ConfigMessage.Default.MsgDrop; CENTROCUSTOSTy.IDCENTROCUSTOS = -1; CENTROCUSTOSColl.Add(CENTROCUSTOSTy); Phydeaux.Utilities.DynamicComparer <CENTROCUSTOSEntity> comparer = new Phydeaux.Utilities.DynamicComparer <CENTROCUSTOSEntity>(cbCentroCusto.DisplayMember); CENTROCUSTOSColl.Sort(comparer.Comparer); cbCentroCusto.DataSource = CENTROCUSTOSColl; cbCentroCusto.SelectedIndex = 0; }
private void Pesquisa() { try { CENTROCUSTOSProvider CENTROCUSTOSP = new CENTROCUSTOSProvider(); RowsFiltroCollection RowRelatorio = new RowsFiltroCollection(); RowRelatorio.Add(new RowsFiltro("DESCRICAO", "System.String", "like", txtNomePesquisa.Text)); CENTROCUSTOSColl = CENTROCUSTOSP.ReadCollectionByParameter(RowRelatorio, "DESCRICAO"); DataGriewSearch.AutoGenerateColumns = false; DataGriewSearch.DataSource = CENTROCUSTOSColl; txtNomePesquisa.Focus(); } catch (Exception) { MessageBox.Show(ConfigMessage.Default.searchFieldType, ConfigSistema1.Default.NomeEmpresa, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); } }