Создание BankContracts для роли Поставщик.

This commit is contained in:
ksenianeva 2023-04-02 16:52:24 +04:00
parent a487b5709d
commit f61a9d291f
20 changed files with 334 additions and 9 deletions

View File

@ -0,0 +1,24 @@
using BankDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankContracts.BindingModels
{
public class BankOperatorBindingModel : IBankOperatorModel
{
public string Login { get; set; } = String.Empty;
public string Password { get; set; } = String.Empty;
public string FirstName { get; set; } = String.Empty;
public string LastName { get; set; } = String.Empty;
public string? MiddleName { get; set; } = String.Empty;
public int Id { get; set; }
}
}

View File

@ -0,0 +1,20 @@
using BankDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankContracts.BindingModels
{
public class CreditProgramBindingModel : ICreditProgramModel
{
public string Name { get; set; } = String.Empty;
public int Persent { get; set; }
public Dictionary<int, ICurrencyModel> Currencies { get; set; } = new();
public int Id { get; set; }
}
}

View File

@ -1,4 +1,5 @@
using System;
using BankDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -6,7 +7,9 @@ using System.Threading.Tasks;
namespace BankContracts.BindingModels
{
public class CurrencyBindingModel
public class CurrencyBindingModel : ICurrencyModel
{
public string Name { get; set; } = String.Empty;
public int Id { get; set; }
}
}

View File

@ -0,0 +1,22 @@
using BankDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankContracts.BindingModels
{
public class CurrencyPurchaseBindingModel : ICurrencyPurchaseModel
{
public float Amount { get; set; }
public DateTime PurchaseDate { get; set; } = DateTime.Now.Date;
public int BankOperatorId { get; set; }
public int CurrencyId { get; set; }
public int Id { get; set; }
}
}

View File

@ -0,0 +1,20 @@
using BankContracts.BindingModels;
using BankContracts.SearchModels;
using BankContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankContracts.BusinessLogicsContracts
{
public interface IBankOperatorLogic
{
List<BankOperatorViewModel>? ReadList(BankOperatorSearchModel? model);
BankOperatorViewModel? ReadElement(BankOperatorSearchModel model);
bool Create(BankOperatorBindingModel model);
bool Update(BankOperatorBindingModel model);
bool Delete(BankOperatorBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using BankContracts.BindingModels;
using BankContracts.SearchModels;
using BankContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankContracts.BusinessLogicsContracts
{
public interface ICreditProgramLogic
{
List<CreditProgramViewModel>? ReadList(CreditProgramSearchModel? model);
CreditProgramViewModel? ReadElement(CreditProgramSearchModel model);
bool Create(CreditProgramBindingModel model);
bool Update(CreditProgramBindingModel model);
bool Delete(CreditProgramBindingModel model);
}
}

View File

@ -1,12 +1,21 @@
using System;
using BankContracts.BindingModels;
using BankContracts.SearchModels;
using BankContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace BankContracts.BusinessLogicsContracts
{
internal interface ICurrencyLogic
public interface ICurrencyLogic
{
List<CurrencyViewModel>? ReadList(CurrencySearchModel? model);
CurrencyViewModel? ReadElement(CurrencySearchModel model);
bool Create(CurrencyBindingModel model);
bool Update(CurrencyBindingModel model);
bool Delete(CurrencyBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using BankContracts.BindingModels;
using BankContracts.SearchModels;
using BankContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankContracts.BusinessLogicsContracts
{
public interface ICurrencyPurchaseLogic
{
List<CurrencyPurchaseViewModel>? ReadList(CurrencyPurchaseSearchModel? model);
CurrencyPurchaseViewModel? ReadElement(CurrencyPurchaseSearchModel model);
bool Create(CurrencyPurchaseBindingModel model);
bool Update(CurrencyPurchaseBindingModel model);
bool Delete(CurrencyPurchaseBindingModel model);
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankContracts.SearchModels
{
public class BankOperatorSearchModel
{
public int? Id { get; set; }
public string? Login { get; set; }
}
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankContracts.SearchModels
{
public class CreditProgramSearchModel
{
int? Id { get; set; }
}
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankContracts.SearchModels
{
public class CurrencyPurchaseSearchModel
{
public int? Id { get; set; }
}
}

View File

@ -6,7 +6,8 @@ using System.Threading.Tasks;
namespace BankContracts.SearchModels
{
internal class CurrencySearchModel
public class CurrencySearchModel
{
public int? Id { get; set; }
}
}

View File

@ -0,0 +1,21 @@
using BankContracts.BindingModels;
using BankContracts.SearchModels;
using BankContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankContracts.StoragesContracts
{
public interface IBankOperatorStorage
{
List<BankOperatorViewModel> GetFullList();
List<BankOperatorViewModel> GetFilteredList(BankOperatorSearchModel model);
BankOperatorViewModel? GetElement(BankOperatorSearchModel model);
BankOperatorViewModel? Insert(BankOperatorBindingModel model);
BankOperatorViewModel? Update(BankOperatorBindingModel model);
BankOperatorViewModel? Delete(BankOperatorBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using BankContracts.BindingModels;
using BankContracts.SearchModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankContracts.StoragesContracts
{
public interface ICreditProgramStorage
{
List<CreditProgramViewModel> GetFullList();
List<CreditProgramViewModel> GetFilteredList(CreditProgramSearchModel model);
CreditProgramViewModel? GetElement(CreditProgramSearchModel model);
CreditProgramViewModel? Insert(CreditProgramBindingModel model);
CreditProgramViewModel? Update(CreditProgramBindingModel model);
CreditProgramViewModel? Delete(CreditProgramBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using BankContracts.BindingModels;
using BankContracts.SearchModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankContracts.StoragesContracts
{
public interface ICurrencyPurchaseStorage
{
List<CurrencyPurchaseViewModel> GetFullList();
List<CurrencyPurchaseViewModel> GetFilteredList(CurrencyPurchaseSearchModel model);
CurrencyPurchaseViewModel? GetElement(CurrencyPurchaseSearchModel model);
CurrencyPurchaseViewModel? Insert(CurrencyPurchaseBindingModel model);
CurrencyPurchaseViewModel? Update(CurrencyPurchaseBindingModel model);
CurrencyPurchaseViewModel? Delete(CurrencyPurchaseBindingModel model);
}
}

View File

@ -1,4 +1,7 @@
using System;
using BankContracts.BindingModels;
using BankContracts.SearchModels;
using BankContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -6,7 +9,13 @@ using System.Threading.Tasks;
namespace BankContracts.StoragesContracts
{
internal interface ICurrencyStorage
public interface ICurrencyStorage
{
List<CurrencyViewModel> GetFullList();
List<CurrencyViewModel> GetFilteredList(CurrencySearchModel model);
CurrencyViewModel? GetElement(CurrencySearchModel model);
CurrencyViewModel? Insert(CurrencyBindingModel model);
CurrencyViewModel? Update(CurrencyBindingModel model);
CurrencyViewModel? Delete(CurrencyBindingModel model);
}
}

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankContracts.ViewModels
{
public class BankOperatorViewModel
{
[DisplayName("Логин")]
public string Login { get; set; } = String.Empty;
public string Password { get; set; } = String.Empty;
[DisplayName("Имя")]
public string FirstName { get; set; } = String.Empty;
[DisplayName("Фамилия")]
public string LastName { get; set; } = String.Empty;
[DisplayName("Отчество")]
public string? MiddleName { get; set; } = String.Empty;
public int Id { get; set; }
}
}

View File

@ -0,0 +1,21 @@
using BankDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankContracts.ViewModels
{
public class CreditProgramViewModel
{
[DisplayName("Название кредитной программы")]
public string Name { get; set; } = String.Empty;
[DisplayName("Процент кредитования")]
public int Persent { get; set; }
public Dictionary<int, ICurrencyModel> Currencies { get; set; } = new();
[DisplayName("Номер программы")]
public int Id { get; set; }
}
}

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankContracts.ViewModels
{
public class CurrencyPurchaseViewModel
{
[DisplayName("Количество валюты")]
public float Amount { get; set; }
[DisplayName("Дата покупки")]
public DateTime PurchaseDate { get; set; } = DateTime.Now.Date;
public int BankOperatorId { get; set; }
[DisplayName("ФИО оператора")]
public string BankOperatorName { get; set; }
public int CurrencyId { get; set; }
[DisplayName("Название валюты")]
public string CurrencyName { get; set; }
[DisplayName("Номер покупки")]
public int Id { get; set; }
}
}

View File

@ -1,12 +1,18 @@
using System;
using BankDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankContracts.ViewModels
{
internal class CurrencyViewModel
public class CurrencyViewModel : ICurrencyModel
{
[DisplayName("Название валюты")]
public string Name { get; set; } = String.Empty;
[DisplayName("Номер валюты")]
public int Id { get; set; }
}
}