first edit
This commit is contained in:
10
XLIMS.CONTRACT/AssemblyInfo.cs
Normal file
10
XLIMS.CONTRACT/AssemblyInfo.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System.Windows;
|
||||
|
||||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
||||
13
XLIMS.CONTRACT/IActivityViewModel.cs
Normal file
13
XLIMS.CONTRACT/IActivityViewModel.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace XLIMS.CONTRACT
|
||||
{
|
||||
public interface IActivityViewModel
|
||||
{
|
||||
string Title { get; }
|
||||
object View { get; }
|
||||
}
|
||||
|
||||
}
|
||||
12
XLIMS.CONTRACT/IDialogService.cs
Normal file
12
XLIMS.CONTRACT/IDialogService.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace XLIMS.CONTRACT;
|
||||
|
||||
public interface IDialogService
|
||||
{
|
||||
void ShowDialog<TViewModel>(TViewModel viewModel) where TViewModel : class;
|
||||
|
||||
// Если нужны модальные окна с результатом:
|
||||
bool? ShowDialog<TViewModel>(TViewModel viewModel, out object? result)
|
||||
where TViewModel : class;
|
||||
//немодальные окна
|
||||
void Show<TViewModel>(TViewModel viewModel) where TViewModel : class;
|
||||
}
|
||||
32
XLIMS.CONTRACT/IGenericRepository.cs
Normal file
32
XLIMS.CONTRACT/IGenericRepository.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System.Linq.Expressions;
|
||||
|
||||
namespace XLIMS.CONTRACT
|
||||
{
|
||||
// Интерфейс generic-репозитория
|
||||
public interface IGenericRepository<TEntity> where TEntity : class
|
||||
{
|
||||
Task<TEntity> GetByIdAsync(int id);
|
||||
Task<IEnumerable<TEntity>> GetAllAsync();
|
||||
Task<IEnumerable<TEntity>> WhereAsync(Expression<Func<TEntity, bool>> predicate);
|
||||
IEnumerable<TEntity> Find(Expression<Func<TEntity, bool>> predicate);
|
||||
Task<IEnumerable<TEntity>> FindAsync(Expression<Func<TEntity, bool>> predicate);
|
||||
|
||||
Task<TEntity> SingleOrDefaultAsync(Expression<Func<TEntity, bool>> predicate);
|
||||
|
||||
Task AddAsync(TEntity entity);
|
||||
Task AddRangeAsync(IEnumerable<TEntity> entities);
|
||||
|
||||
Task UpdateAsync(TEntity entity);
|
||||
Task UpdateRangeAsync(IEnumerable<TEntity> entities);
|
||||
|
||||
Task RemoveAsync(TEntity entity);
|
||||
Task RemoveRangeAsync(IEnumerable<TEntity> entities);
|
||||
|
||||
Task<int> CountAsync(Expression<Func<TEntity, bool>> predicate = null);
|
||||
|
||||
event Action SetChanged;
|
||||
|
||||
Task<int> SaveChangesAsync();
|
||||
int SaveChanges();
|
||||
}
|
||||
}
|
||||
24
XLIMS.CONTRACT/ILimsService.cs
Normal file
24
XLIMS.CONTRACT/ILimsService.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using XLIMS.DATA.Models;
|
||||
|
||||
namespace XLIMS.CONTRACT
|
||||
{
|
||||
public interface ILimsService
|
||||
{
|
||||
IGenericRepository<BookSet> Books { get; }
|
||||
IGenericRepository<DataSet> Datas { get; }
|
||||
IGenericRepository<DeviceSet> Devices { get; }
|
||||
IGenericRepository<DivisionSet> Divisions { get; }
|
||||
IGenericRepository<DocumentSet> Documents { get; }
|
||||
IGenericRepository<PersonalSet> Personals { get; }
|
||||
IGenericRepository<Spnmtp> Spnmtps { get; }
|
||||
IGenericRepository<Spoi> Spois { get; }
|
||||
IGenericRepository<Tip> Tips { get; }
|
||||
IGenericRepository<Tprz> Tprzs { get; }
|
||||
|
||||
Task<int> SaveChangesAsync();
|
||||
int SaveChanges();
|
||||
}
|
||||
}
|
||||
28
XLIMS.CONTRACT/XLIMS.CONTRACT.csproj
Normal file
28
XLIMS.CONTRACT/XLIMS.CONTRACT.csproj
Normal file
@@ -0,0 +1,28 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0-windows</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWPF>true</UseWPF>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="IBookService.cs" />
|
||||
<Compile Remove="IDataSetService.cs" />
|
||||
<Compile Remove="IDeviceService.cs" />
|
||||
<Compile Remove="IDivisionService.cs" />
|
||||
<Compile Remove="IDocumentService.cs" />
|
||||
<Compile Remove="ILimsService1.cs" />
|
||||
<Compile Remove="IPersonalService.cs" />
|
||||
<Compile Remove="ISpnmtpService.cs" />
|
||||
<Compile Remove="ISpoiService.cs" />
|
||||
<Compile Remove="ITipService.cs" />
|
||||
<Compile Remove="ITprzService.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\XLIMS.DATA\XLIMS.DATA.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user