Ejemplo n.º 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 ItemCountRepositoryTest()
 {
     warehouseDBConnectionString = "Server=memsqldw;Database=DWPROD;Trusted_Connection=True;User ID=Warehouse.APi.Prod;password=89=discover=STEEL=vermont;Trusted_Connection=False;Encrypt=True;TrustServerCertificate=True;connect timeout=180;";
     configurationFake           = Substitute.For <IConfiguration>();
     configurationFake.GetConnectionString("WarehouseDB").Returns(warehouseDBConnectionString);
     sut = new ItemCountRepository(configurationFake);
 }
Ejemplo n.º 3
0
 public bool DeleteItemCount(ItemCount item)
 {
     return(ItemCountRepository.GetInstance().Delete(item.GetId()));
 }
Ejemplo n.º 4
0
 public bool EditItemCount(ItemCount item)
 {
     return(ItemCountRepository.GetInstance().Update(item) == null ? false : true);
 }
Ejemplo n.º 5
0
 public ItemCount AddItemCount(ItemCount item)
 {
     return(ItemCountRepository.GetInstance().Create(item));
 }