public TrainCoach GetTrainCoach() { TrainCoach coach = new TrainCoach(); coach.CoachID = Convert.ToInt32(txtCoachID.Text); coach.LoadCapacity = Convert.ToDouble(txtLoadCapacity.Text); coach.CoachType = txtCoachType.Text; return(coach); }
public bool RemoveAfter(int id, TrainCoach coach) { TrainCoach tCoach = new TrainCoach(); tCoach.CoachID = id; LinkedListNode <TrainCoach> targetNode = coaches.Find(tCoach); if (targetNode.Next != null) { coaches.Remove(targetNode.Next); return(true); } return(false); }
public bool RemoveBefore(int id, TrainCoach coach) { TrainCoach tCoach = new TrainCoach(); tCoach.CoachID = id; LinkedListNode <TrainCoach> targetNode = coaches.Find(tCoach); if (targetNode.Previous != null) { coaches.Remove(targetNode.Previous); return(true); } return(false); }
public bool InsertBefore(int id, TrainCoach coach) { TrainCoach tCoach = new TrainCoach(); tCoach.CoachID = id; LinkedListNode <TrainCoach> targetNode = coaches.Find(tCoach); if (targetNode != null) { coaches.AddBefore(targetNode, coach); return(true); } return(false); }
public override bool Equals(object obj) { TrainCoach tCoach = obj as TrainCoach; return(this.Equals(tCoach)); }
public bool Equals(TrainCoach other) { return(this.CoachID == other.CoachID); }
public LinkedListNode <TrainCoach> AddEnd(TrainCoach coach) { return(coaches.AddLast(coach)); }
public LinkedListNode <TrainCoach> AddFront(TrainCoach coach) { return(coaches.AddFirst(coach)); }