public bool CreateMaterial(string name, string comment, string materialQuantity) { int.TryParse(materialQuantity, out int quantity); int id = databaseRepo.CreateMaterial(name, comment, quantity); if (id <= 0) { return(false); } materials.Add(new Material(id, name, comment, quantity)); return(true); }