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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
 public EquipmentInRooms(EquipmentInRooms equipmentInRooms)
 {
     this.IdEquipment = equipmentInRooms.IdEquipment;
     this.Quantity    = equipmentInRooms.Quantity;
     this.RoomNumber  = equipmentInRooms.RoomNumber;
 }
Ejemplo n.º 5
0
 public Model.Manager.EquipmentInRooms editEquipmentInRooms(Model.Manager.EquipmentInRooms equipment)
 {
     return(equipmentInRoomsRepository.SetEquipment(equipment));
 }
Ejemplo n.º 6
0
 public Model.Manager.EquipmentInRooms addEquipmentInRoom(Model.Manager.EquipmentInRooms equipment)
 {
     return(equipmentInRoomsRepository.NewEquipment(equipment));
 }
Ejemplo n.º 7
0
 public Model.Manager.EquipmentInRooms editEquipmentInRooms(Model.Manager.EquipmentInRooms equipment)
 {
     return(equipmentInRoomsService.editEquipmentInRooms(equipment));
 }
Ejemplo n.º 8
0
 public Model.Manager.EquipmentInRooms addEquipmentInRoom(Model.Manager.EquipmentInRooms equipment)
 {
     return(equipmentInRoomsService.addEquipmentInRoom(equipment));
 }