コード例 #1
0
 /// <summary>
 /// Adds a reservation to the list of reservations of this grave locations.
 /// </summary>
 /// <param name="reservation">The reservation to be added.</param>
 /// <returns>Returns true when the reservation has been successfully added, and false when it has failed to add the reservation.</returns>
 public bool AddReservation(Reservation reservation)
 {
     throw new NotImplementedException();
 }
コード例 #2
0
 /// <summary>
 /// Modifies a reservation of this grave location.
 /// To modify, keep the original reservation. Next, modify this reservation. Lastly, call this method with both the unmodified and modified reservation objects.
 /// </summary>
 /// <param name="oldReservation">The old reservation.</param>
 /// <param name="newReservation">The new reservation.</param>
 /// <returns>Returns true when the reservation has been successfully modified, and false when it has failed to modify the reservation.</returns>
 public bool ModifyReservation(Reservation oldReservation, Reservation newReservation)
 {
     throw new NotImplementedException();
 }
コード例 #3
0
        private static Reservation ParseReservation(DataTable dataTable, int graveSpreadID)
        {
            //nb.ID AS NAB_ID, nb.naam AS NAB_NAAM, nb.adres AS NAB_ADRES, nb.postcode AS NAB_POSTCODE, nb.woonplaats AS NAB_WOONPLAATS, nb.aantekening AS NAB_AANTEKENING, c.ID AS CON_ID, c.bestandsnaam AS CON_BESTANDSNAAM, c.plaatsingsdatum AS CON_PLAATSINGSDATUM
            if (dataTable.Rows.Count == 0)
            {
                return null;
            }

            GraveSpread graveSpread = Controller.Cemetery.GraveSpreads.Find(gs => gs.ID == graveSpreadID);

            DataRow firstRow = dataTable.Rows[0];

            int reservationID = (int)firstRow["RES_ID"];
            DateTime reservationstartDate = DateTime.Parse(firstRow["RES_RECHTENVAN"].ToString());
            DateTime reservationEndDate = DateTime.Parse(firstRow["RES_RECHTENTOT"].ToString());
            int durationInYears = (int)firstRow["RES_LOOPTIJD"];
            bool isProlonged = (int)firstRow["RES_ISVERLENGD"] == 1;
            bool areClearingCostsInvoiced = (int)firstRow["RES_RUIMKOSTENGEFACTUREERD"] == 1;

            Reservation reservation = new Reservation(reservationID, graveSpread, reservationstartDate, reservationEndDate, durationInYears, isProlonged, areClearingCostsInvoiced);

            foreach (DataRow row in dataTable.Rows)
            {
                int deceasedID = (int)row["OL_ID"];

                Deceased deceased = reservation.Deceased.Find(d => d.ID == deceasedID);

                if (deceased == null)
                {
                    string deceasedName = row["OL_NAAM"].ToString();
                    string firstNames = row["OL_VOORNAMEN"].ToString();
                    string partnerOf = row["OL_ECHTGENOOTVAN"].ToString();
                    DateTime dateOfBirth = DateTime.Parse(row["OL_GEBOORTEDATUM"].ToString());
                    DateTime deceaseDate = DateTime.Parse(row["OL_OVERLIJDENSDATUM"].ToString());

                    deceased = new Deceased(deceasedID, deceasedName, firstNames, partnerOf, dateOfBirth, deceaseDate);

                    Object survivingRelativeIDUnparsed = row["NAB_ID"];

                    if (survivingRelativeIDUnparsed != null)
                    {
                        int survivingRelativeID = (int)survivingRelativeIDUnparsed;
                    }

                    reservation.AddDeceased(deceased);
                }
            }
        }