From 9b32082d0238ea855377dd55bdcefea099cafe80 Mon Sep 17 00:00:00 2001 From: Programmist73 Date: Sat, 1 Apr 2023 12:55:58 +0400 Subject: [PATCH 1/2] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20ViewModel=20=D0=BA=D0=B0=D1=81=D1=81=D0=B8?= =?UTF-8?q?=D1=80=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BankYouBankruptContracts.csproj | 1 - .../BindingModels/AccountBindingModel.cs | 2 ++ .../ViewModels/AccountViewModel.cs | 36 +++++++++++++++++++ .../ViewModels/CashWithdrawalViewModel.cs | 26 ++++++++++++++ .../ViewModels/CashierViewModel.cs | 32 +++++++++++++++++ .../ViewModels/MoneyTransferViewModel.cs | 31 ++++++++++++++++ .../Models/IAccountModel.cs | 3 ++ 7 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 BankYouBankrupt/BankYouBankruptContracts/ViewModels/AccountViewModel.cs create mode 100644 BankYouBankrupt/BankYouBankruptContracts/ViewModels/CashWithdrawalViewModel.cs create mode 100644 BankYouBankrupt/BankYouBankruptContracts/ViewModels/CashierViewModel.cs create mode 100644 BankYouBankrupt/BankYouBankruptContracts/ViewModels/MoneyTransferViewModel.cs diff --git a/BankYouBankrupt/BankYouBankruptContracts/BankYouBankruptContracts.csproj b/BankYouBankrupt/BankYouBankruptContracts/BankYouBankruptContracts.csproj index aae7352..69d6220 100644 --- a/BankYouBankrupt/BankYouBankruptContracts/BankYouBankruptContracts.csproj +++ b/BankYouBankrupt/BankYouBankruptContracts/BankYouBankruptContracts.csproj @@ -10,7 +10,6 @@ - diff --git a/BankYouBankrupt/BankYouBankruptContracts/BindingModels/AccountBindingModel.cs b/BankYouBankrupt/BankYouBankruptContracts/BindingModels/AccountBindingModel.cs index 4cb52b9..b0c2cca 100644 --- a/BankYouBankrupt/BankYouBankruptContracts/BindingModels/AccountBindingModel.cs +++ b/BankYouBankrupt/BankYouBankruptContracts/BindingModels/AccountBindingModel.cs @@ -15,6 +15,8 @@ namespace BankYouBankruptContracts.BindingModels public int ClientId { get; set; } + public int AccountNumber { get; set; } + public string PasswordAccount { get; set; } = string.Empty; public double Balance { get; set; } diff --git a/BankYouBankrupt/BankYouBankruptContracts/ViewModels/AccountViewModel.cs b/BankYouBankrupt/BankYouBankruptContracts/ViewModels/AccountViewModel.cs new file mode 100644 index 0000000..399be92 --- /dev/null +++ b/BankYouBankrupt/BankYouBankruptContracts/ViewModels/AccountViewModel.cs @@ -0,0 +1,36 @@ +using BankYouBankruptDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankYouBankruptContracts.ViewModels +{ + public class AccountViewModel : IAccountModel + { + public int Id { get; set; } + + public int CashierId { get; set; } + + public int ClientId { get; set; } + + [DisplayName("Номер счёта")] + public int AccountNumber { get; set; } + + [DisplayName("Имя")] + public string Name { get; set; } = string.Empty; + + [DisplayName("Отчество")] + public string Patronymic { get; set; } = string.Empty; + + public string PasswordAccount { get; set; } = string.Empty; + + [DisplayName("Баланс")] + public double Balance { get; set; } + + [DisplayName("Дата открытия")] + public DateTime DateOpen { get; set; } = DateTime.Now; + } +} diff --git a/BankYouBankrupt/BankYouBankruptContracts/ViewModels/CashWithdrawalViewModel.cs b/BankYouBankrupt/BankYouBankruptContracts/ViewModels/CashWithdrawalViewModel.cs new file mode 100644 index 0000000..d3aa12f --- /dev/null +++ b/BankYouBankrupt/BankYouBankruptContracts/ViewModels/CashWithdrawalViewModel.cs @@ -0,0 +1,26 @@ +using BankYouBankruptDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankYouBankruptContracts.ViewModels +{ + public class CashWithdrawalViewModel : ICashWithdrawalModel + { + public int Id { get; set; } + + public int AccountId { get; set; } + + [DisplayName("Номер счёта")] + public int AccountNumber { get; set; } + + [DisplayName("Сумма выданных наличных")] + public int Sum { get; set; } + + [DisplayName("Дата операции")] + public DateTime DateOperation { get; set; } = DateTime.Now; + } +} diff --git a/BankYouBankrupt/BankYouBankruptContracts/ViewModels/CashierViewModel.cs b/BankYouBankrupt/BankYouBankruptContracts/ViewModels/CashierViewModel.cs new file mode 100644 index 0000000..6a15a7b --- /dev/null +++ b/BankYouBankrupt/BankYouBankruptContracts/ViewModels/CashierViewModel.cs @@ -0,0 +1,32 @@ +using BankYouBankruptDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankYouBankruptContracts.ViewModels +{ + public class CashierViewModel : ICashierModel + { + public int Id { get; set; } + + public string Password { get; set; } = string.Empty; + + [DisplayName("Имя")] + public string Name { get; set; } = string.Empty; + + [DisplayName("Фамилия")] + public string Surname { get; set; } = string.Empty; + + [DisplayName("Отчество")] + public string Patronymic { get; set; } = string.Empty; + + [DisplayName("Телефон")] + public string Telephone { get; set; } = string.Empty; + + [DisplayName("Почта")] + public string Email { get; set; } = string.Empty; + } +} diff --git a/BankYouBankrupt/BankYouBankruptContracts/ViewModels/MoneyTransferViewModel.cs b/BankYouBankrupt/BankYouBankruptContracts/ViewModels/MoneyTransferViewModel.cs new file mode 100644 index 0000000..688e9f0 --- /dev/null +++ b/BankYouBankrupt/BankYouBankruptContracts/ViewModels/MoneyTransferViewModel.cs @@ -0,0 +1,31 @@ +using BankYouBankruptDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankYouBankruptContracts.ViewModels +{ + public class MoneyTransferViewModel : IMoneyTransferModel + { + public int Id { get; set; } + + [DisplayName("Сумма перевода")] + public int Sum { get; set; } + + public int AccountSenderId { get; set; } + + [DisplayName("Номер счёта отп.")] + public int AccountSenderNumber { get; set; } + + public int AccountPayeeId { get; set; } + + [DisplayName("Номер счёта получ.")] + public int AccountPayeeNumber { get; set; } + + [DisplayName("Дата операции")] + public DateTime DateOperation { get; set; } = DateTime.Now; + } +} diff --git a/BankYouBankrupt/BankYouBankruptDataModels/Models/IAccountModel.cs b/BankYouBankrupt/BankYouBankruptDataModels/Models/IAccountModel.cs index 355e0f4..49f4b91 100644 --- a/BankYouBankrupt/BankYouBankruptDataModels/Models/IAccountModel.cs +++ b/BankYouBankrupt/BankYouBankruptDataModels/Models/IAccountModel.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Security.Principal; using System.Text; using System.Threading.Tasks; @@ -9,6 +10,8 @@ namespace BankYouBankruptDataModels.Models //банковский счёт public interface IAccountModel : IId { + int AccountNumber { get; } + int CashierId { get; } int ClientId { get; } From 6651dc39a82350e97db408c80a2e71171e8a59a0 Mon Sep 17 00:00:00 2001 From: Programmist73 Date: Sat, 1 Apr 2023 12:57:56 +0400 Subject: [PATCH 2/2] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=BE=D0=BB=D1=8F=20=D0=9D?= =?UTF-8?q?=D0=BE=D0=BC=D0=B5=D1=80=20=D1=81=D1=87=D1=91=D1=82=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BindingModels/AccountBindingModel.cs | 2 +- .../BankYouBankruptContracts/ViewModels/AccountViewModel.cs | 2 +- .../BankYouBankruptDataModels/Models/IAccountModel.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/BankYouBankrupt/BankYouBankruptContracts/BindingModels/AccountBindingModel.cs b/BankYouBankrupt/BankYouBankruptContracts/BindingModels/AccountBindingModel.cs index b0c2cca..64c4ed6 100644 --- a/BankYouBankrupt/BankYouBankruptContracts/BindingModels/AccountBindingModel.cs +++ b/BankYouBankrupt/BankYouBankruptContracts/BindingModels/AccountBindingModel.cs @@ -15,7 +15,7 @@ namespace BankYouBankruptContracts.BindingModels public int ClientId { get; set; } - public int AccountNumber { get; set; } + public string AccountNumber { get; set; } = string.Empty; public string PasswordAccount { get; set; } = string.Empty; diff --git a/BankYouBankrupt/BankYouBankruptContracts/ViewModels/AccountViewModel.cs b/BankYouBankrupt/BankYouBankruptContracts/ViewModels/AccountViewModel.cs index 399be92..07851d1 100644 --- a/BankYouBankrupt/BankYouBankruptContracts/ViewModels/AccountViewModel.cs +++ b/BankYouBankrupt/BankYouBankruptContracts/ViewModels/AccountViewModel.cs @@ -17,7 +17,7 @@ namespace BankYouBankruptContracts.ViewModels public int ClientId { get; set; } [DisplayName("Номер счёта")] - public int AccountNumber { get; set; } + public string AccountNumber { get; set; } = string.Empty; [DisplayName("Имя")] public string Name { get; set; } = string.Empty; diff --git a/BankYouBankrupt/BankYouBankruptDataModels/Models/IAccountModel.cs b/BankYouBankrupt/BankYouBankruptDataModels/Models/IAccountModel.cs index 49f4b91..44fdbec 100644 --- a/BankYouBankrupt/BankYouBankruptDataModels/Models/IAccountModel.cs +++ b/BankYouBankrupt/BankYouBankruptDataModels/Models/IAccountModel.cs @@ -10,7 +10,7 @@ namespace BankYouBankruptDataModels.Models //банковский счёт public interface IAccountModel : IId { - int AccountNumber { get; } + string AccountNumber { get; } int CashierId { get; }