Beispiel #1
0
 public HomelessAnimalForm(FindingReport findingReport) : this()
 {
     _homelessAnimal    = new HomelessAnimal();
     this.findingReport = findingReport;
     _homelessAnimal.HomelessAnimalId = DataRepository.HomelessAnimal.GetMaxId() + 1;
     _homelessAnimal.Species          = findingReport.Species;
     _homelessAnimal.SpeciesName      = findingReport.SpeciesName;
     IsProtected = true;
 }
Beispiel #2
0
        private void ExcuteUpdate()
        {
            HomelessAnimal homelessAnimal = homelessAnimalBindingSource.Current as HomelessAnimal;

            if (homelessAnimal == null)
            {
                return;
            }

            HomelessAnimalForm form = new HomelessAnimalForm(homelessAnimal);

            form.ShowDialog();
        }
Beispiel #3
0
        private void ExcuteInsert()
        {
            Cursor = Cursors.WaitCursor;
            HomelessAnimal homelessAnimal = new HomelessAnimal();

            homelessAnimal.HomelessAnimalId = DataRepository.HomelessAnimal.GetMaxId() + 1;
            homelessAnimal.Name             = string.Empty;
            homelessAnimal.Age                 = 0;
            homelessAnimal.Feature             = "";
            homelessAnimal.LatestFindingReport = System.DateTime.Today;
            //homelessAnimal.PictureLink = string.Empty;


            HomelessAnimalForm form = new HomelessAnimalForm(homelessAnimal);

            form.ShowDialog();
            Cursor = Cursors.Arrow;
        }
Beispiel #4
0
        private void ExecuteDelete()
        {
            HomelessAnimal homelessAnimal = homelessAnimalBindingSource.Current as HomelessAnimal;

            if (homelessAnimal == null)
            {
                return;
            }
            if (Helpers.Helpers.SureToDelete() == false)
            {
                return;
            }


            DataRepository.HomelessAnimal.Delete(homelessAnimal);

            homelessAnimalBindingSource.Remove(homelessAnimal);
        }
Beispiel #5
0
 public HomelessAnimalForm(HomelessAnimal homelessAnimal) : this()
 {
     _homelessAnimal = homelessAnimal;
 }
Beispiel #6
0
 public HomelessAnimalForm()
 {
     InitializeComponent();
     _homelessAnimal = new HomelessAnimal();
 }