public async Task <IActionResult> Edit(int id, [Bind("EquipmentId,Name")] TypeOfEquipment typeOfEquipment) { if (id != typeOfEquipment.EquipmentId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(typeOfEquipment); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TypeOfEquipmentExists(typeOfEquipment.EquipmentId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(typeOfEquipment)); }
public EquipmentDTO(string name, TypeOfEquipment type, string description, int newQuantity, int currentQuantityInMagacine) { Name = name; Type = type; Description = description; NewQuantity = newQuantity; CurrentQuantityInMagacine = currentQuantityInMagacine; }
public Equipment(string id, string name, TypeOfEquipment typeOfEquipment, int quantity, string description) { this.Id = id; this.Name = name; this.Type = typeOfEquipment; this.Quantity = quantity; this.Description = description; }
private void MakeEquipmentAttributes() { _equipmentName = nameTextBox.Text; _newEquipmentQuantity = int.TryParse(quanitityTextBox.Text, out _newEquipmentQuantity) ? _newEquipmentQuantity : 0; _equipmentDescription = descriptionTextBox.Text; if (typeComboBox.SelectedIndex == 0) _equipmentType = TypeOfEquipment.Static; else _equipmentType = TypeOfEquipment.Dynamic; }
public async Task <IActionResult> Create([Bind("EquipmentId,Name")] TypeOfEquipment typeOfEquipment) { if (ModelState.IsValid) { _context.Add(typeOfEquipment); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(typeOfEquipment)); }
private List <String> getRoomEquipment(TypeOfEquipment typeOfEquipment) { List <String> equipmentList = new List <String>(); foreach (DictionaryEntry de in roomEquipment) { string id = EquipmentController.getInstance().getEquipmentName(de.Key.ToString()); if (EquipmentController.getInstance().getEquipmentType(de.Key.ToString()).Equals(typeOfEquipment)) { equipmentList.Add(id + " x" + de.Value.ToString()); } } return(equipmentList); }
public Equipment NewEquipment(TypeOfEquipment type, Equipment equipment) { switch (type) { case TypeOfEquipment.CONSUMABLE: { return(new ConsumableEquipmentController().CreateEquipment(equipment)); } case TypeOfEquipment.NON_CONSUMABLE: { return(new NonConsumableEquipmentController().CreateEquipment(equipment)); } default: throw new NotSupportedException(); } }
public Equipment(long id, TypeOfEquipment tip, int quantity) { Id = id; type = tip; Quantity = quantity; }
public Equipment(TypeOfEquipment tip, int quantity) { type = tip; Quantity = quantity; }