лаба делается пока ничего не готово

This commit is contained in:
Полина Чубыкина 2024-05-14 23:30:21 +04:00
parent 028aa8e962
commit a983eba249
30 changed files with 485 additions and 5 deletions

View File

@ -3,7 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32825.248
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BookshopView", "BookshopView\BookshopView.csproj", "{96DE30E7-2B91-4357-954F-31B755339128}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BookshopDataModels", "BookshopDataModels\BookshopDataModels.csproj", "{36D7E02E-39EE-4C04-9AEB-6298B67D935C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BookshopView", "BookshopView\BookshopView.csproj", "{8406C468-605F-4932-AB19-2BFD98480D19}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BookshopContracts", "BookshopContracts\BookshopContracts.csproj", "{9BC70D3F-9F6E-4B9B-A519-5C46417A9B6D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -11,10 +15,18 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{96DE30E7-2B91-4357-954F-31B755339128}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{96DE30E7-2B91-4357-954F-31B755339128}.Debug|Any CPU.Build.0 = Debug|Any CPU
{96DE30E7-2B91-4357-954F-31B755339128}.Release|Any CPU.ActiveCfg = Release|Any CPU
{96DE30E7-2B91-4357-954F-31B755339128}.Release|Any CPU.Build.0 = Release|Any CPU
{36D7E02E-39EE-4C04-9AEB-6298B67D935C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{36D7E02E-39EE-4C04-9AEB-6298B67D935C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{36D7E02E-39EE-4C04-9AEB-6298B67D935C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{36D7E02E-39EE-4C04-9AEB-6298B67D935C}.Release|Any CPU.Build.0 = Release|Any CPU
{8406C468-605F-4932-AB19-2BFD98480D19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8406C468-605F-4932-AB19-2BFD98480D19}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8406C468-605F-4932-AB19-2BFD98480D19}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8406C468-605F-4932-AB19-2BFD98480D19}.Release|Any CPU.Build.0 = Release|Any CPU
{9BC70D3F-9F6E-4B9B-A519-5C46417A9B6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9BC70D3F-9F6E-4B9B-A519-5C46417A9B6D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9BC70D3F-9F6E-4B9B-A519-5C46417A9B6D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9BC70D3F-9F6E-4B9B-A519-5C46417A9B6D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BookshopDataModels.Models;
namespace BookshopContracts.BindingModels
{
public class AuthorBindingModel : IAuthorModel
{
public int Id { get; set; }
public string AuthorName { get; set; } = string.Empty;
public string Country { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BookshopDataModels.Models;
namespace BookshopContracts.BindingModels
{
public class BookBindingModel : IBookModel
{
public int Id { get; set; }
public string Title { get; set; } = string.Empty;
public int YearOfPublication { get; set; }
public int AuthorId { get; set; }
public int GenreId { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BookshopDataModels.Models;
namespace BookshopContracts.BindingModels
{
public class GenreBindingModel : IGenreModel
{
public int Id { get; set; }
public string GenreName { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,19 @@
using BookshopDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BookshopContracts.BindingModels
{
public class InstanceBindingModel : IInstanceModel
{
public int Id { get; set; }
public bool Pictures { get; set; }
public int StockQuantity { get; set; }
public double Price { get; set; }
public int BookId { get; set; }
public int PublisherId { get; set; }
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BookshopDataModels.Models;
namespace BookshopContracts.BindingModels
{
public class OrderBindingModel : IOrderModel
{
public int Id { get; set; }
public DateTime OrderDate { get; set; }
public int Quantity { get; set; }
public int InstanceId { get; set; }
public int UserId { get; set; }
}
}

View File

@ -0,0 +1,18 @@
using BookshopDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BookshopContracts.BindingModels
{
public class PublisherBindingModel : IPublisherModel
{
public int Id { get; set; }
public string PublisherName { get; set; } = string.Empty;
public string Address { get; set; } = string.Empty;
public string PhoneNumber { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,18 @@
using BookshopDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BookshopContracts.BindingModels
{
public class ReviewBindingModel : IReviewModel
{
public int Id { get; set; }
public string ReviewText { get; set; } = string.Empty;
public DateTime ReviewDate { get; set; }
public int InstanceId { get; set; }
public int UserId { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using BookshopDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BookshopContracts.BindingModels
{
public class UserBindingModel : IUserModel
{
public int Id { get; set; }
public string Username { get; set; } = string.Empty;
public string UserEmail { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Folder Include="SearchModel\" />
<Folder Include="ViewModels\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BookshopDataModels\BookshopDataModels.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BookshopContracts.BindingModels;
namespace BookshopContracts.BusinessLogicsContracts
{
public interface IAuthorLogic
{
List<AuthorViewModel>? ReadList(AuthorSearchModel? model);
AuthorViewModel? ReadElement(AuthorSearchModel model);
bool Create(AuthorBindingModel model);
bool Update(AuthorBindingModel model);
bool Delete(AuthorBindingModel model);
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BookshopContracts.BindingModels;
namespace BookshopContracts.BusinessLogicsContracts
{
public interface IBookLogic
{
List<BookViewModel>? ReadList(BookSearchModel? model);
BookViewModel? ReadElement(BookSearchModel model);
bool Create(BookBindingModel model);
bool Update(BookBindingModel model);
bool Delete(BookBindingModel model);
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BookshopContracts.BindingModels;
namespace BookshopContracts.BusinessLogicsContracts
{
public interface IGenreLogic
{
List<GenreViewModel>? ReadList(GenreSearchModel? model);
GenreViewModel? ReadElement(GenreSearchModel model);
bool Create(GenreBindingModel model);
bool Update(GenreBindingModel model);
bool Delete(GenreBindingModel model);
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BookshopContracts.BindingModels;
namespace BookshopContracts.BusinessLogicsContracts
{
public interface IInstanceLogic
{
List<InstanceViewModel>? ReadList(InstanceSearchModel? model);
InstanceViewModel? ReadElement(InstanceSearchModel model);
bool Create(InstanceBindingModel model);
bool Update(InstanceBindingModel model);
bool Delete(InstanceBindingModel model);
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BookshopContracts.BindingModels;
namespace BookshopContracts.BusinessLogicsContracts
{
public interface IOrderLogic
{
List<OrderViewModel>? ReadList(OrderSearchModel? model);
OrderViewModel? ReadElement(OrderSearchModel model);
bool Create(OrderBindingModel model);
bool Update(OrderBindingModel model);
bool Delete(OrderBindingModel model);
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BookshopContracts.BindingModels;
namespace BookshopContracts.BusinessLogicsContracts
{
public interface IPublisherLogic
{
List<PublisherViewModel>? ReadList(PublisherSearchModel? model);
PublisherViewModel? ReadElement(PublisherSearchModel model);
bool Create(PublisherBindingModel model);
bool Update(PublisherBindingModel model);
bool Delete(PublisherBindingModel model);
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BookshopContracts.BindingModels;
namespace BookshopContracts.BusinessLogicsContracts
{
public interface IReviewLogic
{
List<ReviewViewModel>? ReadList(ReviewSearchModel? model);
ReviewViewModel? ReadElement(ReviewSearchModel model);
bool Create(ReviewBindingModel model);
bool Update(ReviewBindingModel model);
bool Delete(ReviewBindingModel model);
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BookshopContracts.BindingModels;
namespace BookshopContracts.BusinessLogicsContracts
{
public interface IUserLogic
{
List<UserViewModel>? ReadList(UserSearchModel? model);
UserViewModel? ReadElement(UserSearchModel model);
bool Create(UserBindingModel model);
bool Update(UserBindingModel model);
bool Delete(UserBindingModel model);
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BookshopContracts.StorageContracts
{
internal class IAuthorStorage
{
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BookshopContracts.StorageContracts
{
internal class IBookStorage
{
}
}

View File

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BookshopDataModels
{
public interface IId
{
int Id { get; }
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BookshopDataModels.Models
{
public interface IAuthorModel : IId
{
string AuthorName { get; }
string Country { get; }
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BookshopDataModels.Models
{
public interface IBookModel : IId
{
string Title { get; }
int YearOfPublication { get; }
int AuthorId { get; }
int GenreId { get; }
}
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BookshopDataModels.Models
{
public interface IGenreModel : IId
{
string GenreName { get; }
}
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BookshopDataModels.Models
{
public interface IInstanceModel : IId
{
bool Pictures { get; }
int StockQuantity { get; }
double Price { get; }
int BookId { get; }
int PublisherId { get; }
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BookshopDataModels.Models
{
public interface IOrderModel : IId
{
DateTime OrderDate { get; }
int Quantity { get; }
int InstanceId { get; }
int UserId { get; }
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BookshopDataModels.Models
{
public interface IPublisherModel : IId
{
string PublisherName { get; }
string Address { get; }
string PhoneNumber { get; }
string Email { get; }
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BookshopDataModels.Models
{
public interface IReviewModel
{
string ReviewText { get; }
DateTime ReviewDate { get; }
int InstanceId { get; }
int UserId { get; }
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BookshopDataModels.Models
{
public interface IUserModel
{
string Username { get; }
string UserEmail { get; }
}
}