public Model.Manager.EquipmentInRooms NewEquipment(Model.Manager.EquipmentInRooms equipment)
        {
            List <EquipmentInRooms> equipmentInRooms = ReadFromFile();

            foreach (EquipmentInRooms e in equipmentInRooms)
            {
                if (e.IdEquipment == equipment.IdEquipment)
                {
                    return(null);
                }
            }

            equipmentInRooms.Add(equipment);
            WriteInFile(equipmentInRooms);
            return(equipment);
        }
        public Model.Manager.EquipmentInRooms SetEquipment(Model.Manager.EquipmentInRooms equipment)
        {
            List <EquipmentInRooms> equipmentInRooms = ReadFromFile();

            foreach (EquipmentInRooms e in equipmentInRooms)
            {
                if (e.IdEquipment == equipment.IdEquipment)
                {
                    e.Quantity   = equipment.Quantity;
                    e.RoomNumber = equipment.RoomNumber;
                    break;
                }
            }
            WriteInFile(equipmentInRooms);
            return(equipment);
        }
예제 #3
0
        public Model.Manager.EquipmentInRooms NewEquipment(Model.Manager.EquipmentInRooms equipment)
        {
            List <EquipmentInRooms> equipmentInRooms = ReadFromFile();
            List <EquipmentInRooms> searchEquipment  = GetEquipmentByRoom(equipment.RoomNumber);

            foreach (EquipmentInRooms e in searchEquipment)
            {
                if (e.IdEquipment == equipment.IdEquipment)
                {
                    return(null);
                }
            }

            equipmentInRooms.Add(equipment);
            WriteInFile(equipmentInRooms);
            return(equipment);
        }
예제 #4
0
 public EquipmentInRooms(EquipmentInRooms equipmentInRooms)
 {
     this.IdEquipment = equipmentInRooms.IdEquipment;
     this.Quantity    = equipmentInRooms.Quantity;
     this.RoomNumber  = equipmentInRooms.RoomNumber;
 }
예제 #5
0
 public Model.Manager.EquipmentInRooms editEquipmentInRooms(Model.Manager.EquipmentInRooms equipment)
 {
     return(equipmentInRoomsRepository.SetEquipment(equipment));
 }
예제 #6
0
 public Model.Manager.EquipmentInRooms addEquipmentInRoom(Model.Manager.EquipmentInRooms equipment)
 {
     return(equipmentInRoomsRepository.NewEquipment(equipment));
 }
예제 #7
0
 public Model.Manager.EquipmentInRooms editEquipmentInRooms(Model.Manager.EquipmentInRooms equipment)
 {
     return(equipmentInRoomsService.editEquipmentInRooms(equipment));
 }
예제 #8
0
 public Model.Manager.EquipmentInRooms addEquipmentInRoom(Model.Manager.EquipmentInRooms equipment)
 {
     return(equipmentInRoomsService.addEquipmentInRoom(equipment));
 }