|
@@ -12,274 +12,273 @@ using InABox.DynamicGrid;
|
|
|
using InABox.WPF;
|
|
|
using Syncfusion.UI.Xaml.Diagram.Controls;
|
|
|
|
|
|
-namespace PRSDesktop
|
|
|
+namespace PRSDesktop;
|
|
|
+
|
|
|
+public class StockMovementGrid : DynamicDataGrid<StockMovement>, IDataModelSource, ISpecificGrid
|
|
|
{
|
|
|
- public class StockMovementGrid : DynamicDataGrid<StockMovement>, IDataModelSource
|
|
|
- {
|
|
|
- public static readonly DependencyProperty AllowNullLocationProperty =
|
|
|
- DependencyProperty.Register("AllowNullLocation", typeof(bool), typeof(StockMovementGrid), new UIPropertyMetadata(null));
|
|
|
+ public static readonly DependencyProperty AllowNullLocationProperty =
|
|
|
+ DependencyProperty.Register("AllowNullLocation", typeof(bool), typeof(StockMovementGrid), new UIPropertyMetadata(null));
|
|
|
|
|
|
- public static readonly DependencyProperty AllowNullBatchProperty =
|
|
|
- DependencyProperty.Register("AllowNullBatch", typeof(bool), typeof(StockMovementGrid), new UIPropertyMetadata(null));
|
|
|
+ public static readonly DependencyProperty AllowNullBatchProperty =
|
|
|
+ DependencyProperty.Register("AllowNullBatch", typeof(bool), typeof(StockMovementGrid), new UIPropertyMetadata(null));
|
|
|
|
|
|
- private Button AllButton;
|
|
|
- private bool bShowAll = true;
|
|
|
+ private Button AllButton;
|
|
|
+ private bool bShowAll = true;
|
|
|
|
|
|
- private readonly BitmapImage docs = PRSDesktop.Resources.doc_png.AsBitmapImage();
|
|
|
+ private readonly BitmapImage docs = PRSDesktop.Resources.doc_png.AsBitmapImage();
|
|
|
|
|
|
- private int syscolumn = -1;
|
|
|
+ private int syscolumn = -1;
|
|
|
|
|
|
- private static readonly BitmapImage? post = PRSDesktop.Resources.post.AsBitmapImage();
|
|
|
- private static readonly BitmapImage? tick = PRSDesktop.Resources.tick.AsBitmapImage();
|
|
|
- private static readonly BitmapImage? warning = PRSDesktop.Resources.warning.AsBitmapImage();
|
|
|
- private static readonly BitmapImage? refresh = PRSDesktop.Resources.refresh.AsBitmapImage();
|
|
|
+ private static readonly BitmapImage? post = PRSDesktop.Resources.post.AsBitmapImage();
|
|
|
+ private static readonly BitmapImage? tick = PRSDesktop.Resources.tick.AsBitmapImage();
|
|
|
+ private static readonly BitmapImage? warning = PRSDesktop.Resources.warning.AsBitmapImage();
|
|
|
+ private static readonly BitmapImage? refresh = PRSDesktop.Resources.refresh.AsBitmapImage();
|
|
|
|
|
|
- public StockMovementGrid()
|
|
|
- {
|
|
|
- ColumnsTag = "StockMovementGrid";
|
|
|
- }
|
|
|
- protected override void DoReconfigure(FluentList<DynamicGridOption> options)
|
|
|
- {
|
|
|
- base.DoReconfigure(options);
|
|
|
-
|
|
|
- options
|
|
|
- .BeginUpdate()
|
|
|
- .Add(DynamicGridOption.RecordCount)
|
|
|
- .Add(DynamicGridOption.SelectColumns)
|
|
|
- .Add(DynamicGridOption.FilterRows)
|
|
|
- .EndUpdate();
|
|
|
- }
|
|
|
- protected override void Init()
|
|
|
+ public StockMovementGrid()
|
|
|
+ {
|
|
|
+ ColumnsTag = "StockMovementGrid";
|
|
|
+ }
|
|
|
+ protected override void DoReconfigure(FluentList<DynamicGridOption> options)
|
|
|
+ {
|
|
|
+ base.DoReconfigure(options);
|
|
|
+
|
|
|
+ options
|
|
|
+ .BeginUpdate()
|
|
|
+ .Add(DynamicGridOption.RecordCount)
|
|
|
+ .Add(DynamicGridOption.SelectColumns)
|
|
|
+ .Add(DynamicGridOption.FilterRows)
|
|
|
+ .EndUpdate();
|
|
|
+ }
|
|
|
+ protected override void Init()
|
|
|
+ {
|
|
|
+ base.Init();
|
|
|
+ HiddenColumns.Add(x => x.System);
|
|
|
+ HiddenColumns.Add(x => x.Transaction);
|
|
|
+
|
|
|
+ ActionColumns.Add(new DynamicImageColumn(DocumentsImage, DocumentsClick) { Position = DynamicActionColumnPosition.Start });
|
|
|
+ HiddenColumns.Add(x => x.Documents);
|
|
|
+ HiddenColumns.Add(x => x.Batch.ID);
|
|
|
+ HiddenColumns.Add(x => x.Batch.Type);
|
|
|
+ HiddenColumns.Add(x => x.JobRequisitionItem.Requisition.Number);
|
|
|
+ AllButton = AddButton("Hide System", null, ToggleAllTransations);
|
|
|
+
|
|
|
+ HiddenColumns.Add(x => x.PostedStatus);
|
|
|
+ HiddenColumns.Add(x => x.PostedNote);
|
|
|
+
|
|
|
+ ActionColumns.Add(new DynamicImageColumn(Posted_Image, null)
|
|
|
{
|
|
|
- base.Init();
|
|
|
- HiddenColumns.Add(x => x.System);
|
|
|
- HiddenColumns.Add(x => x.Transaction);
|
|
|
+ ToolTip = Posted_ToolTip
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
- ActionColumns.Add(new DynamicImageColumn(DocumentsImage, DocumentsClick) { Position = DynamicActionColumnPosition.Start });
|
|
|
- HiddenColumns.Add(x => x.Documents);
|
|
|
- HiddenColumns.Add(x => x.Batch.ID);
|
|
|
- HiddenColumns.Add(x => x.Batch.Type);
|
|
|
- HiddenColumns.Add(x => x.JobRequisitionItem.Requisition.Number);
|
|
|
- AllButton = AddButton("Hide System", null, ToggleAllTransations);
|
|
|
+ public DateTime StartDate { get; set; } = DateTime.MinValue;
|
|
|
+ public DateTime EndDate { get; set; } = DateTime.MaxValue;
|
|
|
|
|
|
- HiddenColumns.Add(x => x.PostedStatus);
|
|
|
- HiddenColumns.Add(x => x.PostedNote);
|
|
|
+ public IStockLocation Location { get; set; }
|
|
|
|
|
|
- ActionColumns.Add(new DynamicImageColumn(Posted_Image, null)
|
|
|
- {
|
|
|
- ToolTip = Posted_ToolTip
|
|
|
- });
|
|
|
- }
|
|
|
+ public bool AllowNullLocation
|
|
|
+ {
|
|
|
+ get => (bool)GetValue(AllowNullLocationProperty);
|
|
|
+ set => SetValue(AllowNullLocationProperty, value);
|
|
|
+ }
|
|
|
+
|
|
|
+ public IStockMovementBatch Batch { get; set; }
|
|
|
|
|
|
- public DateTime StartDate { get; set; } = DateTime.MinValue;
|
|
|
- public DateTime EndDate { get; set; } = DateTime.MaxValue;
|
|
|
+ public bool AllowNullBatch
|
|
|
+ {
|
|
|
+ get => (bool)GetValue(AllowNullBatchProperty);
|
|
|
+ set => SetValue(AllowNullBatchProperty, value);
|
|
|
+ }
|
|
|
|
|
|
- public IStockLocation Location { get; set; }
|
|
|
+ public event DataModelUpdateEvent? OnUpdateDataModel;
|
|
|
|
|
|
- public bool AllowNullLocation
|
|
|
- {
|
|
|
- get => (bool)GetValue(AllowNullLocationProperty);
|
|
|
- set => SetValue(AllowNullLocationProperty, value);
|
|
|
- }
|
|
|
+ public string SectionName => "Stock Movements";
|
|
|
|
|
|
- public IStockMovementBatch Batch { get; set; }
|
|
|
+ public DataModel DataModel(Selection selection)
|
|
|
+ {
|
|
|
+ var ids = ExtractValues(x => x.ID, selection).ToArray();
|
|
|
+ return new BaseDataModel<StockMovement>(new Filter<StockMovement>(x => x.ID).InList(ids));
|
|
|
+ }
|
|
|
|
|
|
- public bool AllowNullBatch
|
|
|
+ private FrameworkElement? Posted_ToolTip(DynamicActionColumn column, CoreRow? row)
|
|
|
+ {
|
|
|
+ if (row is null)
|
|
|
{
|
|
|
- get => (bool)GetValue(AllowNullBatchProperty);
|
|
|
- set => SetValue(AllowNullBatchProperty, value);
|
|
|
+ return column.TextToolTip("Stock Movement Processed Status");
|
|
|
}
|
|
|
+ return column.TextToolTip(row.Get<StockMovement, PostedStatus>(x => x.PostedStatus) switch
|
|
|
+ {
|
|
|
+ PostedStatus.PostFailed => "Post failed: " + row.Get<StockMovement, string>(x => x.PostedNote),
|
|
|
+ PostedStatus.RequiresRepost => "Repost required: " + row.Get<StockMovement, string>(x => x.PostedNote),
|
|
|
+ PostedStatus.Posted => "Processed",
|
|
|
+ PostedStatus.NeverPosted or _ => "Not posted yet",
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
- public event DataModelUpdateEvent? OnUpdateDataModel;
|
|
|
+ private BitmapImage? Posted_Image(CoreRow? row)
|
|
|
+ {
|
|
|
+ if (row is null)
|
|
|
+ return post;
|
|
|
+ return row.Get<StockMovement, PostedStatus>(x => x.PostedStatus) switch
|
|
|
+ {
|
|
|
+ PostedStatus.PostFailed => warning,
|
|
|
+ PostedStatus.Posted => tick,
|
|
|
+ PostedStatus.RequiresRepost => refresh,
|
|
|
+ PostedStatus.NeverPosted or _ => null,
|
|
|
+ };
|
|
|
+ }
|
|
|
|
|
|
- public string SectionName => "Stock Movements";
|
|
|
+ private bool DocumentsClick(CoreRow? arg)
|
|
|
+ {
|
|
|
+ if (arg == null || arg.Get<StockMovement, int>(x => x.Documents) == 0)
|
|
|
+ return false;
|
|
|
|
|
|
- public DataModel DataModel(Selection selection)
|
|
|
+ var docs = new List<IEntityDocument>();
|
|
|
+ using (new WaitCursor())
|
|
|
{
|
|
|
- var ids = ExtractValues(x => x.ID, selection).ToArray();
|
|
|
- return new BaseDataModel<StockMovement>(new Filter<StockMovement>(x => x.ID).InList(ids));
|
|
|
+ var batchid = arg.Get<StockMovement, Guid>(x => x.Batch.ID);
|
|
|
+ var table = new Client<StockMovementBatchDocument>().Query(
|
|
|
+ new Filter<StockMovementBatchDocument>(x => x.EntityLink.ID).IsEqualTo(batchid)
|
|
|
+ );
|
|
|
+ foreach (var row in table.Rows)
|
|
|
+ docs.Add(row.ToObject<StockMovementBatchDocument>());
|
|
|
}
|
|
|
|
|
|
- private FrameworkElement? Posted_ToolTip(DynamicActionColumn column, CoreRow? row)
|
|
|
+ if (docs.Any())
|
|
|
{
|
|
|
- if (row is null)
|
|
|
- {
|
|
|
- return column.TextToolTip("Stock Movement Processed Status");
|
|
|
- }
|
|
|
- return column.TextToolTip(row.Get<StockMovement, PostedStatus>(x => x.PostedStatus) switch
|
|
|
- {
|
|
|
- PostedStatus.PostFailed => "Post failed: " + row.Get<StockMovement, string>(x => x.PostedNote),
|
|
|
- PostedStatus.RequiresRepost => "Repost required: " + row.Get<StockMovement, string>(x => x.PostedNote),
|
|
|
- PostedStatus.Posted => "Processed",
|
|
|
- PostedStatus.NeverPosted or _ => "Not posted yet",
|
|
|
- });
|
|
|
+ var editor = new DocumentEditor(docs.ToArray());
|
|
|
+ //editor.PrintAllowed = Security.IsAllowed<CanPrintFactoryFloorDrawings>();
|
|
|
+ editor.SaveAllowed = Security.IsAllowed<CanSaveFactoryFloorDrawings>();
|
|
|
+ editor.ShowDialog();
|
|
|
}
|
|
|
-
|
|
|
- private BitmapImage? Posted_Image(CoreRow? row)
|
|
|
+ else
|
|
|
{
|
|
|
- if (row is null)
|
|
|
- return post;
|
|
|
- return row.Get<StockMovement, PostedStatus>(x => x.PostedStatus) switch
|
|
|
- {
|
|
|
- PostedStatus.PostFailed => warning,
|
|
|
- PostedStatus.Posted => tick,
|
|
|
- PostedStatus.RequiresRepost => refresh,
|
|
|
- PostedStatus.NeverPosted or _ => null,
|
|
|
- };
|
|
|
+ MessageBox.Show("No Documents Available!");
|
|
|
}
|
|
|
|
|
|
- private bool DocumentsClick(CoreRow? arg)
|
|
|
- {
|
|
|
- if (arg == null || arg.Get<StockMovement, int>(x => x.Documents) == 0)
|
|
|
- return false;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
- var docs = new List<IEntityDocument>();
|
|
|
- using (new WaitCursor())
|
|
|
- {
|
|
|
- var batchid = arg.Get<StockMovement, Guid>(x => x.Batch.ID);
|
|
|
- var table = new Client<StockMovementBatchDocument>().Query(
|
|
|
- new Filter<StockMovementBatchDocument>(x => x.EntityLink.ID).IsEqualTo(batchid)
|
|
|
- );
|
|
|
- foreach (var row in table.Rows)
|
|
|
- docs.Add(row.ToObject<StockMovementBatchDocument>());
|
|
|
- }
|
|
|
-
|
|
|
- if (docs.Any())
|
|
|
- {
|
|
|
- var editor = new DocumentEditor(docs.ToArray());
|
|
|
- //editor.PrintAllowed = Security.IsAllowed<CanPrintFactoryFloorDrawings>();
|
|
|
- editor.SaveAllowed = Security.IsAllowed<CanSaveFactoryFloorDrawings>();
|
|
|
- editor.ShowDialog();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- MessageBox.Show("No Documents Available!");
|
|
|
- }
|
|
|
+ private BitmapImage? DocumentsImage(CoreRow? arg)
|
|
|
+ {
|
|
|
+ if (arg == null)
|
|
|
+ return docs;
|
|
|
+ return arg.Get<Delivery, int>(x => x.Documents) > 0 ? docs : null;
|
|
|
+ }
|
|
|
|
|
|
- return false;
|
|
|
- }
|
|
|
+ private bool ToggleAllTransations(Button arg1, CoreRow[] arg2)
|
|
|
+ {
|
|
|
+ bShowAll = !bShowAll;
|
|
|
+ AllButton.Content = bShowAll ? "Hide System" : "Show All";
|
|
|
+ return true;
|
|
|
+ }
|
|
|
|
|
|
- private BitmapImage? DocumentsImage(CoreRow? arg)
|
|
|
+ protected override void Reload(Filters<StockMovement> criteria, Columns<StockMovement> columns, ref SortOrder<StockMovement>? sort,
|
|
|
+ Action<CoreTable, Exception> action)
|
|
|
+ {
|
|
|
+ if (!AllowNullLocation && (Location == null || Location.ID == Guid.Empty))
|
|
|
{
|
|
|
- if (arg == null)
|
|
|
- return docs;
|
|
|
- return arg.Get<Delivery, int>(x => x.Documents) > 0 ? docs : null;
|
|
|
+ criteria.Add(new Filter<StockMovement>(x => x.ID).IsEqualTo(CoreUtils.FullGuid));
|
|
|
+ criteria.Add(new Filter<StockMovement>(x => x.ID).IsEqualTo(Guid.Empty));
|
|
|
}
|
|
|
-
|
|
|
- private bool ToggleAllTransations(Button arg1, CoreRow[] arg2)
|
|
|
+ else
|
|
|
{
|
|
|
- bShowAll = !bShowAll;
|
|
|
- AllButton.Content = bShowAll ? "Hide System" : "Show All";
|
|
|
- return true;
|
|
|
+ if (Location != null)
|
|
|
+ criteria.Add(new Filter<StockMovement>(x => x.Location.ID).IsEqualTo(Location.ID));
|
|
|
}
|
|
|
|
|
|
- protected override void Reload(Filters<StockMovement> criteria, Columns<StockMovement> columns, ref SortOrder<StockMovement>? sort,
|
|
|
- Action<CoreTable, Exception> action)
|
|
|
+ if (!AllowNullBatch && (Batch == null || Batch.ID == Guid.Empty))
|
|
|
{
|
|
|
- if (!AllowNullLocation && (Location == null || Location.ID == Guid.Empty))
|
|
|
- {
|
|
|
- criteria.Add(new Filter<StockMovement>(x => x.ID).IsEqualTo(CoreUtils.FullGuid));
|
|
|
- criteria.Add(new Filter<StockMovement>(x => x.ID).IsEqualTo(Guid.Empty));
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (Location != null)
|
|
|
- criteria.Add(new Filter<StockMovement>(x => x.Location.ID).IsEqualTo(Location.ID));
|
|
|
- }
|
|
|
+ criteria.Add(new Filter<StockMovement>(x => x.ID).IsEqualTo(CoreUtils.FullGuid));
|
|
|
+ criteria.Add(new Filter<StockMovement>(x => x.ID).IsEqualTo(Guid.Empty));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (Batch != null)
|
|
|
+ criteria.Add(new Filter<StockMovement>(x => x.Batch.ID).IsEqualTo(Batch.ID));
|
|
|
+ }
|
|
|
|
|
|
- if (!AllowNullBatch && (Batch == null || Batch.ID == Guid.Empty))
|
|
|
- {
|
|
|
- criteria.Add(new Filter<StockMovement>(x => x.ID).IsEqualTo(CoreUtils.FullGuid));
|
|
|
- criteria.Add(new Filter<StockMovement>(x => x.ID).IsEqualTo(Guid.Empty));
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (Batch != null)
|
|
|
- criteria.Add(new Filter<StockMovement>(x => x.Batch.ID).IsEqualTo(Batch.ID));
|
|
|
- }
|
|
|
+ if (!bShowAll)
|
|
|
+ criteria.Add(new Filter<StockMovement>(x => x.System).IsEqualTo(false));
|
|
|
|
|
|
- if (!bShowAll)
|
|
|
- criteria.Add(new Filter<StockMovement>(x => x.System).IsEqualTo(false));
|
|
|
+ if (!DateTime.Equals(StartDate, DateTime.MinValue))
|
|
|
+ criteria.Add(new Filter<StockMovement>(x => x.Date).IsGreaterThanOrEqualTo(StartDate));
|
|
|
|
|
|
- if (!DateTime.Equals(StartDate, DateTime.MinValue))
|
|
|
- criteria.Add(new Filter<StockMovement>(x => x.Date).IsGreaterThanOrEqualTo(StartDate));
|
|
|
+ if (!DateTime.Equals(EndDate, DateTime.MaxValue))
|
|
|
+ criteria.Add(new Filter<StockMovement>(x => x.Date).IsLessThan(EndDate.Date.AddDays(1)));
|
|
|
|
|
|
- if (!DateTime.Equals(EndDate, DateTime.MaxValue))
|
|
|
- criteria.Add(new Filter<StockMovement>(x => x.Date).IsLessThan(EndDate.Date.AddDays(1)));
|
|
|
+ sort = new SortOrder<StockMovement>(x => x.Date, SortDirection.Descending).ThenBy(x => x.System);
|
|
|
+ base.Reload(criteria, columns, ref sort, action);
|
|
|
+ }
|
|
|
|
|
|
- sort = new SortOrder<StockMovement>(x => x.Date, SortDirection.Descending).ThenBy(x => x.System);
|
|
|
- base.Reload(criteria, columns, ref sort, action);
|
|
|
- }
|
|
|
+ protected override StockMovement CreateItem()
|
|
|
+ {
|
|
|
+ var result = base.CreateItem();
|
|
|
+ result.Location.ID = Location != null ? Location.ID : Guid.Empty;
|
|
|
+ return result;
|
|
|
+ }
|
|
|
|
|
|
- protected override StockMovement CreateItem()
|
|
|
- {
|
|
|
- var result = base.CreateItem();
|
|
|
- result.Location.ID = Location != null ? Location.ID : Guid.Empty;
|
|
|
- return result;
|
|
|
- }
|
|
|
+ protected override BaseEditor? GetEditor(object item, DynamicGridColumn column)
|
|
|
+ {
|
|
|
+ if (column.ColumnName.Equals("Location.ID"))
|
|
|
+ return new NullEditor();
|
|
|
+ return base.GetEditor(item, column);
|
|
|
+ }
|
|
|
|
|
|
- protected override BaseEditor? GetEditor(object item, DynamicGridColumn column)
|
|
|
+ protected override void DeleteItems(params CoreRow[] rows)
|
|
|
+ {
|
|
|
+ if (!rows.Any())
|
|
|
{
|
|
|
- if (column.ColumnName.Equals("Location.ID"))
|
|
|
- return new NullEditor();
|
|
|
- return base.GetEditor(item, column);
|
|
|
+ MessageBox.Show("Please select an item first!");
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
- protected override void DeleteItems(params CoreRow[] rows)
|
|
|
+ var txnid = rows.First().Get<StockMovement, Guid>(x => x.Transaction);
|
|
|
+ var allrecords = new Client<StockMovement>().Query(
|
|
|
+ new Filter<StockMovement>(x => x.Transaction).IsEqualTo(txnid),
|
|
|
+ new Columns<StockMovement>(x => x.ID)
|
|
|
+ );
|
|
|
+ base.DeleteItems(allrecords.Rows.ToArray());
|
|
|
+ }
|
|
|
+
|
|
|
+ //int typecolumn = -1;
|
|
|
+ protected override DynamicGridStyle GetRowStyle(CoreRow row, DynamicGridStyle style)
|
|
|
+ {
|
|
|
+ var result = base.GetRowStyle(row, style);
|
|
|
+ if (syscolumn == -1)
|
|
|
{
|
|
|
- if (!rows.Any())
|
|
|
- {
|
|
|
- MessageBox.Show("Please select an item first!");
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- var txnid = rows.First().Get<StockMovement, Guid>(x => x.Transaction);
|
|
|
- var allrecords = new Client<StockMovement>().Query(
|
|
|
- new Filter<StockMovement>(x => x.Transaction).IsEqualTo(txnid),
|
|
|
- new Columns<StockMovement>(x => x.ID)
|
|
|
- );
|
|
|
- base.DeleteItems(allrecords.Rows.ToArray());
|
|
|
+ var col = row.Table.Columns.FirstOrDefault(x => x.ColumnName.Equals("System"));
|
|
|
+ syscolumn = row.Table.Columns.IndexOf(col);
|
|
|
}
|
|
|
|
|
|
- //int typecolumn = -1;
|
|
|
- protected override DynamicGridStyle GetRowStyle(CoreRow row, DynamicGridStyle style)
|
|
|
+ if (row.Values[syscolumn].Equals(true)) //row.Get<StockMovement, bool>(x => x.System))
|
|
|
{
|
|
|
- var result = base.GetRowStyle(row, style);
|
|
|
- if (syscolumn == -1)
|
|
|
+ result = new DynamicGridRowStyle
|
|
|
{
|
|
|
- var col = row.Table.Columns.FirstOrDefault(x => x.ColumnName.Equals("System"));
|
|
|
- syscolumn = row.Table.Columns.IndexOf(col);
|
|
|
- }
|
|
|
-
|
|
|
- if (row.Values[syscolumn].Equals(true)) //row.Get<StockMovement, bool>(x => x.System))
|
|
|
- {
|
|
|
- result = new DynamicGridRowStyle
|
|
|
- {
|
|
|
- Foreground = new SolidColorBrush(Colors.Gray),
|
|
|
- FontStyle = FontStyles.Italic,
|
|
|
- Background = new SolidColorBrush(Colors.Gainsboro)
|
|
|
- };
|
|
|
- return result;
|
|
|
- }
|
|
|
-
|
|
|
- //if (typecolumn == -1)
|
|
|
- //{
|
|
|
- // CoreColumn col = row.Table.Columns.FirstOrDefault(x => x.ColumnName.Equals("Batch.Type"));
|
|
|
- // typecolumn = row.Table.Columns.IndexOf(col);
|
|
|
- //}
|
|
|
-
|
|
|
- //var type = (StockMovementBatchType)row.Values[typecolumn];
|
|
|
- //result = new NewDynamicGridStyle()
|
|
|
- //{
|
|
|
- // Background = new SolidColorBrush(
|
|
|
- // type == StockMovementBatchType.Stocktake
|
|
|
- // ? Colors.LightGreen
|
|
|
- // : type == StockMovementBatchType.Receipt
|
|
|
- // ? Colors.LightYellow
|
|
|
- // : Colors.LightSalmon
|
|
|
- // )
|
|
|
- //};
|
|
|
+ Foreground = new SolidColorBrush(Colors.Gray),
|
|
|
+ FontStyle = FontStyles.Italic,
|
|
|
+ Background = new SolidColorBrush(Colors.Gainsboro)
|
|
|
+ };
|
|
|
return result;
|
|
|
}
|
|
|
+
|
|
|
+ //if (typecolumn == -1)
|
|
|
+ //{
|
|
|
+ // CoreColumn col = row.Table.Columns.FirstOrDefault(x => x.ColumnName.Equals("Batch.Type"));
|
|
|
+ // typecolumn = row.Table.Columns.IndexOf(col);
|
|
|
+ //}
|
|
|
+
|
|
|
+ //var type = (StockMovementBatchType)row.Values[typecolumn];
|
|
|
+ //result = new NewDynamicGridStyle()
|
|
|
+ //{
|
|
|
+ // Background = new SolidColorBrush(
|
|
|
+ // type == StockMovementBatchType.Stocktake
|
|
|
+ // ? Colors.LightGreen
|
|
|
+ // : type == StockMovementBatchType.Receipt
|
|
|
+ // ? Colors.LightYellow
|
|
|
+ // : Colors.LightSalmon
|
|
|
+ // )
|
|
|
+ //};
|
|
|
+ return result;
|
|
|
}
|
|
|
}
|