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