|
@@ -19,6 +19,7 @@ using InABox.WPF;
|
|
|
using InABox.Scripting;
|
|
|
using System.Threading;
|
|
|
using InABox.Wpf;
|
|
|
+using InABox.Wpf.Editors;
|
|
|
|
|
|
namespace PRSDesktop
|
|
|
{
|
|
@@ -204,7 +205,7 @@ namespace PRSDesktop
|
|
|
var completed = packet.Completed;
|
|
|
|
|
|
var onhold = packet.OnHold;
|
|
|
- var issues = string.Join("\n=======================",packet.Problem.Notes);
|
|
|
+ var issues = NotesEditor.FormatNotes(packet.Problem.Notes);
|
|
|
var issuesResolved = packet.Problem.Resolved;
|
|
|
|
|
|
var orderitemid = packet.OrderItem.ID;
|
|
@@ -553,6 +554,7 @@ namespace PRSDesktop
|
|
|
clearpriority.Visibility = priority ? Visibility.Visible : Visibility.Collapsed;
|
|
|
|
|
|
editissues.Visibility = Visibility.Visible;
|
|
|
+ editissues.Header = packets.Count == 1 ? "View/Update Issues" : "Add Issue";
|
|
|
sethold.Visibility = Security.IsAllowed<CanManagePacketHolds>() && !onhold ? Visibility.Visible : Visibility.Collapsed;
|
|
|
clearhold.Visibility = Security.IsAllowed<CanManagePacketHolds>() && onhold ? Visibility.Visible : Visibility.Collapsed;
|
|
|
|
|
@@ -1168,19 +1170,29 @@ namespace PRSDesktop
|
|
|
var item = (MenuItem)sender;
|
|
|
var model = (ManufacturingKanban)item.Tag;
|
|
|
var pkts = GetSelectedPackets(model.ID).ToArray();
|
|
|
- if (pkts.Length != 1)
|
|
|
+ if (pkts.Length == 1)
|
|
|
{
|
|
|
- MessageWindow.ShowMessage("You can only edit one packet at a time", "Error");
|
|
|
- return;
|
|
|
+ var pkt = pkts.First();
|
|
|
+ var _grid = DynamicGridUtils.CreateDynamicGrid(typeof(DynamicItemsListGrid<>), pkt.Problem.GetType());
|
|
|
+ if (_grid.EditItems(new object[] { pkt.Problem }))
|
|
|
+ {
|
|
|
+ Progress.ShowModal("Updating Issues", progress => { Client.Save(pkts, "Updated Issues"); });
|
|
|
+ ClearSelectedKanbans();
|
|
|
+ OnChanged?.Invoke(this, new EventArgs());
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
- var pkt = pkts.First();
|
|
|
- var _grid = DynamicGridUtils.CreateDynamicGrid(typeof(DynamicItemsListGrid<>), pkt.Problem.GetType());
|
|
|
- if (_grid.EditItems(new object[] { pkt.Problem }))
|
|
|
+ else
|
|
|
{
|
|
|
- Progress.ShowModal("Updating Issues", progress => { new Client<ManufacturingPacket>().Save(pkts, "Updated Issues"); });
|
|
|
- ClearSelectedKanbans();
|
|
|
- OnChanged?.Invoke(this, new EventArgs());
|
|
|
+ var issue = "";
|
|
|
+ if(TextBoxDialog.Execute("Enter new issue: ", ref issue) && !issue.IsNullOrWhiteSpace())
|
|
|
+ {
|
|
|
+ issue = $"{DateTime.Now:yyyy-MM-dd HH:mm:ss} {ClientFactory.UserID}: {issue}";
|
|
|
+ foreach(var pkt in pkts)
|
|
|
+ {
|
|
|
+ pkt.Problem.Notes = pkt.Problem.Notes.Concatenate([issue]);
|
|
|
+ }
|
|
|
+ Progress.ShowModal("Updating Issues", progress => { Client.Save(pkts, "Updated Issues"); });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|