123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- using System;
- using System.Linq;
- using System.Windows;
- using System.Windows.Controls;
- using Comal.Classes;
- using InABox.Core;
- using InABox.DynamicGrid;
- namespace PRSDesktop
- {
- /// <summary>
- /// Interaction logic for KanbanNotes.xaml
- /// </summary>
- public partial class KanbanNotes : UserControl, IDynamicEditorPage
- {
- private readonly string UserID = "";
- public KanbanNotes(string userid)
- {
- UserID = userid;
- InitializeComponent();
- }
- public string AdditionalNote => NewNote.Text;
- public DynamicEditorGrid EditorGrid { get; set; }
- public PageType PageType => PageType.Other;
- public bool Ready { get; set; }
- public void Load(object item, Func<Type, CoreTable> PageDataHandler)
- {
- NotesList.ItemsSource = ((Kanban)item).Notes;
- Ready = true;
- }
- public void BeforeSave(object item)
- {
- if (!string.IsNullOrWhiteSpace(AdditionalNote))
- {
- var kanban = (Kanban)item;
- var notes = kanban.Notes.ToList();
- notes.Add(string.Format("{0:yyyy-MM-dd HH:mm:ss} {1}: {2}", DateTime.Now, UserID, AdditionalNote));
- kanban.Notes = notes.ToArray();
- }
- }
- public string Caption()
- {
- return "Notes";
- }
- public int Order()
- {
- return int.MinValue;
- }
- public void AfterSave(object item)
- {
- // no need to do anything here
- }
- public Size MinimumSize()
- {
- return new Size(400, 600);
- }
- }
- }
|