Чиним многие-ко-многим

This commit is contained in:
Артём Алейкин 2023-05-19 18:12:37 +04:00
parent 79071f22b2
commit 1843a431ec
5 changed files with 11 additions and 15 deletions

View File

@ -1,7 +1,9 @@
using CaseAccountingDataModels.Models;
using CaseAccountingContracts.ViewModels;
using CaseAccountingDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
@ -24,5 +26,9 @@ namespace CaseAccountingContracts.BindingModels
public int Id { get; set; }
public Dictionary<int, IContractModel> Contracts { get; set; } = new();
public List<ContractViewModel> ContractViewModels { get; set; } = new();
}
}

View File

@ -71,16 +71,6 @@ namespace CaseAccountingCustomerView.Controllers
return lawyers ?? new();
}
/*public List<EducationGroupViewModel> GetAllCases()
{
if (APIUser.User == null)
{
return new();
}
List<EducationGroupViewModel>? group = APIUser.GetRequest<List<EducationGroupViewModel>>("api/lawyer/GetAllCases");
return group ?? new();
}*/
public LawyerViewModel? Get(int id)
{
if (APIUser.User == null)

View File

@ -16,7 +16,7 @@ window.addEventListener('load', async () => {
console.log(cases)
});
await $.ajax({
url: `/document/get?id=${currentLawyerId}`,
url: `/lawyer/get?id=${currentLawyerId}`,
type: "GET",
contentType: "json"
}).done((result) => {
@ -33,7 +33,7 @@ createBtn.addEventListener('click', () => {
"Surname": currentLawyer.Surname,
"Patronymic": currentLawyer.Patronymic,
"SpecializationId": currentLawyer.SpecializationId,
"LawyerContracts": currentLawyer.lawyerContracts,
"ContractViewModels": currentLawyer.lawyerContracts,
"LawyerCases": dataArray,
}
$.ajax({

View File

@ -25,7 +25,7 @@ createBtn.addEventListener('click', () => {
"Surname": surnameInput.value,
"Patronymic": patronymicInput.value,
"Experience": parseInt(experienceInput.value),
"LawyerContracts": dataArray,
"ContractViewModels": dataArray,
}
console.log(lawyer);
$.ajax({

View File

@ -31,7 +31,7 @@ createBtn.addEventListener('click', () => {
"Service": serviceInput.value,
"Coast": coastInput.value,
"Date": currentLawyer.date,
"LawyerContracts": dataArray,
"ContractViewModels": dataArray,
"LawyerCases": currentLawyer.lawyerCases,
}
$.ajax({