public Model.Manager.ConsumableEquipment NewEquipment(Model.Manager.ConsumableEquipment equipment) { List <ConsumableEquipment> consumableEquipment = ReadFromFile(); ConsumableEquipment searchEquipment = GetEquipment(equipment.Id); if (searchEquipment != null) { return(null); } consumableEquipment.Add(equipment); WriteInFile(consumableEquipment); return(equipment); }
public Model.Manager.ConsumableEquipment SetEquipment(Model.Manager.ConsumableEquipment equipment) { List <ConsumableEquipment> consumableEquipment = ReadFromFile(); foreach (ConsumableEquipment e in consumableEquipment) { if (e.Id.Equals(equipment.Id)) { e.Quantity = equipment.Quantity; e.Type = equipment.Type; break; } } WriteInFile(consumableEquipment); return(equipment); }
public Model.Manager.ConsumableEquipment EditConsumableEquipment(Model.Manager.ConsumableEquipment equipment) { return(consumableEquipmentService.EditConsumableEquipment(equipment)); }
public Model.Manager.ConsumableEquipment EditConsumableEquipment(Model.Manager.ConsumableEquipment equipment) { return(consumableEquipmentRepository.SetEquipment(equipment)); }
public Model.Manager.ConsumableEquipment AddConsumableEqipment(Model.Manager.ConsumableEquipment equipment) { return(consumableEquipmentRepository.NewEquipment(equipment)); }
public ConsumableEquipment(ConsumableEquipment consumableEquipment) { this.Id = consumableEquipment.Id; this.Type = consumableEquipment.Type; this.Quantity = consumableEquipment.Quantity; }