Ejemplo n.º 1
0
 /// <summary>
 /// Constructor - used when an IncidentInfo object HAS been created
 /// </summary>
 /// <param name="incidentNumber">The unique incident number of the incident</param>
 /// <param name="database">The connection to the database that provides functionality for retrieving/updating data</param>
 /// <param name="info">Container object that stores information about the incident</param>
 public Incident(int incidentNumber, IncidentInfo info)
 {
     IncidentNumber = incidentNumber;
     this.database  = Tools.IncidentDB;
     this.info      = info;
     this.view      = new IncidentDataView(incidentNumber, DateTime, Type.Name, Address.Building, Address.Number, Address.Street, Address.Town, Address.Postcode, Operator, StopTime, IncidentClosedTime);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="incidentNo">The unique incident number of the incident</param>
        /// <param name="database">The connection to the database that provides functionality for retrieving/updating data</param>
        public Incident(int incidentNo)
        {
            //assign parameters
            this.database  = Tools.IncidentDB;
            IncidentNumber = incidentNo;

            //retrieve Incident information from the database
            info = database.GetAllDetails(IncidentNumber);

            //find the related incidentDataView object
            this.view = Tools.Incidents.Single(x => x.IncidentNumber == incidentNo);
        }