private void CommitChange(Zeit temp) { var issue = Manager.GetObject<Issue>(temp.Ticket.ToString(CultureInfo.InvariantCulture), null); if (issue == null) { MessageBox.Show("Das Ticket ist im Redmine nicht vorhanden"); return; } var project = Manager.GetObject<Project>(issue.Project.Id.ToString(CultureInfo.InvariantCulture), null); if (project != null && project.Name == "Demo") { var entry = new TimeEntry { Comments = temp.Kommentar, Hours = SerializableTimeSpan.ToDecimal(temp.Dauer), Issue = new IdentifiableName { Id = temp.Ticket } }; TaskLabel = GetMessage(Manager.CreateObject(entry)); } }
private void OkExecuteCommand(object obj) { var temp = new Zeit(NewTime.Dauer, NewTime.Ticket,0, NewTime.Kommentar, NewTime.Gebucht); if (temp.Ticket == 741) temp.Gebucht = true; Zeitplan.Add(temp); if (!KomplettListe.Any(x => x.Datum == DateTime.Today)) KomplettListe.Add(new Zeiten { Datum = DateTime.Today, Items = Zeitplan }); else KomplettListe.First(x => x.Datum == DateTime.Today).Items = Zeitplan; ObjectSerializer.SerializeToXML(KomplettListe); if (temp.Ticket == 741) CommitChange(temp); _forceRefresh = true; OnPropertyChanged(() => Zeitplan); NewTime = null; WorkTimer.Restart(); PopupIsOpen = false; }
private void AddExecuteCommand(object obj) { TimeSpan t = WorkTimer.Elapsed; NewTime = new Zeit { Dauer = new SerializableTimeSpan(t) }; PopupIsOpen = true; }