コード例 #1
0
        /// <summary>
        /// Adds the dates of one partner to the accommodation report
        /// </summary>
        /// <param name="AShortTermRow">The short term application row of the current partner</param>
        /// <param name="AAttendeeRow">The attendee row of the current partner</param>
        /// <param name="AStartDate">Start date of the conference</param>
        /// <param name="AEndDate">End date of the conference</param>
        /// <param name="AFromDate">Start date of the report</param>
        /// <param name="AToDate">End date of the report</param>
        /// <param name="AReportDetail">Indicator of the details of the report. Possible options: Brief, Full, Detail</param>
        /// <param name="ASituation">The current report situation</param>
        /// <returns></returns>
        private bool AddPartnerToAccom(PmShortTermApplicationRow AShortTermRow,
            PcAttendeeRow AAttendeeRow,
            DateTime AStartDate, DateTime AEndDate,
            DateTime AFromDate, DateTime AToDate,
            string AReportDetail, ref TRptSituation ASituation)
        {
            // if we have an actual arrival and departure date from the attendee row use it.
            if (AAttendeeRow != null)
            {
                if (!AAttendeeRow.IsActualArrNull())
                {
                    AShortTermRow.Arrival = AAttendeeRow.ActualArr;
                }

                if (!AAttendeeRow.IsActualDepNull())
                {
                    AShortTermRow.Departure = AAttendeeRow.ActualDep;
                }
            }

            if (AShortTermRow.IsArrivalNull())
            {
                AShortTermRow.Arrival = AStartDate;
            }

            if (AShortTermRow.IsDepartureNull())
            {
                AShortTermRow.Departure = AEndDate;
            }

            if ((AShortTermRow.Arrival <= AToDate)
                && (AShortTermRow.Departure >= AFromDate))
            {
                // this short term application covers the dates we examine

                PcRoomAllocTable TempTable = new PcRoomAllocTable();
                PcRoomAllocTable RoomAllocTable;
                PcRoomAllocRow TemplateRow = TempTable.NewRowTyped(false);
                TemplateRow.PartnerKey = AShortTermRow.PartnerKey;
                TemplateRow.ConferenceKey = AShortTermRow.StConfirmedOption;

                RoomAllocTable = PcRoomAllocAccess.LoadUsingTemplate(TemplateRow, ASituation.GetDatabaseConnection().Transaction);

                char Gender;
                int Age;
                string PartnerName;
                GetGenderAndAge(AShortTermRow.PartnerKey, AStartDate, out Gender, out Age, ref ASituation);
                PartnerName = TAccommodationReportCalculation.GetPartnerShortName(AShortTermRow.PartnerKey, ref ASituation);

                foreach (DataRow Row in RoomAllocTable.Rows)
                {
                    CheckRoomAllocation((PcRoomAllocRow)Row, AShortTermRow, AFromDate, AToDate,
                        AReportDetail, Gender, Age, PartnerName, ref ASituation);
                }

                if (RoomAllocTable.Rows.Count == 0)
                {
                    AddNoRoomBooking(AShortTermRow, AFromDate, AToDate, Gender, PartnerName);
                }
            }

            return true;
        }
コード例 #2
0
        /// <summary>
        /// Congress option within a main congress which is charged at fixed rate
        /// Particularly applicable to De Bron when Staff and Ladies occur
        /// The conference rate and arrival/departure need to be adjusted
        /// </summary>
        /// <param name="ASituation"></param>
        /// <param name="AOutreachOption">The unit key of the outreach</param>
        /// <param name="AShortTermerRow">The row of the attendee from the personnel short termer table</param>
        /// <returns></returns>
        private bool GetCongressOptionRates(ref TRptSituation ASituation, long AOutreachOption,
            ref PmShortTermApplicationRow AShortTermerRow)
        {
            PPartnerLocationTable PartnerLocationTable;

            PartnerLocationTable = PPartnerLocationAccess.LoadViaPPartner(AOutreachOption, ASituation.GetDatabaseConnection().Transaction);

            if (PartnerLocationTable.Rows.Count < 1)
            {
                return false;
            }

            PPartnerLocationRow PartnerLocationRow = (PPartnerLocationRow)PartnerLocationTable.Rows[0];

            FAttendeeStartDate = PartnerLocationRow.DateEffective.Value;
            FAttendeeEndDate = PartnerLocationRow.DateGoodUntil.Value;

            // Update arrival and departure dates if none have been entered yet,
            // either in the application travel details or the actual arrival at the conference
            if (AShortTermerRow.IsArrivalNull())
            {
                AShortTermerRow.Arrival = FAttendeeStartDate;
            }

            if (AShortTermerRow.IsDepartureNull())
            {
                AShortTermerRow.Departure = FAttendeeEndDate;
            }

            PcConferenceCostTable ConferenceCostTable;

            ConferenceCostTable = PcConferenceCostAccess.LoadByPrimaryKey(AOutreachOption,
                FAttendeeDays, ASituation.GetDatabaseConnection().Transaction);

            if (ConferenceCostTable.Rows.Count > 0)
            {
                FConferenceRate = (decimal)ConferenceCostTable.Rows[0][PcConferenceCostTable.GetChargeDBName()];
            }

            return true;
        }
コード例 #3
0
        /// <summary>
        /// Get the missing information of a short term application partner.
        /// This could be Passport, Date of Birth, Gender, Mother Tongue, Emergency Contact, Event, Travel information
        /// </summary>
        /// <param name="APartnerKey">Partner Key</param>
        /// <param name="AApplicationKey">Application Key</param>
        /// <param name="ARegistrationOffice">Registration Office</param>
        /// <returns>String of all the missing informations for this partner and application</returns>
        private String GetMissingInfo(Int64 APartnerKey, int AApplicationKey, Int64 ARegistrationOffice)
        {
            String MissingInfo = "";
            PmPassportDetailsTable      PassportTable;
            PPersonTable                PersonTable;
            PPartnerTable               PartnerTable;
            PPartnerRelationshipTable   PartnerRelationshipTable;
            PmShortTermApplicationTable ShortTermApplicationTable;

            // Check for passport Details
            PassportTable = PmPassportDetailsAccess.LoadViaPPerson(APartnerKey, situation.GetDatabaseConnection().Transaction);
            bool PassportDetailMissing = true;

            for (int Counter = 0; Counter < PassportTable.Rows.Count; ++Counter)
            {
                PmPassportDetailsRow row = (PmPassportDetailsRow)PassportTable.Rows[Counter];

                if (row.FullPassportName.Length > 0)
                {
                    PassportDetailMissing = false;
                }
            }

            if (PassportDetailMissing)
            {
                MissingInfo += " Passport Details,";
            }

            // Check for Date of Birth and Gender
            PersonTable = PPersonAccess.LoadByPrimaryKey(APartnerKey, situation.GetDatabaseConnection().Transaction);

            if (PassportTable.Rows.Count == 0)
            {
                MissingInfo += " Date of Birth, Gender,";
            }
            else
            {
                PPersonRow PersonRow = (PPersonRow)PersonTable.Rows[0];

                if (PersonRow.IsDateOfBirthNull())
                {
                    MissingInfo += " Date of Birth,";
                }

                if (PersonRow.Gender == "Unknown")
                {
                    MissingInfo += " Gender,";
                }
            }

            // Check for mother tongue
            PartnerTable = PPartnerAccess.LoadByPrimaryKey(APartnerKey, situation.GetDatabaseConnection().Transaction);

            if (PassportTable.Rows.Count == 0)
            {
                MissingInfo += " Mother Tongue,";
            }
            else if (((PPartnerRow)PartnerTable.Rows[0]).LanguageCode == "99")
            {
                MissingInfo += " Mother Tongue,";
            }

            // Check for partner relationship
            PartnerRelationshipTable = PPartnerRelationshipAccess.LoadViaPPartnerRelationKey(APartnerKey,
                                                                                             situation.GetDatabaseConnection().Transaction);

            bool HasEmergencyContact = false;

            for (int Counter = 0; Counter < PartnerRelationshipTable.Rows.Count; ++Counter)
            {
                PPartnerRelationshipRow Row = (PPartnerRelationshipRow)PartnerRelationshipTable.Rows[Counter];

                if (Row.PartnerKey == 0)
                {
                    continue;
                }

                if ((Row.RelationName == "PAREND") ||
                    (Row.RelationName == "GUARDIAN") ||
                    (Row.RelationName == "RELATIVE") ||
                    (Row.RelationName == "EMER-1") ||
                    (Row.RelationName == "EMER-2") ||
                    (Row.RelationName == "NOK-OTHER"))
                {
                    HasEmergencyContact = true;
                    break;
                }
            }

            if (!HasEmergencyContact)
            {
                MissingInfo += " Emergency Contact,";
            }

            // Check for Event and Travel information
            ShortTermApplicationTable = PmShortTermApplicationAccess.LoadByPrimaryKey(APartnerKey,
                                                                                      AApplicationKey, ARegistrationOffice, situation.GetDatabaseConnection().Transaction);

            bool HasEvent      = false;
            bool HasTravelInfo = false;

            for (int Counter = 0; Counter < ShortTermApplicationTable.Rows.Count; ++Counter)
            {
                PmShortTermApplicationRow Row = (PmShortTermApplicationRow)ShortTermApplicationTable.Rows[Counter];

                if (Row.ConfirmedOptionCode != "")
                {
                    HasEvent = true;
                }

                if ((!Row.IsArrivalNull()) &&
                    (!Row.IsDepartureNull()))
                {
                    HasTravelInfo = true;
                }
            }

            if (!HasEvent)
            {
                MissingInfo += " Event,";
            }

            if (!HasTravelInfo)
            {
                MissingInfo += "Travel Information,";
            }

            // remove the last ,
            if (MissingInfo.Length > 0)
            {
                MissingInfo.Remove(MissingInfo.Length - 1);
            }

            return(MissingInfo);
        }
コード例 #4
0
        /// <summary>
        /// Adds the dates of one partner to the accommodation report
        /// </summary>
        /// <param name="AShortTermRow">The short term application row of the current partner</param>
        /// <param name="AAttendeeRow">The attendee row of the current partner</param>
        /// <param name="AStartDate">Start date of the conference</param>
        /// <param name="AEndDate">End date of the conference</param>
        /// <param name="AFromDate">Start date of the report</param>
        /// <param name="AToDate">End date of the report</param>
        /// <param name="AReportDetail">Indicator of the details of the report. Possible options: Brief, Full, Detail</param>
        /// <param name="ASituation">The current report situation</param>
        /// <returns></returns>
        private bool AddPartnerToAccom(PmShortTermApplicationRow AShortTermRow,
                                       PcAttendeeRow AAttendeeRow,
                                       DateTime AStartDate, DateTime AEndDate,
                                       DateTime AFromDate, DateTime AToDate,
                                       string AReportDetail, ref TRptSituation ASituation)
        {
            // if we have an actual arrival and departure date from the attendee row use it.
            if (AAttendeeRow != null)
            {
                if (!AAttendeeRow.IsActualArrNull())
                {
                    AShortTermRow.Arrival = AAttendeeRow.ActualArr;
                }

                if (!AAttendeeRow.IsActualDepNull())
                {
                    AShortTermRow.Departure = AAttendeeRow.ActualDep;
                }
            }

            if (AShortTermRow.IsArrivalNull())
            {
                AShortTermRow.Arrival = AStartDate;
            }

            if (AShortTermRow.IsDepartureNull())
            {
                AShortTermRow.Departure = AEndDate;
            }

            if ((AShortTermRow.Arrival <= AToDate) &&
                (AShortTermRow.Departure >= AFromDate))
            {
                // this short term application covers the dates we examine

                PcRoomAllocTable TempTable = new PcRoomAllocTable();
                PcRoomAllocTable RoomAllocTable;
                PcRoomAllocRow   TemplateRow = TempTable.NewRowTyped(false);
                TemplateRow.PartnerKey    = AShortTermRow.PartnerKey;
                TemplateRow.ConferenceKey = AShortTermRow.StConfirmedOption;

                RoomAllocTable = PcRoomAllocAccess.LoadUsingTemplate(TemplateRow, ASituation.GetDatabaseConnection().Transaction);

                char   Gender;
                int    Age;
                string PartnerName;
                GetGenderAndAge(AShortTermRow.PartnerKey, AStartDate, out Gender, out Age, ref ASituation);
                PartnerName = TAccommodationReportCalculation.GetPartnerShortName(AShortTermRow.PartnerKey, ref ASituation);

                foreach (DataRow Row in RoomAllocTable.Rows)
                {
                    CheckRoomAllocation((PcRoomAllocRow)Row, AShortTermRow, AFromDate, AToDate,
                                        AReportDetail, Gender, Age, PartnerName, ref ASituation);
                }

                if (RoomAllocTable.Rows.Count == 0)
                {
                    AddNoRoomBooking(AShortTermRow, AFromDate, AToDate, Gender, PartnerName);
                }
            }

            return(true);
        }