Esempio n. 1
0
        private void AnimalListForm_Load(object sender, EventArgs e)
        {
            dgvAnimalList.Rows.Clear();
            User curUser = ProgramMain.currentUser;
            Tuple <List <Animal>, int> result = WebHandeler.getAllAnimals(curUser.shelter_id);
            List <Animal> animalList          = result.Item1;

            foreach (Animal animal in animalList)
            {
                //checks if the picture is set
                if (WebHandeler.getPicture(animal.id).Item2 != -1)
                {
                    dgvAnimalList.Rows.Add(animal.id, animal.name, WebHandeler.getPicture(animal.id).Item1);
                }
                else
                {
                    MessageBox.Show("Error showing picture");
                }
            }
        }