public void Delete(ProjectLog projectLog) { if (xDocument.Root != null) { var project = xDocument.Root.Descendants(ProjectEntry).Where( element => (DateTime.Parse(element.Attribute("StartDate").Value) == projectLog.StartDate )).SingleOrDefault(); if (project != null) { project.Remove(); } } }
public void Add(ProjectLog projectLog) { var xElement = new XElement(ProjectEntry); xElement.Add(new XAttribute("UserId", projectLog.UserId)); xElement.Add(new XAttribute("ProjectId", projectLog.ProjectId)); xElement.Add(new XAttribute("DurationTime", projectLog.DurationTime.ToString())); xElement.Add(new XAttribute("StartDate", projectLog.StartDate)); if (xDocument.Root != null) { xDocument.Root.Add(xElement); } }
public void AddLogEntry(ProjectLog projectLog) { projectLogRepository.Add(projectLog); projectLogRepository.Save(); }
public void Send(ProjectLog projectLog) { Console.WriteLine("Send project log: " + projectLog.ProjectId + " " + projectLog.UserId); }