private void GetDropStatus() { //11 Pedido de Venda RowsFiltro FiltroProfile = new RowsFiltro("IDGRUPOSTATUS", "System.Int32", "=", "11"); RowsFiltroCollection Filtro = new RowsFiltroCollection(); cbStatus.DisplayMember = "NOME"; cbStatus.ValueMember = "IDSTATUS"; Filtro.Insert(0, FiltroProfile); STATUSProvider STATUSP = new STATUSProvider(); STATUSCollection STATUSColl = new STATUSCollection(); STATUSColl = STATUSP.ReadCollectionByParameter(Filtro); STATUSEntity STATUSTy = new STATUSEntity(); STATUSTy.NOME = ConfigMessage.Default.MsgDrop; STATUSTy.IDSTATUS = -1; STATUSColl.Add(STATUSTy); Phydeaux.Utilities.DynamicComparer <STATUSEntity> comparer = new Phydeaux.Utilities.DynamicComparer <STATUSEntity>(cbStatus.DisplayMember); STATUSColl.Sort(comparer.Comparer); cbStatus.DataSource = STATUSColl; cbStatus.SelectedIndex = 0; }
private void GetDropStatus() { try { //11 Pedido de Venda RowsFiltro FiltroProfile = new RowsFiltro("IDGRUPOSTATUS", "System.Int32", "=", "11"); RowsFiltroCollection Filtro = new RowsFiltroCollection(); Filtro.Insert(0, FiltroProfile); STATUSCollection STATUSColl2 = new STATUSCollection(); STATUSColl2 = STATUSP.ReadCollectionByParameter(Filtro); cbStatus.DisplayMember = "NOME"; cbStatus.ValueMember = "IDSTATUS"; STATUSEntity STATUSTy = new STATUSEntity(); STATUSTy.NOME = ConfigMessage.Default.MsgDrop; STATUSTy.IDSTATUS = -1; STATUSColl2.Add(STATUSTy); Phydeaux.Utilities.DynamicComparer <STATUSEntity> comparer = new Phydeaux.Utilities.DynamicComparer <STATUSEntity>(cbStatus.DisplayMember); STATUSColl2.Sort(comparer.Comparer); cbStatus.DataSource = STATUSColl2; } catch (Exception ex) { MessageBox.Show("Erro técnico: " + ex.Message); } }