예제 #1
0
        public VisitForm(Project project, Visit visit)
        {
            InitializeComponent();
            _currentVisit = visit;
            _project = project;

            this.Text = project.Name; // putting the project title
            _observations = new List<Observation>();

            var currentdir = AppDomain.CurrentDomain.BaseDirectory + @"../../";
            pbMap.ImageLocation = currentdir + project.FilePath;

            // Loading comboboxes
            cmbBirds.Items.Clear();
            cmbObservationType.Items.Clear();

            foreach (var bird in LogicCollection.BirdLogic.GetAll())
            {
                cmbBirds.Items.Add(bird);
            }
            foreach (var observationType in LogicCollection.ObservationTypeLogic.GetAll())
            {
                cmbObservationType.Items.Add(observationType);
            }
        }
예제 #2
0
 /// <summary>
 /// Opening the form to visit project
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnVisitProject_Click(object sender, EventArgs e)
 {
     if (cmbProjectList.SelectedIndex != -1)
     {
         var selectedProject = (Project) cmbProjectList.SelectedItem;
         var newVisit = new Visit(0, selectedProject.ID, null, DateTime.Now, new DateTime(1999, 01, 01));
         var visitForm = new VisitForm(selectedProject, newVisit);
         visitForm.ShowDialog();
     }
     else
     {
         MessageBox.Show("Uw heeft geen keuze voor een project gemaakt.");
     }
 }
예제 #3
0
파일: Xml.cs 프로젝트: djdino56/PPS2_Fontys
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="visit"></param>
 /// <param name="observations"></param>
 public Xml(Visit visit, List<Observation> observations)
 {
     Visit = visit;
     Observations = observations;
 }
예제 #4
0
 /// <summary>
 /// Insert visit in database
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 public Visit Insert(Visit entity)
 {
     return _context.Insert(entity);
 }
예제 #5
0
 public void InsertVisit()
 {
     var visit = new Visit(0, 2, "Dino Spong", DateTime.Now, DateTime.Now.AddHours(3));
     var insertVisit = LogicCollection.VisitLogic.Insert(visit);
     Assert.IsNotNull(insertVisit, "Inserting an visit failed");
 }