Example #1
0
        public Model.Doctor.PlacemetnInARoom NewPlacement(Model.Doctor.PlacemetnInARoom placement)
        {
            // TODO: implement
            List <PlacemetnInARoom> placementList   = ReadFromFile();
            PlacemetnInARoom        searchPlacement = GetPlacementById(placement.Id);

            if (searchPlacement != null)
            {
                return(null);
            }
            placementList.Add(placement);
            WriteInFile(placementList);
            return(placement);
        }
Example #2
0
        public Model.Doctor.PlacemetnInARoom SetPlacement(Model.Doctor.PlacemetnInARoom placement)
        {
            // TODO: implement
            List <PlacemetnInARoom> placementList = ReadFromFile();

            foreach (PlacemetnInARoom p in placementList)
            {
                if (p.Id == placement.Id)
                {
                    p.patientCard     = placement.patientCard;
                    p.room            = placement.room;
                    p.Id              = placement.Id;
                    p.DateOfPlacement = placement.DateOfPlacement;
                    p.DateOfDismison  = placement.DateOfDismison;
                    break;
                }
            }
            WriteInFile(placementList);
            return(null);
        }
Example #3
0
        public PlacemetnInARoom(PlacemetnInARoom placement)
        {
            if (placement.patientCard == null)
            {
                this.patientCard = new PatientCard();
            }
            else
            {
                this.patientCard = new PatientCard(placement.patientCard);
            }

            if (placement.room == null)
            {
                this.room = new Room();
            }
            else
            {
                this.room = new Room(placement.room);
            }
            this.Id = placement.Id;
            this.DateOfPlacement = placement.DateOfPlacement;
            this.DateOfDismison  = placement.DateOfDismison;
        }