ConsolidatedInventoryHandlers.cs
2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System;
using System.Collections.Generic;
using System.Linq;
using Sungero.Core;
using Sungero.CoreEntities;
using DirRX.Storage.ConsolidatedInventory;
namespace DirRX.Storage
{
partial class ConsolidatedInventoryClientHandlers
{
public override void Refresh(Sungero.Presentation.FormRefreshEventArgs e)
{
_obj.State.IsEnabled = _obj.Status == Status.Active;
}
public virtual void FundValueInput(DirRX.Storage.Client.ConsolidatedInventoryFundValueInputEventArgs e)
{
// Проверка на уже существующие сводные описи.
var consInventories = DirRX.Storage.PublicFunctions.Module.Remote.GetConsolidatedInventories(e.NewValue);
foreach (var inventory in consInventories)
{
if (_obj.Type == inventory.Type && !inventory.Equals(_obj))
{
var consType = ConsolidatedInventories.Info.Properties.Type.GetLocalizedValue(_obj.Type);
e.AddWarning(_obj.Info.Properties.Fund,
DirRX.Storage.ConsolidatedInventories.Resources.ErrorConsolidatedInventoryAlreadyExistsFormat(e.NewValue, consType),
_obj.Info.Properties.Fund, _obj.Info.Properties.Type);
}
}
}
public virtual void TypeValueInput(Sungero.Presentation.EnumerationValueInputEventArgs e)
{
// Проверка на уже существующие сводные описи.
var consInventories = DirRX.Storage.PublicFunctions.Module.Remote.GetConsolidatedInventories(_obj.Fund);
foreach (var inventory in consInventories)
{
if (e.NewValue == inventory.Type && !inventory.Equals(_obj))
{
var consType = ConsolidatedInventories.Info.Properties.Type.GetLocalizedValue(e.NewValue);
e.AddWarning(_obj.Info.Properties.Type,
DirRX.Storage.ConsolidatedInventories.Resources.ErrorConsolidatedInventoryAlreadyExistsFormat(_obj.Fund, consType),
_obj.Info.Properties.Type, _obj.Info.Properties.Fund);
}
}
}
}
}