示例#1
0
 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();
         }
     }
 }
示例#2
0
        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);
            }
        }
示例#3
0
 public void  AddLogEntry(ProjectLog projectLog)
 {
     projectLogRepository.Add(projectLog);
     projectLogRepository.Save();
 }
示例#4
0
 public void Send(ProjectLog projectLog)
 {
     Console.WriteLine("Send project log: " + projectLog.ProjectId + " " + projectLog.UserId);
 }