Example #1
0
        public void Filter()
        {
            var car  = carName.Text;
            var date = dateCar.Text;

            ListCars.Clear();
            metroPanel3.Controls.OfType <MetroPanel>();
            ListCars = _appCar.List(car, date);
        }
Example #2
0
        private void Carros_Load(object sender, EventArgs e)
        {
            var cars = _appCar.List();
            var count = cars.Count;
            int x = card.Location.X, y = card.Location.Y, i = 0, linhas, colunas = 0;

            if (count % 3 == 0)
            {
                linhas = cars.Count / 3;
            }
            else
            {
                linhas = cars.Count / 3 + 1;
            }
            for (int l = 0; l < linhas; l++, i++, y += 333)
            {
                if (count > 3)
                {
                    colunas = 3;
                }
                else
                {
                    colunas = count + 1;
                }
                for (int c = 0; c < colunas && i < cars.Count; c++, i++, x += 318)
                {
                    panel.Controls.Add(addCard(cars[i], i, x, y));
                }
                x      = card.Location.X;
                count -= 3;
            }
            if (cars.Count == 0)
            {
                record_not_found.Visible = true;
            }
            else
            {
                record_not_found.Visible = false;
            }
            if (User.Id == 0)
            {
                logout.Visible = false;
                login.Visible  = true;
            }
            else
            {
                logout.Visible = true;
                login.Visible  = false;
                email.Text     = User.Name;
            }
        }