bd proccess
This commit is contained in:
parent
0700b2cc3d
commit
a39601fb5d
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TravelCompanyDatabaseImplement.Implements.GuarantorImplements
|
||||
{
|
||||
internal class GuarantorStorage
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TravelCompanyDatabaseImplement.Implements.GuarantorImplements
|
||||
{
|
||||
internal class GuideStorage
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TravelCompanyDatabaseImplement.Implements.GuarantorImplements
|
||||
{
|
||||
internal class PlaceStorage
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using TravelCompanyContracts.BindingModels.Guarantor;
|
||||
using TravelCompanyContracts.SearchModels.Guarantor;
|
||||
using TravelCompanyContracts.StoragesModels.Guarantor;
|
||||
using TravelCompanyContracts.ViewModels.Guarantor.ViewModels;
|
||||
using TravelCompanyDatabaseImplement.Models.GuarantorModels;
|
||||
|
||||
namespace TravelCompanyDatabaseImplement.Implements.GuarantorImplements
|
||||
{
|
||||
internal class TripStorage
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using TravelCompanyContracts.BindingModels.Guarantor;
|
||||
using TravelCompanyContracts.ViewModels.Guarantor.ViewModels;
|
||||
using TravelCompanyDataModels.Models.Guarantor;
|
||||
|
||||
namespace TravelCompanyDatabaseImplement.Models.GuarantorModels
|
||||
{
|
||||
public class Guarantor : IGuarantorModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
public string Surname { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
public string Patronymic { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
public string Login { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
public string Password { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
public string Email { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
public string MobilePhone { get; set; } = string.Empty;
|
||||
|
||||
//[ForeignKey("GuarantorId")]
|
||||
//public virtual List<> { get; set; } = new();
|
||||
|
||||
public GuarantorViewModel GetViewModel => new()
|
||||
{
|
||||
Id = Id,
|
||||
Name = Name,
|
||||
Surname = Surname,
|
||||
Patronymic = Patronymic,
|
||||
Login = Login,
|
||||
Password = Password,
|
||||
Email = Email,
|
||||
MobilePhone = MobilePhone
|
||||
};
|
||||
|
||||
public static Guarantor Create(GuarantorBindingModel model)
|
||||
{
|
||||
return new Guarantor()
|
||||
{
|
||||
Id = model.Id,
|
||||
Name = model.Name,
|
||||
Surname = model.Surname,
|
||||
Patronymic = model.Patronymic,
|
||||
Email = model.Email,
|
||||
Password = model.Password,
|
||||
MobilePhone = model.MobilePhone,
|
||||
};
|
||||
}
|
||||
|
||||
public void Update(GuarantorBindingModel model)
|
||||
{
|
||||
Name = model.Name;
|
||||
Surname = model.Surname;
|
||||
Patronymic = model.Patronymic;
|
||||
Email = model.Email;
|
||||
Password = model.Password;
|
||||
MobilePhone = model.MobilePhone;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TravelCompanyDatabaseImplement.Models.GuarantorModels
|
||||
{
|
||||
internal class Guide
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TravelCompanyDatabaseImplement.Models.GuarantorModels
|
||||
{
|
||||
internal class Place
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TravelCompanyDatabaseImplement.Models.GuarantorModels
|
||||
{
|
||||
internal class Trip
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using TravelCompanyDatabaseImplement.Models.ContractorModels;
|
||||
using TravelCompanyDatabaseImplement.Models.GuarantorModels;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Security.Principal;
|
||||
|
||||
|
||||
namespace TravelCompanyDatabaseImplement
|
||||
{
|
||||
public class TravelCompanyDatabase : DbContext
|
||||
{
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
if (optionsBuilder.IsConfigured == false)
|
||||
{
|
||||
optionsBuilder.UseSqlServer(@"Data Source=\SQLEXPRESS;Initial Catalog=TravelCompanyDataBase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
||||
}
|
||||
base.OnConfiguring(optionsBuilder);
|
||||
}
|
||||
public virtual DbSet<Account> Accounts { set; get; }
|
||||
|
||||
public virtual DbSet<Card> Cards { set; get; }
|
||||
|
||||
public virtual DbSet<Cashier> Cashiers { set; get; }
|
||||
|
||||
public virtual DbSet<CashWithdrawal> CashWithdrawals { set; get; }
|
||||
|
||||
public virtual DbSet<Guarantor> Guarantors { set; get; }
|
||||
|
||||
public virtual DbSet<Debiting> Debitings { set; get; }
|
||||
|
||||
public virtual DbSet<Crediting> Creditings { set; get; }
|
||||
|
||||
public virtual DbSet<MoneyTransfer> MoneyTransfers { set; get; }
|
||||
}
|
||||
}
|
@ -7,8 +7,12 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Implements\" />
|
||||
<Folder Include="Models\" />
|
||||
<Folder Include="Implements\ContractorImplements\" />
|
||||
<Folder Include="Models\ContractorModels\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.17" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
Loading…
x
Reference in New Issue
Block a user