// Adds a material to form public void addMaterial(int materialId) { // Set as selected material selectedMaterial = MaterialModel.getMaterial(materialId); // Create a new blank quote material quoteMaterial = new QuoteMaterialModel(quote.quoteId, materialId, selectedMaterial.pricePerUnit, selectedMaterial.isService); }
// Form for updating a material public MaterialFormViewModel(BaseViewModel parent, int materalId) { this.parent = parent; // Get the material being updating material = MaterialModel.getMaterial(materalId); btnText = "Update Material"; }