Esempio n. 1
0
 private Models.Animal GetAnimalDetails(string animalName, int categoryId, string gpsDeviceId)
 {
     Models.Animal animal = new Models.Animal();
     animal.categoryId  = categoryId;
     animal.animalName  = animalName;
     animal.gpsDeviceId = gpsDeviceId;
     return(animal);
 }
Esempio n. 2
0
 /// <summary>
 /// Event handler for delete button click.
 /// </summary>
 /// <param name="sender">Sender Object</param>
 /// <param name="e">Event argument</param>
 private void delete_button_Click(object sender, EventArgs e)
 {
     try
     {
         selectedRow = this.gps_dataGridView.CurrentRow.Index;
         Models.Animal animalToBeDeleted = allAnimalsLocated[selectedRow];
         Models.Animal deletedItem       = AnimalDelegate.DeleteAnimal(animalToBeDeleted.animalId);
         if (deletedItem != null)
         {
             this.gps_dataGridView.Rows.RemoveAt(selectedRow);
             this.gps_dataGridView.Refresh();
             dataGrid();
         }
         PopUp popUpBox = new PopUp(Constants.SUCCESSFUL_ANIMAL_DELETING_MESSAGE);
         popUpBox.ShowDialog();
     }
     catch (Exception ex)
     {
         PopUp popUpBox = new PopUp(Constants.ERROR_ANIMAL_DELETING_MESSAGE);
         popUpBox.ShowDialog();
         log.Error(string.Format("Error in delete animal from server {0}", ex.Message));
         this.SuspendLayout();
     }
 }