public virtual int _GetUniqueIdentifier()
        {
            var hashCode = 399326290;

            hashCode = hashCode * -1521134295 + (Id?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Origin?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Destination?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DaysOfWeek?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (PricePerPallet?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (PricePerKilogram?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (PricePerCubicMeter?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TotalAvailableCapacityKG?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (EffectiveFrom?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (EffectiveTo?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TypeOfGoods?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Revision?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (GUID?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ReservedCapacityLaden?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (State?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (BaseId?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Frequency?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TotalAvailableCapacityM3?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TotalAvailableCapacityLaden?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ReservedCapacityKG?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ReservedCapacityM3?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (FixedPrice?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (OriginComments?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DestinationComments?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TruckPlate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (stringenum?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DeliveryDate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Attribute?.GetHashCode() ?? 0);
            return(hashCode);
        }
        public async Task Then_Gets_Course_Epao_From_Mediator(
            int courseId,
            string epaoId,
            GetCourseEpaoResult mediatorResult,
            [Frozen] Mock <IMediator> mockMediator,
            [Greedy] CoursesController controller)
        {
            mockMediator
            .Setup(mediator => mediator.Send(
                       It.Is <GetCourseEpaoQuery>(query => query.CourseId == courseId && query.EpaoId == epaoId),
                       It.IsAny <CancellationToken>()))
            .ReturnsAsync(mediatorResult);

            var controllerResult = await controller.CourseEpao(courseId, epaoId) as ObjectResult;


            controllerResult !.StatusCode.Should().Be((int)HttpStatusCode.OK);
            var model = controllerResult.Value as GetCourseEpaoResponse;

            model !.Course.Should().BeEquivalentTo((GetCourseListItem)mediatorResult.Course);
            model !.Epao.Should().BeEquivalentTo((EpaoDetails)mediatorResult.Epao);
            model !.CourseEpaosCount.Should().Be(mediatorResult.CourseEpaosCount);
            model !.EpaoDeliveryAreas.Should().BeEquivalentTo(
                mediatorResult.EpaoDeliveryAreas.Select(area => (EpaoDeliveryArea)area));
            model !.DeliveryAreas.Should().BeEquivalentTo(
                mediatorResult.DeliveryAreas.Select(item => (GetDeliveryAreaListItem)item));
            model !.EffectiveFrom.Should().Be(mediatorResult.EffectiveFrom);
            model !.AllCourses.Should().BeEquivalentTo(
                mediatorResult.AllCourses.Select(item => (GetCourseListItem)item));
        }
        public async Task Then_Gets_CourseEpao_From_Handler(
            GetCourseEpaoDetailsRequest getRequest,
            GetCourseEpaoResult mediatorResult,
            [Frozen] Mock <IMediator> mockMediator,
            [Frozen] Mock <ILocationStringBuilder> mockLocationStringBuilder,
            [Greedy] CoursesController controller)
        {
            mockMediator
            .Setup(mediator => mediator.Send(
                       It.Is <GetCourseEpaoQuery>(query =>
                                                  query.CourseId == getRequest.Id &&
                                                  query.EpaoId == getRequest.EpaoId),
                       It.IsAny <CancellationToken>()))
            .ReturnsAsync(mediatorResult);

            var result = await controller.CourseEpao(getRequest) as ViewResult;

            var model = result !.Model as CourseEpaoViewModel;

            model !.Course.Should().BeEquivalentTo((CourseListItemViewModel)mediatorResult.Course);
            model !.CourseEpaosCount.Should().Be(mediatorResult.CourseEpaosCount);
            model !.Epao.Should().BeEquivalentTo(new EpaoDetailsViewModel(
                                                     mediatorResult.Epao,
                                                     mediatorResult.EpaoDeliveryAreas,
                                                     mediatorResult.DeliveryAreas,
                                                     mockLocationStringBuilder.Object.BuildLocationString
                                                     ));
            model !.EffectiveFrom.Should().Be(mediatorResult.EffectiveFrom);
            model !.AllCourses.Should().BeEquivalentTo(
                mediatorResult.AllCourses.Select(item => (CourseListItemViewModel)item));
        }
Ejemplo n.º 4
0
        public virtual int _GetUniqueIdentifier()
        {
            var hashCode = 399326290;

            hashCode = hashCode * -1521134295 + (Id?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Origin?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Destination?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DaysOfWeek?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (PricePerPallet?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (PricePerKilogram?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (PricePerCubicMeter?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TotalAvailableCapacityKG?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (EffectiveFrom?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (EffectiveTo?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TypeOfGoods?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (AvailableCapacityLaden?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (CreatedOn?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Frequency?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (IsPrivate.GetHashCode());
            hashCode = hashCode * -1521134295 + (TotalAvailableCapacityLaden?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TotalAvailableCapacityM3?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (AvailableCapacityKG?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (AvailableCapacityM3?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (FixedPrice?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TruckPlate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DeliveryDate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ByRA.GetHashCode());
            return(hashCode);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (ProductId != null)
         {
             hashCode = hashCode * 59 + ProductId.GetHashCode();
         }
         if (EffectiveFrom != null)
         {
             hashCode = hashCode * 59 + EffectiveFrom.GetHashCode();
         }
         if (EffectiveTo != null)
         {
             hashCode = hashCode * 59 + EffectiveTo.GetHashCode();
         }
         if (LastUpdated != null)
         {
             hashCode = hashCode * 59 + LastUpdated.GetHashCode();
         }
         if (ProductCategory != null)
         {
             hashCode = hashCode * 59 + ProductCategory.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (Brand != null)
         {
             hashCode = hashCode * 59 + Brand.GetHashCode();
         }
         if (BrandName != null)
         {
             hashCode = hashCode * 59 + BrandName.GetHashCode();
         }
         if (ApplicationUri != null)
         {
             hashCode = hashCode * 59 + ApplicationUri.GetHashCode();
         }
         if (IsTailored != null)
         {
             hashCode = hashCode * 59 + IsTailored.GetHashCode();
         }
         if (AdditionalInformation != null)
         {
             hashCode = hashCode * 59 + AdditionalInformation.GetHashCode();
         }
         return(hashCode);
     }
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                var hashCode = 41;
                // Suitable nullity checks etc, of course :)
                if (EffectiveFrom != null)
                {
                    hashCode = hashCode * 59 + EffectiveFrom.GetHashCode();
                }
                if (DaysPerWeek != null)
                {
                    hashCode = hashCode * 59 + DaysPerWeek.GetHashCode();
                }
                if (MaxDaysPerWeek != null)
                {
                    hashCode = hashCode * 59 + MaxDaysPerWeek.GetHashCode();
                }
                if (MaxShiftsPerWeek != null)
                {
                    hashCode = hashCode * 59 + MaxShiftsPerWeek.GetHashCode();
                }
                if (MaxConsecutiveDays != null)
                {
                    hashCode = hashCode * 59 + MaxConsecutiveDays.GetHashCode();
                }
                if (MaxConsecutiveDaysRequested != null)
                {
                    hashCode = hashCode * 59 + MaxConsecutiveDaysRequested.GetHashCode();
                }
                if (MaxWorkTimePerDay != null)
                {
                    hashCode = hashCode * 59 + MaxWorkTimePerDay.GetHashCode();
                }
                if (MaxDurationPerShift != null)
                {
                    hashCode = hashCode * 59 + MaxDurationPerShift.GetHashCode();
                }
                if (AdditionalHoursPerWeek != null)
                {
                    hashCode = hashCode * 59 + AdditionalHoursPerWeek.GetHashCode();
                }
                if (MaxOvertimePerDay != null)
                {
                    hashCode = hashCode * 59 + MaxOvertimePerDay.GetHashCode();
                }
                if (MaxOvertimePerWeek != null)
                {
                    hashCode = hashCode * 59 + MaxOvertimePerWeek.GetHashCode();
                }
                if (MaxOvertimePerCalendarMonth != null)
                {
                    hashCode = hashCode * 59 + MaxOvertimePerCalendarMonth.GetHashCode();
                }
                if (WtdDayStart != null)
                {
                    hashCode = hashCode * 59 + WtdDayStart.GetHashCode();
                }
                if (WtdWeekDayStart != null)
                {
                    hashCode = hashCode * 59 + WtdWeekDayStart.GetHashCode();
                }
                if (WtdWeekTimeStart != null)
                {
                    hashCode = hashCode * 59 + WtdWeekTimeStart.GetHashCode();
                }

                hashCode = hashCode * 59 + MinBreakBetweenShifts.GetHashCode();
                if (Notes != null)
                {
                    hashCode = hashCode * 59 + Notes.GetHashCode();
                }
                return(hashCode);
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Returns true if WorkingRestrictionRestrictions instances are equal
        /// </summary>
        /// <param name="other">Instance of WorkingRestrictionRestrictions to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(WorkingRestrictionRestrictions other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     EffectiveFrom == other.EffectiveFrom ||
                     EffectiveFrom != null &&
                     EffectiveFrom.Equals(other.EffectiveFrom)
                     ) &&
                 (
                     DaysPerWeek == other.DaysPerWeek ||
                     DaysPerWeek != null &&
                     DaysPerWeek.Equals(other.DaysPerWeek)
                 ) &&
                 (
                     MaxDaysPerWeek == other.MaxDaysPerWeek ||
                     MaxDaysPerWeek != null &&
                     MaxDaysPerWeek.Equals(other.MaxDaysPerWeek)
                 ) &&
                 (
                     MaxShiftsPerWeek == other.MaxShiftsPerWeek ||
                     MaxShiftsPerWeek != null &&
                     MaxShiftsPerWeek.Equals(other.MaxShiftsPerWeek)
                 ) &&
                 (
                     MaxConsecutiveDays == other.MaxConsecutiveDays ||
                     MaxConsecutiveDays != null &&
                     MaxConsecutiveDays.Equals(other.MaxConsecutiveDays)
                 ) &&
                 (
                     MaxConsecutiveDaysRequested == other.MaxConsecutiveDaysRequested ||
                     MaxConsecutiveDaysRequested != null &&
                     MaxConsecutiveDaysRequested.Equals(other.MaxConsecutiveDaysRequested)
                 ) &&
                 (
                     MaxWorkTimePerDay == other.MaxWorkTimePerDay ||
                     MaxWorkTimePerDay != null &&
                     MaxWorkTimePerDay.Equals(other.MaxWorkTimePerDay)
                 ) &&
                 (
                     MaxDurationPerShift == other.MaxDurationPerShift ||
                     MaxDurationPerShift != null &&
                     MaxDurationPerShift.Equals(other.MaxDurationPerShift)
                 ) &&
                 (
                     AdditionalHoursPerWeek == other.AdditionalHoursPerWeek ||
                     AdditionalHoursPerWeek != null &&
                     AdditionalHoursPerWeek.Equals(other.AdditionalHoursPerWeek)
                 ) &&
                 (
                     MaxOvertimePerDay == other.MaxOvertimePerDay ||
                     MaxOvertimePerDay != null &&
                     MaxOvertimePerDay.Equals(other.MaxOvertimePerDay)
                 ) &&
                 (
                     MaxOvertimePerWeek == other.MaxOvertimePerWeek ||
                     MaxOvertimePerWeek != null &&
                     MaxOvertimePerWeek.Equals(other.MaxOvertimePerWeek)
                 ) &&
                 (
                     MaxOvertimePerCalendarMonth == other.MaxOvertimePerCalendarMonth ||
                     MaxOvertimePerCalendarMonth != null &&
                     MaxOvertimePerCalendarMonth.Equals(other.MaxOvertimePerCalendarMonth)
                 ) &&
                 (
                     WtdDayStart == other.WtdDayStart ||
                     WtdDayStart != null &&
                     WtdDayStart.Equals(other.WtdDayStart)
                 ) &&
                 (
                     WtdWeekDayStart == other.WtdWeekDayStart ||
                     WtdWeekDayStart != null &&
                     WtdWeekDayStart.Equals(other.WtdWeekDayStart)
                 ) &&
                 (
                     WtdWeekTimeStart == other.WtdWeekTimeStart ||
                     WtdWeekTimeStart != null &&
                     WtdWeekTimeStart.Equals(other.WtdWeekTimeStart)
                 ) &&
                 (
                     MinBreakBetweenShifts == other.MinBreakBetweenShifts ||

                     MinBreakBetweenShifts.Equals(other.MinBreakBetweenShifts)
                 ) &&
                 (
                     Notes == other.Notes ||
                     Notes != null &&
                     Notes.Equals(other.Notes)
                 ));
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Returns true if BankingProduct instances are equal
        /// </summary>
        /// <param name="other">Instance of BankingProduct to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BankingProduct other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     ProductId == other.ProductId ||
                     ProductId != null &&
                     ProductId.Equals(other.ProductId)
                     ) &&
                 (
                     EffectiveFrom == other.EffectiveFrom ||
                     EffectiveFrom != null &&
                     EffectiveFrom.Equals(other.EffectiveFrom)
                 ) &&
                 (
                     EffectiveTo == other.EffectiveTo ||
                     EffectiveTo != null &&
                     EffectiveTo.Equals(other.EffectiveTo)
                 ) &&
                 (
                     LastUpdated == other.LastUpdated ||
                     LastUpdated != null &&
                     LastUpdated.Equals(other.LastUpdated)
                 ) &&
                 (
                     ProductCategory == other.ProductCategory ||
                     ProductCategory != null &&
                     ProductCategory.Equals(other.ProductCategory)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     Brand == other.Brand ||
                     Brand != null &&
                     Brand.Equals(other.Brand)
                 ) &&
                 (
                     BrandName == other.BrandName ||
                     BrandName != null &&
                     BrandName.Equals(other.BrandName)
                 ) &&
                 (
                     ApplicationUri == other.ApplicationUri ||
                     ApplicationUri != null &&
                     ApplicationUri.Equals(other.ApplicationUri)
                 ) &&
                 (
                     IsTailored == other.IsTailored ||
                     IsTailored != null &&
                     IsTailored.Equals(other.IsTailored)
                 ) &&
                 (
                     AdditionalInformation == other.AdditionalInformation ||
                     AdditionalInformation != null &&
                     AdditionalInformation.Equals(other.AdditionalInformation)
                 ));
        }
Ejemplo n.º 9
0
        public bool Validate(ProjectContactProxy savedVersion)
        {
            bool        contactChanged = true;
            bool        roleChanged    = true;
            bool        startChanged   = true;
            bool        amendment      = false;
            ClientTeams predecessor    = Predecessor();

            if (savedVersion == null)
            {
                savedVersion = new ProjectContactProxy();
            }                                                                       // Prevents having to check for null each time
            else
            {
                amendment      = true;
                contactChanged = (savedVersion.ContactID != ContactID);
                roleChanged    = (savedVersion.RoleCode != RoleCode);
                startChanged   = (savedVersion.FromDate != FromDate);
            }
            try
            {
                string errorMessage = "";
                if (Contact == null)
                {
                    errorMessage = "Please choose a contact from the list, or use the 'Search' function.|No Contact Selected";
                }
                else if (TeamRole == null)
                {
                    errorMessage = "Please select a project role for the contact.|No Role Selected";
                }
                else if (FromDate == null)
                {
                    errorMessage = "Please enter a date from which this contact is (or was) part of the team.|No Start Date";
                }
                else if (EffectiveTo < FromDate)
                {
                    errorMessage = "The 'To' date cannot be after the 'From' date.|Invalid Dates";
                }
                else if (amendment && (contactChanged || roleChanged) && savedVersion.IsHistoric)
                {
                    errorMessage = "Past team members cannot be amended, except to change their dates.|Historic Record";
                }
                else if (!Contact.Active && FromDate <= Today && EffectiveTo > Today)
                {
                    errorMessage = Contact.ContactName + " is inactive and cannot be part of the current client team now, but can be added for a future date.|Inactive User";
                }
                else if (IsDuplicate())
                {
                    errorMessage = Contact.ContactName + " already has the same role in the project during this period. Please check the existing record.|Duplicate Record";
                }
                else if (HasKeyRole && predecessor == null && FromDate > Project.StartDate)
                {
                    errorMessage = TeamRole.RoleDescription + " is a key role, and is not covered at the start of the project. Please adjust the 'from' date, then (if appropriate) "
                                   + "add an initial " + TeamRole.RoleDescription + " afterwards; the date of this record will then be adjusted automatically.|Key Role Not Covered";
                }
                else if (HasKeyRole && Successor() == null & ToDate != null)
                {
                    errorMessage = TeamRole.RoleDescription + " is a key role, and must always have a current record. Please leave the 'to' date blank, then (if appropriate) "
                                   + "add a subsequent " + TeamRole.RoleDescription + " afterwards; the date of this record will then be adjusted automatically.|Key Role Not Covered";
                }
                else if (amendment && roleChanged && savedVersion.HasKeyRole)
                {
                    errorMessage = "The existing role (" + savedVersion.TeamRole.RoleDescription + ") is a key role, and must always be filled during the project. Please ensure "
                                   + "continuity in that role (e.g. by selecting an alternative contact for this record) before changing/adding this contact's new project role.|Key Role Not Covered";
                }
                if (errorMessage != "")
                {
                    MessageFunctions.SplitInvalid(errorMessage);
                    return(false);
                }
            }
            catch (Exception generalException)
            {
                MessageFunctions.Error("Error validating client project team details", generalException);
                return(false);
            }

            try
            {
                MessageFunctions.ClearQuery();
                if (AlreadyOnProject())
                {
                    MessageFunctions.AddQuery(Contact.ContactName + " is already a client team member in a different capacity, or at a different time.");
                }
                if (amendment && (contactChanged || roleChanged) && Project.StartDate < Today.AddMonths(-1))
                {
                    MessageFunctions.AddQuery("This change is more than a month after the start of the project, which suggests an addition rather than amendment is required.");
                }
                if (startChanged && FromDate < Project.StartDate)
                {
                    MessageFunctions.AddQuery("This role starts before the project's official start date (which may be correct if involved in initialising the project).");
                }
                if (startChanged && FromDate > Today.AddYears(1))
                {
                    MessageFunctions.AddQuery("This role starts more than a year in the future.");
                }
                if (HasKeyRole)
                {
                    if (predecessor != null &&
                        ((FromDate != null && (predecessor.FromDate == null || predecessor.FromDate < FromDate))) &&
                        ((ToDate != null && (predecessor.ToDate == null || predecessor.ToDate > ToDate)))
                        )
                    {
                        MessageFunctions.AddQuery("Projects can only have one client " + TeamRole.RoleDescription + " at a time, and this project already has another " + TeamRole.RoleDescription
                                                  + " throughout this period. The existing record will automatically be split into 'before' and 'after' sections.");
                    }
                    else if (ProjectFunctions.SubsumesContact(this)) // Opposite scenario of above
                    {
                        MessageFunctions.AddQuery("Projects can only have one client " + TeamRole.RoleDescription + " at a time, and this period entirely covers an existing " + TeamRole.RoleDescription
                                                  + " record. That record will therefore be automatically deleted, and other existing records' dates adjusted to avoid overlaps.");
                    }
                    else if (RoleOverlap()) // Only if not throwing above - i.e. there is at least one overlap, but no complete replacement or split
                    {
                        MessageFunctions.AddQuery("Projects can only have one client " + TeamRole.RoleDescription + " at a time, and this project already has another " + TeamRole.RoleDescription
                                                  + " during part of this period. Existing records' dates will be automatically adjusted to avoid overlaps.");
                    }
                    if (predecessor != null && predecessor.ToDate != null && EffectiveFrom.AddDays(-1) > predecessor.ToDate)
                    {
                        MessageFunctions.AddQuery(TeamRole.RoleDescription + " is a key role, but this leaves a gap after the previous incumbent, so that record will be extended automatically. "
                                                  + "If that is not correct please adjust the 'from' date, or (after saving) add another interim record in between; existing dates will be adjusted to fit.");
                    }
                    if (Successor() != null && Successor().FromDate != null && EffectiveTo.AddDays(1) < Successor().FromDate)
                    {
                        MessageFunctions.AddQuery(TeamRole.RoleDescription + " is a key role, but this leaves a gap to the next incumbent, so that record will be extended automatically. "
                                                  + "If that is not correct please adjust the 'to' date, or (after saving) add another interim record in between; existing dates will be adjusted to fit.");
                    }
                }
                return(MessageFunctions.AskQuery(""));
            }
            catch (Exception generalException)
            {
                MessageFunctions.Error("Error validating client project team details", generalException);
                return(false);
            }
            finally
            {
                MessageFunctions.ClearQuery();
            }
        }
Ejemplo n.º 10
0
 public int CompareTo(AbsenceModel other)
 {
     return(EffectiveFrom.CompareTo(other.EffectiveFrom));
 }
 public override void AfterConstruction()
 {
     EffectiveFrom = DateTime.Today.Date;
     EffectiveTo   = EffectiveFrom.AddYears(3);
     base.AfterConstruction();
 }