Beispiel #1
0
        public MedEquipmentItem AddMedEquipmentItem(MedEquipmentType medEquipmentType, Room room)
        {
            medEquipmentType.Number += 1;
            medEquipmentType         = MedEquipmentTypeRepository.GetInstance().Update(medEquipmentType);
            MedEquipmentItem mei  = MedEquipmentItemRepository.GetInstance().Create(new MedEquipmentItem(medEquipmentType.GetId(), room.GetId(), medEquipmentType));
            ItemCount        temp = null;

            foreach (ItemCount ic in room.ItemCount)
            {
                if (mei.TypeId == ic.ItemId)
                {
                    temp = ic;
                    break;
                }
            }
            if (temp == null)
            {
                List <MedEquipmentItem> meiList = new List <MedEquipmentItem>();
                meiList.Add(mei);
                ItemCount ic = ItemCountRepository.GetInstance().Create(new ItemCount(1, medEquipmentType.GetId(), meiList.ToArray()));
                room.ItemCount.Add(ic);
                RoomRepository.GetInstance().Update(room);
            }
            else
            {
                temp.Number += 1;
                ItemCountRepository.GetInstance().Update(temp);
            }
            return(mei);
        }
        public List <MedEquipmentItem> GetByMedEquipmentType(MedEquipmentType medEquipmentType)
        {
            List <string[]>         ids = Persistence.ReadEntryByKey(path, medEquipmentType.GetId().ToString(), 1);
            List <MedEquipmentItem> mei = new List <MedEquipmentItem>();

            foreach (string[] s in ids)
            {
                mei.Add(Read(uint.Parse(s[0])));
            }
            return(mei);
        }
Beispiel #3
0
 public Room AddEquipmentToRoom(Room room, MedEquipmentType eqType, uint number)
 {
     if (number == 0)
     {
         return(room);
     }
     for (uint i = 0; i < number; i++)
     {
         AddMedEquipmentItem(eqType, room);
     }
     return(RoomRepository.GetInstance().Read(room.GetId()));
 }
Beispiel #4
0
 public bool EditMedEquipmentType(MedEquipmentType medEqType)
 {
     return(MedEquipmentTypeRepository.GetInstance().Update(medEqType) == null ? false : true);
 }
Beispiel #5
0
 public MedEquipmentType AddMedEquipmentType(MedEquipmentType medEquipmentType)
 {
     return(MedEquipmentTypeRepository.GetInstance().Create(medEquipmentType));
 }
 public bool UpdateMedEquipmentType(MedEquipmentType medEqType)
 {
     return(iRoomAndInventoryService.EditMedEquipmentType(medEqType));
 }
 public MedEquipmentType AddMedEquipmentType(MedEquipmentType medEquipmentType)
 {
     return(iRoomAndInventoryService.AddMedEquipmentType(medEquipmentType));
 }
 public MedEquipmentItem AddMedEquipmentItem(MedEquipmentType medEquipmentType, Room room)
 {
     return(iRoomAndInventoryService.AddMedEquipmentItem(medEquipmentType, room));
 }
 public Room AddEquipmentToRoom(Room room, MedEquipmentType eqType, uint number)
 {
     return(iRoomAndInventoryService.AddEquipmentToRoom(room, eqType, number));
 }