/// <summary>
        /// Returns true if LocalAreaRotationList instances are equal
        /// </summary>
        /// <param name="other">Instance of LocalAreaRotationList to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(LocalAreaRotationList other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id.Equals(other.Id)
                     ) &&
                 (
                     DistrictEquipmentType == other.DistrictEquipmentType ||
                     DistrictEquipmentType != null &&
                     DistrictEquipmentType.Equals(other.DistrictEquipmentType)
                 ) &&
                 (
                     LocalArea == other.LocalArea ||
                     LocalArea != null &&
                     LocalArea.Equals(other.LocalArea)
                 ) &&
                 (
                     AskNextBlock1 == other.AskNextBlock1 ||
                     AskNextBlock1 != null &&
                     AskNextBlock1.Equals(other.AskNextBlock1)
                 ) &&
                 (
                     AskNextBlock1Seniority == other.AskNextBlock1Seniority ||
                     AskNextBlock1Seniority != null &&
                     AskNextBlock1Seniority.Equals(other.AskNextBlock1Seniority)
                 ) &&
                 (
                     AskNextBlock2 == other.AskNextBlock2 ||
                     AskNextBlock2 != null &&
                     AskNextBlock2.Equals(other.AskNextBlock2)
                 ) &&
                 (
                     AskNextBlock2Seniority == other.AskNextBlock2Seniority ||
                     AskNextBlock2Seniority != null &&
                     AskNextBlock2Seniority.Equals(other.AskNextBlock2Seniority)
                 ) &&
                 (
                     AskNextBlockOpen == other.AskNextBlockOpen ||
                     AskNextBlockOpen != null &&
                     AskNextBlockOpen.Equals(other.AskNextBlockOpen)
                 ));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="LocalAreaRotationList" /> class.
 /// </summary>
 /// <param name="id">Id (required).</param>
 /// <param name="districtEquipmentType">A foreign key reference to the system-generated unique identifier for an Equipment Type (required).</param>
 /// <param name="localArea">LocalArea (required).</param>
 /// <param name="askNextBlock1">The id of the next piece of Block 1 Equipment to be asked for a Rental Request. If null, start from the first piece of equipment in Block 1..</param>
 /// <param name="askNextBlock1Seniority">The seniority score of the piece of equipment that is the next to be asked in Block 1..</param>
 /// <param name="askNextBlock2">The id of the next piece of Block 2 Equipment to be asked for a Rental Request. If null, start from the first piece of equipment in Block 2..</param>
 /// <param name="askNextBlock2Seniority">The seniority score of the piece of equipment that is the next to be asked in Block 1..</param>
 /// <param name="askNextBlockOpen">The id of the next piece of Block Open Equipment to be asked for a Rental Request. If null, start from the first piece of equipment in Block Open..</param>
 public LocalAreaRotationList(int id, DistrictEquipmentType districtEquipmentType, LocalArea localArea,
                              Equipment askNextBlock1      = null, float?askNextBlock1Seniority = null, Equipment askNextBlock2 = null,
                              float?askNextBlock2Seniority = null, Equipment askNextBlockOpen   = null)
 {
     Id = id;
     DistrictEquipmentType  = districtEquipmentType;
     LocalArea              = localArea;
     AskNextBlock1          = askNextBlock1;
     AskNextBlock1Seniority = askNextBlock1Seniority;
     AskNextBlock2          = askNextBlock2;
     AskNextBlock2Seniority = askNextBlock2Seniority;
     AskNextBlockOpen       = askNextBlockOpen;
 }
Esempio n. 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LocalAreaRotationList" /> class.
        /// </summary>
        /// <param name="Id">Id (required).</param>
        /// <param name="DistrictEquipmentType">A foreign key reference to the system-generated unique identifier for an Equipment Type (required).</param>
        /// <param name="LocalArea">LocalArea (required).</param>
        /// <param name="AskNextBlock1">The id of the next piece of Block 1 Equipment to be asked for a Rental Request. If null, start from the first piece of equipment in Block 1..</param>
        /// <param name="AskNextBlock1Seniority">The seniority score of the piece of equipment that is the next to be asked in Block 1..</param>
        /// <param name="AskNextBlock2">The id of the next piece of Block 2 Equipment to be asked for a Rental Request. If null, start from the first piece of equipment in Block 2..</param>
        /// <param name="AskNextBlock2Seniority">The seniority score of the piece of equipment that is the next to be asked in Block 1..</param>
        /// <param name="AskNextBlockOpen">The id of the next piece of Block Open Equipment to be asked for a Rental Request. If null, start from the first piece of equipment in Block Open..</param>
        public LocalAreaRotationList(int Id, DistrictEquipmentType DistrictEquipmentType, LocalArea LocalArea, Equipment AskNextBlock1 = null, float?AskNextBlock1Seniority = null, Equipment AskNextBlock2 = null, float?AskNextBlock2Seniority = null, Equipment AskNextBlockOpen = null)
        {
            this.Id = Id;
            this.DistrictEquipmentType = DistrictEquipmentType;
            this.LocalArea             = LocalArea;


            this.AskNextBlock1          = AskNextBlock1;
            this.AskNextBlock1Seniority = AskNextBlock1Seniority;
            this.AskNextBlock2          = AskNextBlock2;
            this.AskNextBlock2Seniority = AskNextBlock2Seniority;
            this.AskNextBlockOpen       = AskNextBlockOpen;
        }
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // credit: http://stackoverflow.com/a/263416/677735
            unchecked // Overflow is fine, just wrap
            {
                int hash = 41;

                // Suitable nullity checks
                hash = hash * 59 + Id.GetHashCode();

                if (DistrictEquipmentType != null)
                {
                    hash = hash * 59 + DistrictEquipmentType.GetHashCode();
                }

                if (LocalArea != null)
                {
                    hash = hash * 59 + LocalArea.GetHashCode();
                }

                if (AskNextBlock1 != null)
                {
                    hash = hash * 59 + AskNextBlock1.GetHashCode();
                }

                if (AskNextBlock1Seniority != null)
                {
                    hash = hash * 59 + AskNextBlock1Seniority.GetHashCode();
                }

                if (AskNextBlock2 != null)
                {
                    hash = hash * 59 + AskNextBlock2.GetHashCode();
                }

                if (AskNextBlock2Seniority != null)
                {
                    hash = hash * 59 + AskNextBlock2Seniority.GetHashCode();
                }

                if (AskNextBlockOpen != null)
                {
                    hash = hash * 59 + AskNextBlockOpen.GetHashCode();
                }

                return(hash);
            }
        }
Esempio n. 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RentalRequest" /> class.
 /// </summary>
 /// <param name="id">A system-generated unique identifier for a Request (required).</param>
 /// <param name="project">Project (required).</param>
 /// <param name="localArea">A foreign key reference to the system-generated unique identifier for a Local Area (required).</param>
 /// <param name="status">The status of the Rental Request - whether it in progress, completed or was cancelled. (required).</param>
 /// <param name="districtEquipmentType">A foreign key reference to the system-generated unique identifier for an Equipment Type (required).</param>
 /// <param name="equipmentCount">The number of pieces of the equipment type wanted for hire as part of this request. (required).</param>
 /// <param name="expectedHours">The expected number of rental hours for each piece equipment hired against this request, as provided by the Project Manager making the request..</param>
 /// <param name="expectedStartDate">The expected start date of each piece of equipment hired against this request, as provided by the Project Manager making the request..</param>
 /// <param name="expectedEndDate">The expected end date of each piece of equipment hired against this request, as provided by the Project Manager making the request..</param>
 /// <param name="firstOnRotationList">The first piece of equipment on the rotation list at the time of the creation of the request..</param>
 /// <param name="notes">Notes.</param>
 /// <param name="attachments">Attachments.</param>
 /// <param name="history">History.</param>
 /// <param name="rentalRequestAttachments">RentalRequestAttachments.</param>
 /// <param name="rentalRequestRotationList">RentalRequestRotationList.</param>
 public RentalRequest(int id, Project project, LocalArea localArea, string status, DistrictEquipmentType districtEquipmentType,
                      int equipmentCount, int?expectedHours = null, DateTime?expectedStartDate = null, DateTime?expectedEndDate = null,
                      Equipment firstOnRotationList         = null, List <Note> notes = null, List <Attachment> attachments     = null,
                      List <History> history = null, List <RentalRequestAttachment> rentalRequestAttachments = null,
                      List <RentalRequestRotationList> rentalRequestRotationList = null)
 {
     Id                        = id;
     Project                   = project;
     LocalArea                 = localArea;
     Status                    = status;
     DistrictEquipmentType     = districtEquipmentType;
     EquipmentCount            = equipmentCount;
     ExpectedHours             = expectedHours;
     ExpectedStartDate         = expectedStartDate;
     ExpectedEndDate           = expectedEndDate;
     FirstOnRotationList       = firstOnRotationList;
     Notes                     = notes;
     Attachments               = attachments;
     History                   = history;
     RentalRequestAttachments  = rentalRequestAttachments;
     RentalRequestRotationList = rentalRequestRotationList;
 }
Esempio n. 6
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // credit: http://stackoverflow.com/a/263416/677735
            unchecked // Overflow is fine, just wrap
            {
                int hash = 41;

                // Suitable nullity checks
                hash = hash * 59 + Id.GetHashCode();

                if (Project != null)
                {
                    hash = hash * 59 + Project.GetHashCode();
                }

                if (LocalArea != null)
                {
                    hash = hash * 59 + LocalArea.GetHashCode();
                }

                if (Status != null)
                {
                    hash = hash * 59 + Status.GetHashCode();
                }

                if (DistrictEquipmentType != null)
                {
                    hash = hash * 59 + DistrictEquipmentType.GetHashCode();
                }

                hash = hash * 59 + EquipmentCount.GetHashCode();

                if (ExpectedHours != null)
                {
                    hash = hash * 59 + ExpectedHours.GetHashCode();
                }

                if (ExpectedStartDate != null)
                {
                    hash = hash * 59 + ExpectedStartDate.GetHashCode();
                }

                if (ExpectedEndDate != null)
                {
                    hash = hash * 59 + ExpectedEndDate.GetHashCode();
                }

                if (FirstOnRotationList != null)
                {
                    hash = hash * 59 + FirstOnRotationList.GetHashCode();
                }

                if (Notes != null)
                {
                    hash = hash * 59 + Notes.GetHashCode();
                }

                if (Attachments != null)
                {
                    hash = hash * 59 + Attachments.GetHashCode();
                }

                if (History != null)
                {
                    hash = hash * 59 + History.GetHashCode();
                }

                if (RentalRequestAttachments != null)
                {
                    hash = hash * 59 + RentalRequestAttachments.GetHashCode();
                }

                if (RentalRequestRotationList != null)
                {
                    hash = hash * 59 + RentalRequestRotationList.GetHashCode();
                }

                return(hash);
            }
        }
Esempio n. 7
0
        /// <summary>
        /// Returns true if RentalRequest instances are equal
        /// </summary>
        /// <param name="other">Instance of RentalRequest to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(RentalRequest other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id.Equals(other.Id)
                     ) &&
                 (
                     Project == other.Project ||
                     Project != null &&
                     Project.Equals(other.Project)
                 ) &&
                 (
                     LocalArea == other.LocalArea ||
                     LocalArea != null &&
                     LocalArea.Equals(other.LocalArea)
                 ) &&
                 (
                     Status == other.Status ||
                     Status != null &&
                     Status.Equals(other.Status)
                 ) &&
                 (
                     DistrictEquipmentType == other.DistrictEquipmentType ||
                     DistrictEquipmentType != null &&
                     DistrictEquipmentType.Equals(other.DistrictEquipmentType)
                 ) &&
                 (
                     EquipmentCount == other.EquipmentCount ||
                     EquipmentCount.Equals(other.EquipmentCount)
                 ) &&
                 (
                     ExpectedHours == other.ExpectedHours ||
                     ExpectedHours != null &&
                     ExpectedHours.Equals(other.ExpectedHours)
                 ) &&
                 (
                     ExpectedStartDate == other.ExpectedStartDate ||
                     ExpectedStartDate != null &&
                     ExpectedStartDate.Equals(other.ExpectedStartDate)
                 ) &&
                 (
                     ExpectedEndDate == other.ExpectedEndDate ||
                     ExpectedEndDate != null &&
                     ExpectedEndDate.Equals(other.ExpectedEndDate)
                 ) &&
                 (
                     FirstOnRotationList == other.FirstOnRotationList ||
                     FirstOnRotationList != null &&
                     FirstOnRotationList.Equals(other.FirstOnRotationList)
                 ) &&
                 (
                     Notes == other.Notes ||
                     Notes != null &&
                     Notes.SequenceEqual(other.Notes)
                 ) &&
                 (
                     Attachments == other.Attachments ||
                     Attachments != null &&
                     Attachments.SequenceEqual(other.Attachments)
                 ) &&
                 (
                     History == other.History ||
                     History != null &&
                     History.SequenceEqual(other.History)
                 ) &&
                 (
                     RentalRequestAttachments == other.RentalRequestAttachments ||
                     RentalRequestAttachments != null &&
                     RentalRequestAttachments.SequenceEqual(other.RentalRequestAttachments)
                 ) &&
                 (
                     RentalRequestRotationList == other.RentalRequestRotationList ||
                     RentalRequestRotationList != null &&
                     RentalRequestRotationList.SequenceEqual(other.RentalRequestRotationList)
                 ));
        }
Esempio n. 8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RentalRequest" /> class.
        /// </summary>
        /// <param name="Id">A system-generated unique identifier for a Request (required).</param>
        /// <param name="Project">Project (required).</param>
        /// <param name="LocalArea">A foreign key reference to the system-generated unique identifier for a Local Area (required).</param>
        /// <param name="Status">The status of the Rental Request - whether it in progress, completed or was cancelled. (required).</param>
        /// <param name="DistrictEquipmentType">A foreign key reference to the system-generated unique identifier for an Equipment Type (required).</param>
        /// <param name="EquipmentCount">The number of pieces of the equipment type wanted for hire as part of this request. (required).</param>
        /// <param name="ExpectedHours">The expected number of rental hours for each piece equipment hired against this request, as provided by the Project Manager making the request..</param>
        /// <param name="ExpectedStartDate">The expected start date of each piece of equipment hired against this request, as provided by the Project Manager making the request..</param>
        /// <param name="ExpectedEndDate">The expected end date of each piece of equipment hired against this request, as provided by the Project Manager making the request..</param>
        /// <param name="FirstOnRotationList">The first piece of equipment on the rotation list at the time of the creation of the request..</param>
        /// <param name="Notes">Notes.</param>
        /// <param name="Attachments">Attachments.</param>
        /// <param name="History">History.</param>
        /// <param name="RentalRequestAttachments">RentalRequestAttachments.</param>
        /// <param name="RentalRequestRotationList">RentalRequestRotationList.</param>
        public RentalRequest(int Id, Project Project, LocalArea LocalArea, string Status, DistrictEquipmentType DistrictEquipmentType, int EquipmentCount, int?ExpectedHours = null, DateTime?ExpectedStartDate = null, DateTime?ExpectedEndDate = null, Equipment FirstOnRotationList = null, List <Note> Notes = null, List <Attachment> Attachments = null, List <History> History = null, List <RentalRequestAttachment> RentalRequestAttachments = null, List <RentalRequestRotationList> RentalRequestRotationList = null)
        {
            this.Id                    = Id;
            this.Project               = Project;
            this.LocalArea             = LocalArea;
            this.Status                = Status;
            this.DistrictEquipmentType = DistrictEquipmentType;
            this.EquipmentCount        = EquipmentCount;



            this.ExpectedHours       = ExpectedHours;
            this.ExpectedStartDate   = ExpectedStartDate;
            this.ExpectedEndDate     = ExpectedEndDate;
            this.FirstOnRotationList = FirstOnRotationList;
            this.Notes       = Notes;
            this.Attachments = Attachments;
            this.History     = History;
            this.RentalRequestAttachments  = RentalRequestAttachments;
            this.RentalRequestRotationList = RentalRequestRotationList;
        }