Esempio n. 1
0
        public Graf(GraveSpread graveSpread)
        {
            InitializeComponent();

            this.GraveSpread = graveSpread;
            FindReservation(graveSpread);
            FindGraveLocations(graveSpread);

            BindGUIControls();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="Reservation"/> class.
        /// </summary>
        /// <param name="id">The ID of the reservation.</param>
        /// <param name="graveSpreads">The grave spreads of the reservation.</param>
        /// <param name="graveLayer">The graf layer of the reservation.</param>
        /// <param name="deceased">The deceased person of the reservation.</param>
        /// <param name="startDate">The start date of the reservation.</param>
        /// <param name="endDate">The end date of the reservation.</param>
        /// <param name="durationInYears">The duration in years of the reservation.</param>
        /// <param name="isProlonged">A boolean indicating whether the reservation is prolonged.</param>
        /// <param name="areClearingCostsInvoiced">A boolean indicating whether the reservation has invoiced clearing costs.</param>
        public Reservation(int id, GraveSpread graveSpread, DateTime startDate, DateTime endDate, int durationInYears, bool isProlonged, bool areClearingCostsInvoiced)
        {
            this.ID = id;
            this.GraveSpread = graveSpread;
            this.StartDate = startDate;
            this.EndDate = endDate;
            this.DurationInYears = durationInYears;
            this.IsProlonged = isProlonged;
            this.AreClearingCostsInvoiced = areClearingCostsInvoiced;

            this.Contracts = new List<Contract>();
        }
        private static Cemetery ParseCemetery(DataTable dataTable)
        {

            DataRow firstRow = dataTable.Rows[0];
            int cemeteryID = (int)firstRow["BEG_ID"];
            string name = firstRow["BEG_NAAM"].ToString();
            string address = firstRow["BEG_ADRES"].ToString();
            string postalCode = firstRow["BEG_POSTCODE"].ToString();
            string residence = firstRow["BEG_PLAATS"].ToString();

            int mapID = (int)firstRow["PL_ID"];
            string mapFilePath = firstRow["PL_BESTANDSNAAM"].ToString();
            DateTime mapStartDate = DateTime.Parse(firstRow["PL_STARTDATUM"].ToString());
            DateTime mapEndDate = DateTime.Parse(firstRow["PL_EINDDATUM"].ToString());

            float locationLeftTopX = (float)firstRow["PL_LINKSBOVENX"];
            float locationLeftTopY = (float)firstRow["PL_LINKSBOVENY"];
            float locationRightBottomX = (float)firstRow["PL_RECHTSONDERX"];
            float locationRightBottomY = (float)firstRow["PL_RECHTSONDERY"];

            PointFloat locationLeftTop = new PointFloat(locationLeftTopX, locationLeftTopY);
            PointFloat locationRightBottom = new PointFloat(locationRightBottomX, locationRightBottomY);
            Map map = new Map(mapID, mapFilePath, mapStartDate, mapEndDate, locationLeftTop, locationRightBottom);

            Cemetery cemetery = new Cemetery(cemeteryID, name, address, postalCode, residence, map);

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

                GraveLocation graveLocation = cemetery.GraveLocations.Find(gl => gl.ID == graveLocationID);

                if (graveLocation == null)
                {
                    int graveLocationNumber = (int)row["GL_NUMMER"];
                    int graveLocationSectionNumber = (int)row["GL_VAK"];
                    int graveLocationRowNumber = (int)row["GL_RIJ"];

                    GraveLocationState graveLocationState = (GraveLocationState)Enum.Parse(typeof(GraveLocationState), row["GL_STATUS"].ToString());

                    float graveLocationLocationX = (float)row["GL_COORDINATENX"];
                    float graveLocationLocationY = (float)row["GL_COORDINATENY"];

                    PointFloat graveLocationLocation = new PointFloat(graveLocationLocationX, graveLocationLocationY);

                    graveLocation = new GraveLocation(graveLocationID, graveLocationNumber, graveLocationRowNumber, graveLocationSectionNumber, graveLocationState, graveLocationLocation);

                    cemetery.AddGraveLocation(graveLocation);
                }

                Object gravesSpreadIDUnparsed = row["gs_ID"];

                if (gravesSpreadIDUnparsed != null)
                {
                    int graveSpreadID = (int)row["GS_ID"];

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

                    if (graveSpread == null)
                    {
                        DateTime startTime = DateTime.Parse(row["GS_STARTDATUM"].ToString());
                        DateTime endTime = DateTime.Parse(row["GS_EINDDATUM"].ToString());
                        graveSpread = new GraveSpread(graveSpreadID, startTime, endTime);
                    }

                    graveSpread.AddGraveLocation(graveLocation);
                }
            }

            return cemetery;
        }
Esempio n. 4
0
 private void FindReservation(GraveSpread graveSpread)
 {
     throw new NotImplementedException();
 }
Esempio n. 5
0
 private void FindGraveLocations(GraveSpread graveSpread)
 {
     throw new NotImplementedException();
 }