コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 public Model.Manager.ConsumableEquipment EditConsumableEquipment(Model.Manager.ConsumableEquipment equipment)
 {
     return(consumableEquipmentService.EditConsumableEquipment(equipment));
 }
コード例 #4
0
 public Model.Manager.ConsumableEquipment EditConsumableEquipment(Model.Manager.ConsumableEquipment equipment)
 {
     return(consumableEquipmentRepository.SetEquipment(equipment));
 }
コード例 #5
0
 public Model.Manager.ConsumableEquipment AddConsumableEqipment(Model.Manager.ConsumableEquipment equipment)
 {
     return(consumableEquipmentRepository.NewEquipment(equipment));
 }
コード例 #6
0
 public ConsumableEquipment(ConsumableEquipment consumableEquipment)
 {
     this.Id       = consumableEquipment.Id;
     this.Type     = consumableEquipment.Type;
     this.Quantity = consumableEquipment.Quantity;
 }