/// <summary>
        /// Gets the row index for the result table to which this room booking refers.
        /// </summary>
        /// <param name="ARow">room booking row</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 int GetRowIndexForRoom(PcRoomAllocRow ARow, string AReportDetail, ref TRptSituation ASituation)
        {
            // Check if this room is already in the table

            String RoomName = ARow.BuildingCode;

            if (AReportDetail != "Brief")
            {
                RoomName = ARow.BuildingCode + " / " + ARow.RoomNumber;
            }

            int RoomRow = -1;

            for (int Counter = 0; Counter < FAccommodationTable.Rows.Count; ++Counter)
            {
                if (FAccommodationTable.Rows[Counter][0].ToString() == RoomName)
                {
                    RoomRow = Counter;
                    break;
                }
            }

            if (RoomRow == -1)
            {
                DataRow NewRow = FAccommodationTable.NewRow();
                NewRow[0]       = RoomName;
                NewRow["Venue"] = TAccommodationReportCalculation.GetPartnerShortName(ARow.VenueKey, ref ASituation);

                FAccommodationTable.Rows.Add(NewRow);
                RoomRow = FAccommodationTable.Rows.Count - 1;
            }

            return(RoomRow);
        }
        /// <summary>
        /// Calculates the cost of the room for one person for the given number of days.
        /// </summary>
        /// <param name="ARow">Room allocation row for the room booking</param>
        /// <param name="ANumberOfBookedDays">number of booked days</param>
        /// <param name="ARoomRow">the row index on the result table to which this calculation refers</param>
        /// <param name="AAge">age of the person who is in the room</param>
        /// <param name="AConferenceKey">conference key of the current conference</param>
        /// <param name="ASituation">The current report situation</param>
        /// <returns></returns>
        private bool CalculateRoomCost(PcRoomAllocRow ARow, int ANumberOfBookedDays, int ARoomRow,
                                       int AAge, long AConferenceKey, ref TRptSituation ASituation)
        {
            PcRoomTable RoomTable;

            RoomTable = PcRoomAccess.LoadByPrimaryKey(ARow.VenueKey, ARow.BuildingCode, ARow.RoomNumber,
                                                      ASituation.GetDatabaseConnection().Transaction);

            if (RoomTable.Rows.Count > 0)
            {
                PcRoomRow RoomRow = (PcRoomRow)RoomTable.Rows[0];

                decimal cost = RoomRow.BedCost * ANumberOfBookedDays;
                decimal ChildDiscount;
                bool    InPercent;

                if (TAccommodationReportCalculation.GetChildDiscount(AAge, AConferenceKey, "ACCOMMODATION", out ChildDiscount, out InPercent,
                                                                     ref ASituation))
                {
                    if (InPercent)
                    {
                        cost = cost * (100 - ChildDiscount) / 100;
                    }
                    else
                    {
                        // At the moment we ignore if the child discount is not set up as percent
                        cost = RoomRow.BedCost * ANumberOfBookedDays;
                    }
                }

                FAccommodationTable.Rows[ARoomRow]["Total Cost"] =
                    (decimal)FAccommodationTable.Rows[ARoomRow]["Total Cost"] + cost;
            }

            return(true);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// all functions for reports in the conference module need to be registered here
        /// </summary>
        /// <param name="ASituation"></param>
        /// <param name="f"></param>
        /// <param name="ops"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public override Boolean FunctionSelector(TRptSituation ASituation, String f, TVariant[] ops, out TVariant value)
        {
            if (base.FunctionSelector(ASituation, f, ops, out value))
            {
                return(true);
            }

            if (StringHelper.IsSame(f, "GetConferenceRoom"))
            {
                value = new TVariant(GetConferenceRoom(ops[1].ToInt64(), ops[2].ToInt64(), ops[3].ToString()));
                return(true);
            }

            if (StringHelper.IsSame(f, "CalculatePartnerAccom"))
            {
                bool ResultValue = false;

                if (FAccommodationReportCalculation != null)
                {
                    ResultValue = FAccommodationReportCalculation.CalculatePartnerAccom(
                        ops[1].ToInt64(), ops[2].ToDate(), ops[3].ToDate(),
                        ops[4].ToDate(), ops[5].ToDate(), ops[6].ToInt64(),
                        ops[7].ToString(), ref situation);
                }

                value = new TVariant(ResultValue);
                return(true);
            }

            if (StringHelper.IsSame(f, "ClearAccomTable"))
            {
                value = new TVariant(true);

                if (FAccommodationReportCalculation != null)
                {
                    FAccommodationReportCalculation = null;
                }

                FAccommodationReportCalculation = new TAccommodationReportCalculation();

                return(true);
            }

            if (StringHelper.IsSame(f, "FinishAccomTable"))
            {
                bool ResultValue = false;

                if (FAccommodationReportCalculation != null)
                {
                    ResultValue = FAccommodationReportCalculation.FinishAccomTable(ops[1].ToString(),
                                                                                   ref situation);
                    // now we don't use FAccommodationReportCalculation any more.
                    FAccommodationReportCalculation = null;
                }

                value = new TVariant(ResultValue);
                return(true);
            }

            if (StringHelper.IsSame(f, "CalculateSingleAttendance"))
            {
                bool ResultValue = false;

                if (FAttendanceSummaryCalculation != null)
                {
                    ResultValue = FAttendanceSummaryCalculation.CalculateSingleAttendance(
                        ops[1].ToInt64(), ops[2].ToInt64(), ops[3].ToDate(),
                        ops[4].ToDate(), ops[5].ToDate(),
                        ops[6].ToDate(), ops[7].ToDate(),
                        ops[8].ToDate(), ops[9].ToDate(), ref situation);
                }

                value = new TVariant(ResultValue);
                return(true);
            }

            if (StringHelper.IsSame(f, "ClearAttendanceTable"))
            {
                FAttendanceSummaryCalculation = new TAttendanceSummaryCalculation(ops[1].ToDate(), ops[2].ToDate());
                value = new TVariant(true);
                return(true);
            }

            if (StringHelper.IsSame(f, "FinishAttendanceTable"))
            {
                bool ResultValue = false;

                if (FAttendanceSummaryCalculation != null)
                {
                    ResultValue = FAttendanceSummaryCalculation.FinishAttendanceTable(ref situation);
                    FAttendanceSummaryCalculation = null;
                }

                value = new TVariant(ResultValue);
                return(true);
            }

            if (StringHelper.IsSame(f, "CalculateNationalities"))
            {
                bool ResultValue = false;

                if (FNationalitySummaryCalculation != null)
                {
                    ResultValue = FNationalitySummaryCalculation.CalculateNationalities(ops[1].ToInt64(),
                                                                                        ops[2].ToString(), ops[3].ToString(), ref situation);
                }

                value = new TVariant(ResultValue);
                return(true);
            }

            if (StringHelper.IsSame(f, "ClearNationalityTable"))
            {
                FNationalitySummaryCalculation = new TNationalitySummaryCalculation();

                value = new TVariant(true);
                return(true);
            }

            if (StringHelper.IsSame(f, "FinishNationalityTable"))
            {
                bool ResultValue = false;

                if (FNationalitySummaryCalculation != null)
                {
                    ResultValue = FNationalitySummaryCalculation.FinishNationalityTable(ref situation);
                    FNationalitySummaryCalculation = null;
                }

                value = new TVariant(ResultValue);
                return(true);
            }

            if (StringHelper.IsSame(f, "CalculateSingleAge"))
            {
                bool ResultValue = false;

                if (FAgeSummaryCalculation != null)
                {
                    ResultValue = FAgeSummaryCalculation.CalculateSingleAge(
                        ops[1].ToDate(), ops[2].ToString(), ref situation);
                }

                value = new TVariant(ResultValue);
                return(true);
            }

            if (StringHelper.IsSame(f, "ClearAgeTable"))
            {
                FAgeSummaryCalculation = new TAgeSummaryCalculation();

                value = new TVariant(true);
                return(true);
            }

            if (StringHelper.IsSame(f, "FinishAgeTable"))
            {
                bool ResultValue = false;

                if (FAgeSummaryCalculation != null)
                {
                    ResultValue            = FAgeSummaryCalculation.FinishAgeTable(ref situation);
                    FAgeSummaryCalculation = null;
                }

                value = new TVariant(ResultValue);
                return(true);
            }

            if (StringHelper.IsSame(f, "CalculateSingleConferenceRole"))
            {
                bool ResultValue = false;

                if (FConferenceRoleCalculation != null)
                {
                    ResultValue = FConferenceRoleCalculation.CalculateSingleConferenceRole(
                        ops[1].ToString(), ops[2].ToInt64(), ops[3].ToString(), ops[4].ToInt64(),
                        ops[5].ToInt64());
                }

                value = new TVariant(ResultValue);
                return(true);
            }

            if (StringHelper.IsSame(f, "ClearConferenceRoleTable"))
            {
                FConferenceRoleCalculation = new TConferenceRoleCalculation();

                value = new TVariant(true);
                return(true);
            }

            if (StringHelper.IsSame(f, "FinishConferenceRoleTable"))
            {
                bool ResultValue = false;

                if (FConferenceRoleCalculation != null)
                {
                    ResultValue = FConferenceRoleCalculation.FinishConferenceRoleTable(
                        ops[1].ToString(), ref situation);
                    FConferenceRoleCalculation = null;
                }

                value = new TVariant(ResultValue);
                return(true);
            }

            if (StringHelper.IsSame(f, "InitFieldCostsCalculation"))
            {
                if (FConferenceFieldCalculation == null)
                {
                    FConferenceFieldCalculation = new TConferenceFieldCalculation(ref situation,
                                                                                  ops[1].ToInt64());
                }

                value = new TVariant(true);
                return(true);
            }

            if (StringHelper.IsSame(f, "ClearFieldCostsCalculation"))
            {
                if (FConferenceFieldCalculation != null)
                {
                    FConferenceFieldCalculation = null;
                }

                value = new TVariant(true);
                return(true);
            }

            if (StringHelper.IsSame(f, "PrintFieldFinancialCosts"))
            {
                bool ResultValue = false;

                if (FConferenceFieldCalculation != null)
                {
                    ResultValue = FConferenceFieldCalculation.PrintFieldFinancialCosts(ref situation, ops[1].ToString());
                }

                value = new TVariant(ResultValue);
                return(true);
            }

            if (StringHelper.IsSame(f, "PrintFinancialSignOffLines"))
            {
                bool ResultValue = false;

                if (FConferenceFieldCalculation != null)
                {
                    ResultValue = FConferenceFieldCalculation.PrintFinancialSignOffLines(ref situation, ops[1].ToString());
                }

                value = new TVariant(ResultValue);
                return(true);
            }

            if (StringHelper.IsSame(f, "PrintAttendanceSignOffLines"))
            {
                bool ResultValue = false;

                if (FConferenceFieldCalculation != null)
                {
                    ResultValue = FConferenceFieldCalculation.PrintAttendanceSignOffLines(ref situation, ops[1].ToString());
                }

                value = new TVariant(ResultValue);
                return(true);
            }

            if (StringHelper.IsSame(f, "PrintEmptyLineInFieldReport"))
            {
                bool ResultValue = false;

                if (FConferenceFieldCalculation != null)
                {
                    ResultValue = FConferenceFieldCalculation.PrintEmptyLineInFieldReport(ref situation);
                }

                value = new TVariant(ResultValue);
                return(true);
            }

            if (StringHelper.IsSame(f, "CalculateOneAttendeeFieldCost"))
            {
                bool ResultValue = false;

                if (FConferenceFieldCalculation != null)
                {
                    String FinanceDetails;
                    String Accommodation;

                    ResultValue = FConferenceFieldCalculation.CalculateOneAttendeeFieldCost(ref situation,
                                                                                            ops[1].ToInt32(), ops[2].ToInt64(), ops[3].ToInt32(), ops[4].ToInt64(),
                                                                                            ops[5].ToInt64(),
                                                                                            ops[6].ToString(), ops[7].ToDate(), out FinanceDetails, out Accommodation);

                    situation.GetParameters().Add("AccommodationCost", new TVariant(Accommodation));
                    situation.GetParameters().Add("FinanceDetails", new TVariant(FinanceDetails));
                }

                value = new TVariant(ResultValue);
                return(true);
            }

            if (StringHelper.IsSame(f, "GetExtraCosts"))
            {
                bool ResultValue = false;

                if (FConferenceFieldCalculation != null)
                {
                    ResultValue = FConferenceFieldCalculation.GetExtraCosts(ref situation, ops[1].ToInt64(),
                                                                            ops[2].ToInt64());
                }

                value = new TVariant(ResultValue);
                return(true);
            }

            if (StringHelper.IsSame(f, "HasReportSendingField"))
            {
                bool ResultValue = false;

                if (FConferenceFieldCalculation != null)
                {
                    ResultValue = FConferenceFieldCalculation.HasReportSendingField(ops[1].ToString());
                }

                value = new TVariant(ResultValue);
                return(true);
            }

            if (StringHelper.IsSame(f, "HasAttendeeReceivingField"))
            {
                bool ResultValue = false;

                if (FConferenceFieldCalculation != null)
                {
                    ResultValue = FConferenceFieldCalculation.HasAttendeeReceivingField(ref situation, ops[1].ToInt64(),
                                                                                        ops[2].ToString());
                }

                value = new TVariant(ResultValue);
                return(true);
            }

            if (StringHelper.IsSame(f, "HasFieldReportDiscount"))
            {
                bool ResultValue = false;

                if (FConferenceFieldCalculation != null)
                {
                    ResultValue = FConferenceFieldCalculation.HasFieldReportDiscount(ops[1].ToString());
                }

                value = new TVariant(ResultValue);
                return(true);
            }

            /*
             * if (isSame(f, 'doSomething')) then
             * begin
             * value := new TVariant();
             * doSomething(ops[1].ToInt(), ops[2].ToString(), ops[3].ToString());
             * exit;
             * end;
             */
            value = new TVariant();
            return(false);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// all functions for reports in the conference module need to be registered here
        /// </summary>
        /// <param name="ASituation"></param>
        /// <param name="f"></param>
        /// <param name="ops"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public override Boolean FunctionSelector(TRptSituation ASituation, String f, TVariant[] ops, out TVariant value)
        {
            if (base.FunctionSelector(ASituation, f, ops, out value))
            {
                return true;
            }

            if (StringHelper.IsSame(f, "GetConferenceRoom"))
            {
                value = new TVariant(GetConferenceRoom(ops[1].ToInt64(), ops[2].ToInt64(), ops[3].ToString()));
                return true;
            }

            if (StringHelper.IsSame(f, "CalculatePartnerAccom"))
            {
                bool ResultValue = false;

                if (FAccommodationReportCalculation != null)
                {
                    ResultValue = FAccommodationReportCalculation.CalculatePartnerAccom(
                        ops[1].ToInt64(), ops[2].ToDate(), ops[3].ToDate(),
                        ops[4].ToDate(), ops[5].ToDate(), ops[6].ToInt64(),
                        ops[7].ToString(), ref situation);
                }

                value = new TVariant(ResultValue);
                return true;
            }

            if (StringHelper.IsSame(f, "ClearAccomTable"))
            {
                value = new TVariant(true);

                if (FAccommodationReportCalculation != null)
                {
                    FAccommodationReportCalculation = null;
                }

                FAccommodationReportCalculation = new TAccommodationReportCalculation();

                return true;
            }

            if (StringHelper.IsSame(f, "FinishAccomTable"))
            {
                bool ResultValue = false;

                if (FAccommodationReportCalculation != null)
                {
                    ResultValue = FAccommodationReportCalculation.FinishAccomTable(ops[1].ToString(),
                        ref situation);
                    // now we don't use FAccommodationReportCalculation any more.
                    FAccommodationReportCalculation = null;
                }

                value = new TVariant(ResultValue);
                return true;
            }

            if (StringHelper.IsSame(f, "CalculateSingleAttendance"))
            {
                bool ResultValue = false;

                if (FAttendanceSummaryCalculation != null)
                {
                    ResultValue = FAttendanceSummaryCalculation.CalculateSingleAttendance(
                        ops[1].ToInt64(), ops[2].ToInt64(), ops[3].ToDate(),
                        ops[4].ToDate(), ops[5].ToDate(),
                        ops[6].ToDate(), ops[7].ToDate(),
                        ops[8].ToDate(), ops[9].ToDate(), ref situation);
                }

                value = new TVariant(ResultValue);
                return true;
            }

            if (StringHelper.IsSame(f, "ClearAttendanceTable"))
            {
                FAttendanceSummaryCalculation = new TAttendanceSummaryCalculation(ops[1].ToDate(), ops[2].ToDate());
                value = new TVariant(true);
                return true;
            }

            if (StringHelper.IsSame(f, "FinishAttendanceTable"))
            {
                bool ResultValue = false;

                if (FAttendanceSummaryCalculation != null)
                {
                    ResultValue = FAttendanceSummaryCalculation.FinishAttendanceTable(ref situation);
                    FAttendanceSummaryCalculation = null;
                }

                value = new TVariant(ResultValue);
                return true;
            }

            if (StringHelper.IsSame(f, "CalculateNationalities"))
            {
                bool ResultValue = false;

                if (FNationalitySummaryCalculation != null)
                {
                    ResultValue = FNationalitySummaryCalculation.CalculateNationalities(ops[1].ToInt64(),
                        ops[2].ToString(), ops[3].ToString(), ref situation);
                }

                value = new TVariant(ResultValue);
                return true;
            }

            if (StringHelper.IsSame(f, "ClearNationalityTable"))
            {
                FNationalitySummaryCalculation = new TNationalitySummaryCalculation();

                value = new TVariant(true);
                return true;
            }

            if (StringHelper.IsSame(f, "FinishNationalityTable"))
            {
                bool ResultValue = false;

                if (FNationalitySummaryCalculation != null)
                {
                    ResultValue = FNationalitySummaryCalculation.FinishNationalityTable(ref situation);
                    FNationalitySummaryCalculation = null;
                }

                value = new TVariant(ResultValue);
                return true;
            }

            if (StringHelper.IsSame(f, "CalculateSingleAge"))
            {
                bool ResultValue = false;

                if (FAgeSummaryCalculation != null)
                {
                    ResultValue = FAgeSummaryCalculation.CalculateSingleAge(
                        ops[1].ToDate(), ops[2].ToString(), ref situation);
                }

                value = new TVariant(ResultValue);
                return true;
            }

            if (StringHelper.IsSame(f, "ClearAgeTable"))
            {
                FAgeSummaryCalculation = new TAgeSummaryCalculation();

                value = new TVariant(true);
                return true;
            }

            if (StringHelper.IsSame(f, "FinishAgeTable"))
            {
                bool ResultValue = false;

                if (FAgeSummaryCalculation != null)
                {
                    ResultValue = FAgeSummaryCalculation.FinishAgeTable(ref situation);
                    FAgeSummaryCalculation = null;
                }

                value = new TVariant(ResultValue);
                return true;
            }

            if (StringHelper.IsSame(f, "CalculateSingleConferenceRole"))
            {
                bool ResultValue = false;

                if (FConferenceRoleCalculation != null)
                {
                    ResultValue = FConferenceRoleCalculation.CalculateSingleConferenceRole(
                        ops[1].ToString(), ops[2].ToInt64(), ops[3].ToString(), ops[4].ToInt64(),
                        ops[5].ToInt64());
                }

                value = new TVariant(ResultValue);
                return true;
            }

            if (StringHelper.IsSame(f, "ClearConferenceRoleTable"))
            {
                FConferenceRoleCalculation = new TConferenceRoleCalculation();

                value = new TVariant(true);
                return true;
            }

            if (StringHelper.IsSame(f, "FinishConferenceRoleTable"))
            {
                bool ResultValue = false;

                if (FConferenceRoleCalculation != null)
                {
                    ResultValue = FConferenceRoleCalculation.FinishConferenceRoleTable(
                        ops[1].ToString(), ref situation);
                    FConferenceRoleCalculation = null;
                }

                value = new TVariant(ResultValue);
                return true;
            }

            if (StringHelper.IsSame(f, "InitFieldCostsCalculation"))
            {
                if (FConferenceFieldCalculation == null)
                {
                    FConferenceFieldCalculation = new TConferenceFieldCalculation(ref situation,
                        ops[1].ToInt64());
                }

                value = new TVariant(true);
                return true;
            }

            if (StringHelper.IsSame(f, "ClearFieldCostsCalculation"))
            {
                if (FConferenceFieldCalculation != null)
                {
                    FConferenceFieldCalculation = null;
                }

                value = new TVariant(true);
                return true;
            }

            if (StringHelper.IsSame(f, "PrintFieldFinancialCosts"))
            {
                bool ResultValue = false;

                if (FConferenceFieldCalculation != null)
                {
                    ResultValue = FConferenceFieldCalculation.PrintFieldFinancialCosts(ref situation, ops[1].ToString());
                }

                value = new TVariant(ResultValue);
                return true;
            }

            if (StringHelper.IsSame(f, "PrintFinancialSignOffLines"))
            {
                bool ResultValue = false;

                if (FConferenceFieldCalculation != null)
                {
                    ResultValue = FConferenceFieldCalculation.PrintFinancialSignOffLines(ref situation, ops[1].ToString());
                }

                value = new TVariant(ResultValue);
                return true;
            }

            if (StringHelper.IsSame(f, "PrintAttendanceSignOffLines"))
            {
                bool ResultValue = false;

                if (FConferenceFieldCalculation != null)
                {
                    ResultValue = FConferenceFieldCalculation.PrintAttendanceSignOffLines(ref situation, ops[1].ToString());
                }

                value = new TVariant(ResultValue);
                return true;
            }

            if (StringHelper.IsSame(f, "PrintEmptyLineInFieldReport"))
            {
                bool ResultValue = false;

                if (FConferenceFieldCalculation != null)
                {
                    ResultValue = FConferenceFieldCalculation.PrintEmptyLineInFieldReport(ref situation);
                }

                value = new TVariant(ResultValue);
                return true;
            }

            if (StringHelper.IsSame(f, "CalculateOneAttendeeFieldCost"))
            {
                bool ResultValue = false;

                if (FConferenceFieldCalculation != null)
                {
                    String FinanceDetails;
                    String Accommodation;

                    ResultValue = FConferenceFieldCalculation.CalculateOneAttendeeFieldCost(ref situation,
                        ops[1].ToInt32(), ops[2].ToInt64(), ops[3].ToInt32(), ops[4].ToInt64(),
                        ops[5].ToInt64(),
                        ops[6].ToString(), ops[7].ToDate(), out FinanceDetails, out Accommodation);

                    situation.GetParameters().Add("AccommodationCost", new TVariant(Accommodation));
                    situation.GetParameters().Add("FinanceDetails", new TVariant(FinanceDetails));
                }

                value = new TVariant(ResultValue);
                return true;
            }

            if (StringHelper.IsSame(f, "GetExtraCosts"))
            {
                bool ResultValue = false;

                if (FConferenceFieldCalculation != null)
                {
                    ResultValue = FConferenceFieldCalculation.GetExtraCosts(ref situation, ops[1].ToInt64(),
                        ops[2].ToInt64());
                }

                value = new TVariant(ResultValue);
                return true;
            }

            if (StringHelper.IsSame(f, "HasReportSendingField"))
            {
                bool ResultValue = false;

                if (FConferenceFieldCalculation != null)
                {
                    ResultValue = FConferenceFieldCalculation.HasReportSendingField(ops[1].ToString());
                }

                value = new TVariant(ResultValue);
                return true;
            }

            if (StringHelper.IsSame(f, "HasAttendeeReceivingField"))
            {
                bool ResultValue = false;

                if (FConferenceFieldCalculation != null)
                {
                    ResultValue = FConferenceFieldCalculation.HasAttendeeReceivingField(ref situation, ops[1].ToInt64(),
                        ops[2].ToString());
                }

                value = new TVariant(ResultValue);
                return true;
            }

            if (StringHelper.IsSame(f, "HasFieldReportDiscount"))
            {
                bool ResultValue = false;

                if (FConferenceFieldCalculation != null)
                {
                    ResultValue = FConferenceFieldCalculation.HasFieldReportDiscount(ops[1].ToString());
                }

                value = new TVariant(ResultValue);
                return true;
            }

            /*
             * if (isSame(f, 'doSomething')) then
             * begin
             * value := new TVariant();
             * doSomething(ops[1].ToInt(), ops[2].ToString(), ops[3].ToString());
             * exit;
             * end;
             */
            value = new TVariant();
            return false;
        }
        /// <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);
        }