Beispiel #1
0
        private void OpenNew(object param)
        {
            NewTaskView newTaskView;
            int         id;

            int.TryParse(param.ToString(), out id);

            if (id > 0)
            {
                newTaskView = new NewTaskView("", Issues.FirstOrDefault(x => x.Id == id));
            }
            else
            {
                newTaskView = new NewTaskView("", null);
            }

            if (newTaskView.ShowDialog().Value)
            {
                newTaskView.Issue.Id = FileRepository.GetLastId("Issue");
                Issues.Add(newTaskView.Issue);
                FileRepository.UpdateFile <Issue>("issue", Issues.ToList());
                if (newTaskView.Issue.IssueDate.Date == DateTime.Now.Date)
                {
                    TodayIssues.Add(newTaskView.Issue);
                }
            }
        }
Beispiel #2
0
        private void Remove(object param)
        {
            int id;

            int.TryParse(param.ToString(), out id);

            var issue = Issues.FirstOrDefault(x => x.Id == id);

            if (issue != null)
            {
                Issues.Remove(issue);
                TodayIssues.Remove(issue);
                FileRepository.UpdateFile <Issue>("issue", Issues.ToList());
            }
        }
Beispiel #3
0
        private void MarkAsCompleted(object param)
        {
            int id;

            int.TryParse(param.ToString(), out id);

            var issue = Issues.FirstOrDefault(x => x.Id == id);

            if (issue != null)
            {
                var index       = Issues.IndexOf(issue);
                var indexSecond = TodayIssues.IndexOf(issue);

                Issues[index].IsCompleted            = true;
                TodayIssues[indexSecond].IsCompleted = true;
                FileRepository.UpdateFile <Issue>("issue", Issues.ToList());
            }
        }
Beispiel #4
0
        public bool Equals(ValidationReport other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            var issues      = Issues.ToList();
            var otherIssues = other.Issues.ToList();

            if (issues.Count != otherIssues.Count)
            {
                return(false);
            }

            for (int i = 0; i < issues.Count; i++)
            {
                if (!issues[i].Equals(otherIssues[i]))
                {
                    return(false);
                }
            }

            var subreports      = SubReports.ToList();
            var otherSubreports = other.SubReports.ToList();

            if (subreports.Count != otherSubreports.Count)
            {
                return(false);
            }

            for (int i = 0; i < subreports.Count; i++)
            {
                if (!subreports[i].Equals(otherSubreports[i]))
                {
                    return(false);
                }
            }
            return(true);
        }
Beispiel #5
0
 public MainViewModel()
 {
     Issues      = GetIssues();
     m_allIssues = Issues.ToList();
 }