type shit

This commit is contained in:
platoff aeeee 2024-05-01 15:55:58 +04:00
parent 4b32a57b1a
commit 9be384911e
80 changed files with 22 additions and 22 deletions

View File

@ -1,3 +0,0 @@
@using ComputerShopImplementerApp
@using ComputerShopImplementerApp.Models
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

View File

@ -19,7 +19,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TravelCompanyDataModels", "
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TravelCompanyDatabaseImplement", "TravelCompanyDatabaseImplement\TravelCompanyDatabaseImplement.csproj", "{7625604D-02E5-4833-86BC-5CC0731A7DFD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TravelCompanyGuarantorApp", "ComputerShopImplementerApp\TravelCompanyGuarantorApp.csproj", "{BC969D5F-D702-4D0D-B7D9-7EA532D8E5C9}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TravelCompanyGuarantorApp", "TravelCompanyGuarantorApp\TravelCompanyGuarantorApp.csproj", "{2E404520-3DDA-479A-B832-8E6F00B54D19}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -47,10 +47,10 @@ Global
{7625604D-02E5-4833-86BC-5CC0731A7DFD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7625604D-02E5-4833-86BC-5CC0731A7DFD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7625604D-02E5-4833-86BC-5CC0731A7DFD}.Release|Any CPU.Build.0 = Release|Any CPU
{BC969D5F-D702-4D0D-B7D9-7EA532D8E5C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BC969D5F-D702-4D0D-B7D9-7EA532D8E5C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BC969D5F-D702-4D0D-B7D9-7EA532D8E5C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BC969D5F-D702-4D0D-B7D9-7EA532D8E5C9}.Release|Any CPU.Build.0 = Release|Any CPU
{2E404520-3DDA-479A-B832-8E6F00B54D19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2E404520-3DDA-479A-B832-8E6F00B54D19}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2E404520-3DDA-479A-B832-8E6F00B54D19}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2E404520-3DDA-479A-B832-8E6F00B54D19}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -1,15 +1,15 @@
using ComputerShopContracts.ViewModels;
using Newtonsoft.Json;
using Newtonsoft.Json;
using System.Net.Http.Headers;
using System.Text;
using TravelCompanyContracts.ViewModels.Guarantor.ViewModels;
namespace ComputerShopImplementerApp
namespace TravelCompanGuarantorApp.Controllers
{
public class APIUser
{
private static readonly HttpClient _user = new();
public static UserViewModel? User { get; set; } = null;
public static GuarantorViewModel? User { get; set; } = null;
public static void Connect(IConfiguration configuration)
{

View File

@ -1,8 +1,11 @@
using TravelCompanGuarantorApp.Models;
using TravelCompanyContracts.BindingModels;
using TravelCompanyContracts.ViewModels;
using TravelCompanGuarantorApp;
using Microsoft.AspNetCore.Mvc;
using System.Diagnostics;
using TravelCompanyContracts.BindingModels.Guarantor;
using TravelCompanyContracts.ViewModels.Guarantor.ViewModels;
namespace TravelCompanGuarantorApp.Controllers
{
@ -43,17 +46,15 @@ namespace TravelCompanGuarantorApp.Controllers
}
if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(email))
{
throw new Exception("Введите логин, пароль и почту");
throw new Exception("Введите почту и пароль");
}
APIUser.PostRequest("api/user/updatedata", new UserBindingModel
APIUser.PostRequest("api/user/updatedata", new GuarantorBindingModel
{
Id = APIUser.User.Id,
Login = login,
Password = password,
Email = email
});
APIUser.User.Login = login;
APIUser.User.Password = password;
APIUser.User.Email = email;
Response.Redirect("Index");
@ -78,7 +79,7 @@ namespace TravelCompanGuarantorApp.Controllers
{
throw new Exception("Введите логин и пароль");
}
APIUser.User = APIUser.GetRequest<UserViewModel>($"api/user/loginimplementer?login={login}&password={password}");
APIUser.User = APIUser.GetRequest<GuarantorViewModel>($"api/user/loginimplementer?login={login}&password={password}");
if (APIUser.User == null)
{
throw new Exception("Неверный логин/пароль");
@ -97,11 +98,10 @@ namespace TravelCompanGuarantorApp.Controllers
{
if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(email))
{
throw new Exception("Введите логин, пароль и почту");
throw new Exception("Введите почту и пароль");
}
APIUser.PostRequest("api/user/registerimplementer", new UserBindingModel
APIUser.PostRequest("api/user/registerimplementer", new GuarantorBindingModel
{
Login = login,
Password = password,
Email = email
});

View File

@ -1,4 +1,4 @@
using ComputerShopImplementerApp;
using TravelCompanGuarantorApp.Controllers;
var builder = WebApplication.CreateBuilder(args);

View File

@ -1,4 +1,4 @@
@using ComputerShopContracts.ViewModels
@using TravelCompanyContracts.ViewModels.Guarantor
@model UserViewModel

View File

@ -0,0 +1,3 @@
@using TravelCompanyGuarantorApp
@using TravelCompanyGuarantorApp.Models
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

View File

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB