fix client app

This commit is contained in:
Zakharov_Rostislav 2024-05-13 12:37:11 +04:00
parent 73c4800cad
commit c41f0e635f
12 changed files with 32 additions and 28 deletions

View File

@ -35,5 +35,6 @@ namespace CarShowroomDataModels.Views
ModelId = model.ModelId;
IsSaled = model.IsSaled;
}
public CarView() { }
}
}

View File

@ -21,5 +21,6 @@ namespace CarShowroomDataModels.Views
Name = model.Name;
PhoneNumber = model.PhoneNumber;
}
public ClientView() { }
}
}

View File

@ -24,5 +24,6 @@ namespace CarShowroomDataModels.Views
Email = model.Email;
Password = model.Password;
}
public EmployeeView() {}
}
}

View File

@ -18,5 +18,6 @@ namespace CarShowroomDataModels.Views
Id = model.Id;
Name = model.Name;
}
public MakeView() { }
}
}

View File

@ -25,5 +25,6 @@ namespace CarShowroomDataModels.Views
Price = model.Price;
MakeId = model.MakeId;
}
public ModelView() { }
}
}

View File

@ -46,5 +46,6 @@ namespace CarShowroomDataModels.Views
ClientId = model.ClientId;
EmployeeId = model.EmployeeId;
}
public SaleView() { }
}
}

View File

@ -18,5 +18,6 @@ namespace CarShowroomDataModels.Views
Name = model.Name;
Cost = model.Cost;
}
public ServiceView() { }
}
}

View File

@ -12,12 +12,7 @@ namespace CarShowroomManagerApp
public static EmployeeView? Client { get; set; } = null;
public static void Connect(IConfiguration configuration)
{
string? ip = configuration["IPAddress"];
if (ip == null)
{
throw new Exception("RestApi application's IPAddress is undefined");
}
_client.BaseAddress = new Uri(ip);
_client.BaseAddress = new Uri(configuration["IPAddress"]);
_client.DefaultRequestHeaders.Accept.Clear();
_client.DefaultRequestHeaders.Accept.Add(new
MediaTypeWithQualityHeaderValue("application/json"));

View File

@ -124,7 +124,6 @@ namespace CarShowroomManagerApp.Controllers
Name = name,
PhoneNumber = phonenumber
});
Response.Redirect("Enter");
return;
}
public IActionResult ClientUpdate()

View File

@ -1,3 +1,5 @@
using CarShowroomDataModels.Models;
namespace CarShowroomManagerApp
{
public class Program
@ -8,9 +10,10 @@ namespace CarShowroomManagerApp
// Add services to the container.
builder.Services.AddControllersWithViews();
var app = builder.Build();
ApiClient.Connect(builder.Configuration);
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{

View File

@ -14,8 +14,8 @@
return;
}
<p>
<a asp-action="ClientCreate">Создать перевод</a>
<a asp-action="ClientUpdate">Обновить перевод</a>
<a asp-action="ClientCreate">Зарегистрировать клиента</a>
<a asp-action="ClientUpdate">Обновить данные клиента</a>
</p>
<table class="table">
<thead>

View File

@ -7,11 +7,11 @@
<form method="post">
<div class="row">
<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 class="row">
<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 class="row">
<div class="col-8"></div>