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
|
[OperationContract]
public string ChangerAct(string NameFich, string NameActv, string NewNameAct)
{
string chaine;
try
{
XDocument data = XDocument.Load(HttpContext.Current.Server.MapPath(@"ClientBin/Data/" + NameFich + ".xml"));
var req = (from c in data.Descendants("Activity")
where c.Attribute("ActivityName").Value.Equals(NameActv)
select c.Attribute("ActivityName")).FirstOrDefault().Value.ToString();
chaine = req.ToString();
req.Replace(chaine, NewNameAct);
data.Save(HttpContext.Current.Server.MapPath(@"ClientBin/Data/" + NameFich + ".xml"));
}
catch (Exception ex)
{
return ex.ToString();
}
return chaine;
} |
Partager