private void Button_Click_1(object sender, System.Windows.RoutedEventArgs e) { ACBrFramework.BAL.ACBrBAL balan = new ACBrFramework.BAL.ACBrBAL(); balan.Modelo = (ACBrFramework.BAL.ModeloBal)Enum.Parse(typeof(ACBrFramework.BAL.ModeloBal), cbSat.Text); balan.Porta = cbSat1.Text; try { balan.Ativar(); txtSat.AppendText(balan.LePeso().ToString()); int pes = Convert.ToInt32(balan.LePeso()); if (pes > 0) { List <tb_terminal> ls = new List <tb_terminal>(); ls = term.GetAll().ToList(); ls[0].te_balanca = true; ls[0].te_acbr_bal_marca = cbSat.Text; ls[0].te_acbr_bal_porta = cbSat1.Text; term.AddAllList(ls, false); } if (pes < 0) { txtSat.AppendText("Balança " + balan.Modelo.ToString() + " não Connectada ou com Problemas."); } } catch (System.Exception ex) { txtSat.AppendText(ex.Message); } }