Exemple #1
0
        public GestaoOficina()
        {
            InitializeComponent();

            DealerShip = new DealerModelContainer();

            listBoxCLientes.DataSource = DealerShip.ClienteSet.ToList();

            DealerShip = new DealerModelContainer();
        }
 private void buttonFiltrar_Click(object sender, EventArgs e)
 {
     if (textBoxFilter.Text.Length > 0)
     {
         bindingNavigatorAddNewItem.Enabled = false;
         DealerShip.Dispose();
         DealerShip = new DealerModelContainer();
         (from pessoa in DealerShip.ClienteSet
          where pessoa.Nome.ToUpper().Contains(textBoxFilter.Text.ToUpper())
          orderby pessoa.Nome
          select pessoa).ToList();
         clienteBindingSource.DataSource = DealerShip.ClienteSet.Local.ToBindingList();
     }
     else
     {
         bindingNavigatorAddNewItem.Enabled = true;
         DealerShip.Dispose();
         DealerShip = new DealerModelContainer();
         (from pessoa in DealerShip.ClienteSet
          orderby pessoa.Nome
          select pessoa).Load();
         clienteBindingSource.DataSource = DealerShip.ClienteSet.Local.ToBindingList();
     }
 }
        public GestaoCliente()
        {
            InitializeComponent();

            DealerShip = new DealerModelContainer();
        }