fix client app
This commit is contained in:
parent
73c4800cad
commit
c41f0e635f
@ -35,5 +35,6 @@ namespace CarShowroomDataModels.Views
|
|||||||
ModelId = model.ModelId;
|
ModelId = model.ModelId;
|
||||||
IsSaled = model.IsSaled;
|
IsSaled = model.IsSaled;
|
||||||
}
|
}
|
||||||
}
|
public CarView() { }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ namespace CarShowroomDataModels.Views
|
|||||||
Id = model.Id;
|
Id = model.Id;
|
||||||
Name = model.Name;
|
Name = model.Name;
|
||||||
PhoneNumber = model.PhoneNumber;
|
PhoneNumber = model.PhoneNumber;
|
||||||
}
|
}
|
||||||
}
|
public ClientView() { }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,5 +24,6 @@ namespace CarShowroomDataModels.Views
|
|||||||
Email = model.Email;
|
Email = model.Email;
|
||||||
Password = model.Password;
|
Password = model.Password;
|
||||||
}
|
}
|
||||||
}
|
public EmployeeView() {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@ namespace CarShowroomDataModels.Views
|
|||||||
{
|
{
|
||||||
Id = model.Id;
|
Id = model.Id;
|
||||||
Name = model.Name;
|
Name = model.Name;
|
||||||
}
|
}
|
||||||
}
|
public MakeView() { }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@ namespace CarShowroomDataModels.Views
|
|||||||
Name = model.Name;
|
Name = model.Name;
|
||||||
Price = model.Price;
|
Price = model.Price;
|
||||||
MakeId = model.MakeId;
|
MakeId = model.MakeId;
|
||||||
}
|
}
|
||||||
}
|
public ModelView() { }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,5 +46,6 @@ namespace CarShowroomDataModels.Views
|
|||||||
ClientId = model.ClientId;
|
ClientId = model.ClientId;
|
||||||
EmployeeId = model.EmployeeId;
|
EmployeeId = model.EmployeeId;
|
||||||
}
|
}
|
||||||
}
|
public SaleView() { }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@ namespace CarShowroomDataModels.Views
|
|||||||
Id = model.Id;
|
Id = model.Id;
|
||||||
Name = model.Name;
|
Name = model.Name;
|
||||||
Cost = model.Cost;
|
Cost = model.Cost;
|
||||||
}
|
}
|
||||||
}
|
public ServiceView() { }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,14 +11,9 @@ namespace CarShowroomManagerApp
|
|||||||
private static readonly HttpClient _client = new();
|
private static readonly HttpClient _client = new();
|
||||||
public static EmployeeView? Client { get; set; } = null;
|
public static EmployeeView? Client { get; set; } = null;
|
||||||
public static void Connect(IConfiguration configuration)
|
public static void Connect(IConfiguration configuration)
|
||||||
{
|
{
|
||||||
string? ip = configuration["IPAddress"];
|
_client.BaseAddress = new Uri(configuration["IPAddress"]);
|
||||||
if (ip == null)
|
_client.DefaultRequestHeaders.Accept.Clear();
|
||||||
{
|
|
||||||
throw new Exception("RestApi application's IPAddress is undefined");
|
|
||||||
}
|
|
||||||
_client.BaseAddress = new Uri(ip);
|
|
||||||
_client.DefaultRequestHeaders.Accept.Clear();
|
|
||||||
_client.DefaultRequestHeaders.Accept.Add(new
|
_client.DefaultRequestHeaders.Accept.Add(new
|
||||||
MediaTypeWithQualityHeaderValue("application/json"));
|
MediaTypeWithQualityHeaderValue("application/json"));
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ namespace CarShowroomManagerApp.Controllers
|
|||||||
public void Enter(string login, string password)
|
public void Enter(string login, string password)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(login) ||
|
if (string.IsNullOrEmpty(login) ||
|
||||||
string.IsNullOrEmpty(password))
|
string.IsNullOrEmpty(password))
|
||||||
{
|
{
|
||||||
throw new Exception("Введите логин и пароль");
|
throw new Exception("Введите логин и пароль");
|
||||||
}
|
}
|
||||||
@ -124,7 +124,6 @@ namespace CarShowroomManagerApp.Controllers
|
|||||||
Name = name,
|
Name = name,
|
||||||
PhoneNumber = phonenumber
|
PhoneNumber = phonenumber
|
||||||
});
|
});
|
||||||
Response.Redirect("Enter");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
public IActionResult ClientUpdate()
|
public IActionResult ClientUpdate()
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
using CarShowroomDataModels.Models;
|
||||||
|
|
||||||
namespace CarShowroomManagerApp
|
namespace CarShowroomManagerApp
|
||||||
{
|
{
|
||||||
public class Program
|
public class Program
|
||||||
@ -8,11 +10,12 @@ namespace CarShowroomManagerApp
|
|||||||
|
|
||||||
// Add services to the container.
|
// Add services to the container.
|
||||||
builder.Services.AddControllersWithViews();
|
builder.Services.AddControllersWithViews();
|
||||||
|
var app = builder.Build();
|
||||||
|
|
||||||
var app = builder.Build();
|
ApiClient.Connect(builder.Configuration);
|
||||||
|
|
||||||
// Configure the HTTP request pipeline.
|
// Configure the HTTP request pipeline.
|
||||||
if (!app.Environment.IsDevelopment())
|
if (!app.Environment.IsDevelopment())
|
||||||
{
|
{
|
||||||
app.UseExceptionHandler("/Home/Error");
|
app.UseExceptionHandler("/Home/Error");
|
||||||
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
<p>
|
<p>
|
||||||
<a asp-action="ClientCreate">Создать перевод</a>
|
<a asp-action="ClientCreate">Зарегистрировать клиента</a>
|
||||||
<a asp-action="ClientUpdate">Обновить перевод</a>
|
<a asp-action="ClientUpdate">Обновить данные клиента</a>
|
||||||
</p>
|
</p>
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
|
@ -7,11 +7,11 @@
|
|||||||
<form method="post">
|
<form method="post">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-4">Логин:</div>
|
<div class="col-4">Логин:</div>
|
||||||
<div class="col-8"><input type="text" name="login" /></div>
|
<div class="col-8"><input type="text" name="login" id="login" /></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-4">Пароль:</div>
|
<div class="col-4">Пароль:</div>
|
||||||
<div class="col-8"><input type="password" name="password" /></div>
|
<div class="col-8"><input type="password" name="password" id="password" /></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-8"></div>
|
<div class="col-8"></div>
|
||||||
|
Loading…
Reference in New Issue
Block a user