From 6376250b45180d4ffe184a630e093f0b379a96fe Mon Sep 17 00:00:00 2001 From: Roxane ROSSETTO Date: Wed, 17 May 2023 11:44:32 +0200 Subject: [PATCH] enum unit finished and quantity class finished, and I'm working on Ingredient --- MCTG/Model/Ingredient.cs | 34 ++++++++++++++++++++++++++++++++++ MCTG/Model/Quantity.cs | 12 ++++++++++++ MCTG/Model/Unit.cs | 11 +++++++++++ 3 files changed, 57 insertions(+) create mode 100644 MCTG/Model/Quantity.cs create mode 100644 MCTG/Model/Unit.cs diff --git a/MCTG/Model/Ingredient.cs b/MCTG/Model/Ingredient.cs index 6efcd19..cc3303c 100644 --- a/MCTG/Model/Ingredient.cs +++ b/MCTG/Model/Ingredient.cs @@ -8,5 +8,39 @@ namespace Model { internal class Ingredient { + #region Attributes + /// + /// Name of the ingredient + /// + private string name; + /// + /// get the quatity of ingredient + /// + private Quantity quantity; + + #endregion + + #region + public string Name + { + get => name; + set + { + if (value == null) + { + throw new ArgumentNullException("Impossible de ne pas avoir de nom pour l'ingrédient"); + } + } + } + + public Quantity QuantityP + { + get => quantity; + set => quantity = value; + } + + #endregion + + } } diff --git a/MCTG/Model/Quantity.cs b/MCTG/Model/Quantity.cs new file mode 100644 index 0000000..d59a3a6 --- /dev/null +++ b/MCTG/Model/Quantity.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Model +{ + internal class Quantity + { + } +} diff --git a/MCTG/Model/Unit.cs b/MCTG/Model/Unit.cs new file mode 100644 index 0000000..297c633 --- /dev/null +++ b/MCTG/Model/Unit.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Model +{ + public enum Unit + { Unit, kG, mG, G, L, cL, mL }; +}