ConsolidatedInventorySharedFunctions.cs
1.1 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
using System;
using System.Collections.Generic;
using System.Linq;
using Sungero.Core;
using Sungero.CoreEntities;
using DirRX.Storage.ConsolidatedInventory;
namespace DirRX.Storage.Shared
{
partial class ConsolidatedInventoryFunctions
{
/// <summary>
/// Получить список дел описи за указанный год.
/// </summary>
/// <param name="year">Год.</param>
/// <returns>Список дел.</returns>
[Public]
public virtual IQueryable<DirRX.LongTermArchive.ICaseFile> GetCaseFilesByYear(int year)
{
return PublicFunctions.ConsolidatedInventory.Remote.GetCaseFiles(_obj).Where(x => x.LTAConsInventoryYearDirRX == year);
}
/// <summary>
/// Обновить количество дел в сводной описи.
/// </summary>
[Public]
public virtual void UpdateConsolidatedInventory()
{
var newCount = PublicFunctions.ConsolidatedInventory.Remote.GetCaseFiles(_obj).Count();
if (_obj.CasesNumber != newCount)
{
_obj.CasesNumber = newCount;
_obj.Save();
}
}
}
}