Beispiel #1
0
 /// <summary>
 /// Calls New Boat View
 /// </summary>
 private void NewBoat()
 {
     models.Boat   newBoat = _mainView.AddBoat();
     models.Member Owner   = _mainView.GetOwner(_xmlHandler.Members);
     Owner.AddBoat(newBoat);
     _xmlHandler.SaveUpdates();
 }
Beispiel #2
0
        public void UpdateMember()
        {
            models.XmlHandler xmlHandler = new models.XmlHandler();
            xmlHandler.DeSerialize();
            _updateView.DisplayAllMembersToUpdate(xmlHandler.Members);
            int memberIndex = _updateView.GetMemberToUpdateIndex();

            string newName = _updateView.GetNewName();

            if (newName == "")
            {
                newName = xmlHandler.Members[memberIndex].Name;
            }

            long newPersonaleNumber = _updateView.GetNewPersonalNumber();

            if (newPersonaleNumber == 0)
            {
                newPersonaleNumber = xmlHandler.Members[memberIndex].PersonalNumber;
            }

            xmlHandler.Members[memberIndex].Name           = newName;
            xmlHandler.Members[memberIndex].PersonalNumber = newPersonaleNumber;
            xmlHandler.SaveUpdates();
        }
Beispiel #3
0
        public void DeleteBoat()
        {
            models.XmlHandler xmlHandler = new models.XmlHandler();
            xmlHandler.DeSerialize();
            models.Member member = _deleteview.GetMember(xmlHandler.Members);
            models.Boat   boat   = _deleteview.GetBoatToDelete(member);

            member.DeleteBoat(boat);
            xmlHandler.SaveUpdates();
        }
Beispiel #4
0
        public void NewBoat()
        {
            models.XmlHandler xmlHandler = new models.XmlHandler();
            xmlHandler.DeSerialize();
            string BoatType = _memberView.GetNewBoatType();
            string Lenght   = _memberView.GetBoatLength();

            models.Member Owner = _memberView.GetOwnerIndexOfBoat(xmlHandler.Members);

            models.Boat boat = new models.Boat(BoatType, Lenght);
            AddBoatToMember(boat, Owner);
            xmlHandler.SaveUpdates();
        }
Beispiel #5
0
        public void UpdateBoat()
        {
            models.XmlHandler xmlHandler = new models.XmlHandler();
            xmlHandler.DeSerialize();
            models.Boat boat      = _updateView.GetBoatToChange(xmlHandler.Members);
            string      newType   = _updateView.GetNewType();
            string      newLenght = _updateView.GetNewLenght();

            if (newType != "")
            {
                boat.Type = newType;
            }
            if (newLenght != "")
            {
                boat.Length = newLenght;
            }

            xmlHandler.SaveUpdates();
        }