[C#] MVC et séparation des données
Bonjour a tous,
desolee si je ne suis pas dans le bon forum.
je suis entrain d`essayer d`appliquer le pattern MVC ( Model View Controller). Je suis un peu perdue cote Model vu que tous mes donnees je les sauvegarde dans un document XML que j`interroge au besoin via `Linq to XML`. Est ce que vous pensez pouvoir m`aider sur ce point SVP.
exple: voila ma methode
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| public void loadCombo()
{
comboBoxS.Items.Clear();
XmlDocument doc = new XmlDocument();
//loading our XML file
doc.Load("LERL_RCL_Trackinfo.xml");
//selecting the node that our data (CRS) is at
XmlNodeList nodeList = doc.SelectNodes("LERL_RCL_Trackinfo/Station");
//for each node in our selected node list, we will add the CRS item to our ComboBox
// but only if it has not already been added.
foreach (XmlNode node in nodeList)
{
int CRS_length = node.SelectSingleNode("CRS").InnerText.Length;
if (!comboBoxS.Items.Contains(node.SelectSingleNode("CRS").InnerText))
{
if (CRS_length == 3)
{
comboBoxS.Items.Add(node.SelectSingleNode("CRS").InnerText);
}
}
}
} |
comment je peux separer ce traitement selon le MVC pattern?:cry: