ура json добавила
This commit is contained in:
parent
dd10878582
commit
42f08cd7a1
@ -1,4 +1,5 @@
|
||||
using LawFimDataModels.Models;
|
||||
using Newtonsoft.Json;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace LawFirmContracts.ViewModels
|
||||
@ -16,5 +17,13 @@ namespace LawFirmContracts.ViewModels
|
||||
public int CaseId { get; set; }
|
||||
public int GuarantorId { get; set; }
|
||||
public Dictionary<int, ILawyerModel> ConsultationLawyers { get; set; } = new();
|
||||
}
|
||||
|
||||
public ConsultationViewModel() { }
|
||||
[JsonConstructor]
|
||||
public ConsultationViewModel(Dictionary<int, ClientViewModel> ConsultationLawyers)
|
||||
{
|
||||
this.ConsultationLawyers = ConsultationLawyers.ToDictionary(x => x.Key, x => x.Value as ILawyerModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
using LawFimDataModels.Models;
|
||||
using System.ComponentModel;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
namespace LawFirmContracts.ViewModels
|
||||
{
|
||||
@ -13,5 +15,11 @@ namespace LawFirmContracts.ViewModels
|
||||
public string Judge { get; set; } = string.Empty;
|
||||
public int GuarantorId { get; set; }
|
||||
public Dictionary<int, ILawyerModel> HearingLawyers { get; set; } = new();
|
||||
}
|
||||
public HearingViewModel() { }
|
||||
[JsonConstructor]
|
||||
public HearingViewModel(Dictionary<int, LawyerViewModel> HearingLawyers)
|
||||
{
|
||||
this.HearingLawyers = HearingLawyers.ToDictionary(x => x.Key, x => x.Value as ILawyerModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -79,6 +79,7 @@ namespace LawFirmGuarantorApp.Controllers
|
||||
[HttpGet]
|
||||
public IActionResult UpdateConsultation()
|
||||
{
|
||||
ViewBag.Cases = APIClient.GetRequest<List<CaseViewModel>>($"api/case/getcaselist?executorId=1");
|
||||
return View();
|
||||
}
|
||||
[HttpPost]
|
||||
@ -126,7 +127,7 @@ namespace LawFirmGuarantorApp.Controllers
|
||||
Id = id
|
||||
|
||||
});
|
||||
Response.Redirect("Home/Consultations");
|
||||
Response.Redirect("/Home/Consultations");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ namespace LawFirmGuarantorApp.Controllers
|
||||
}
|
||||
|
||||
APIClient.PostRequest("api/hearing/addlawyertohearing", Tuple.Create(new HearingSearchModel { Id = Id }, lawyerId));
|
||||
Response.Redirect("/Home/Lawyers");
|
||||
Response.Redirect("/Home/Hearings");
|
||||
}
|
||||
[HttpGet]
|
||||
public IActionResult CreateHearing()
|
||||
|
@ -20,9 +20,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">Дело</div>
|
||||
<div class="col-4">Номер дела</div>
|
||||
<div class="col-8">
|
||||
<select id="caseId" name="caseId" class="form-control" asp-items="@(new SelectList(@ViewBag.Cases,"Id", "Name"))"></select>
|
||||
<select id="caseId" name="caseId" class="form-control" asp-items="@(new SelectList(@ViewBag.Cases,"Id", "Id"))"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
@ -8,21 +8,15 @@
|
||||
</div>
|
||||
<form method="post">
|
||||
<div class="row">
|
||||
<div class="col-4">Стоимость</div>
|
||||
<div class="col-4">Стоимость консультации</div>
|
||||
<div class="col-8">
|
||||
<input type="text" name="cost" id="cost" />
|
||||
<input type="number" id="cost" name="cost">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">Дата</div>
|
||||
<div class="col-4">Дата и время</div>
|
||||
<div class="col-8">
|
||||
<input type="text" name="date" id="date" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">Дело</div>
|
||||
<div class="col-8">
|
||||
<select id="caseId" name="caseId" class="form-control" asp-items="@(new SelectList(@ViewBag.Cases,"Id", "Id"))"></select>
|
||||
<input type="datetime-local" placeholder="Введите дату" name="consultationDate" id="consultationDate">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
@ -33,7 +33,7 @@
|
||||
Дата консультации
|
||||
</th>
|
||||
<th>
|
||||
Наименование дела
|
||||
Номер дела
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -55,7 +55,7 @@
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem =>
|
||||
item.CaseName)
|
||||
item.CaseId)
|
||||
</td>
|
||||
<td>
|
||||
<form action="/Consultation/DeleteConsultation" method="post">
|
||||
@ -70,9 +70,9 @@
|
||||
</form>
|
||||
</td>
|
||||
<td>
|
||||
<form action="/Consultation/ConsultationClients">
|
||||
<form action="/Consultation/ConsultationLawyers">
|
||||
<input type="hidden" name="id" value="@item.Id" />
|
||||
<button type="submit" class="btn btn-danger">Клиенты</button>
|
||||
<button type="submit" class="btn btn-danger">Юристы</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -62,9 +62,9 @@
|
||||
</form>
|
||||
</td>
|
||||
<td>
|
||||
<form action="/Hearing/HearingClients">
|
||||
<form action="/Hearing/HearingLawyers">
|
||||
<input type="hidden" name="id" value="@item.Id" />
|
||||
<button type="submit" class="btn btn-danger">Клиенты</button>
|
||||
<button type="submit" class="btn btn-danger">Юристы</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -16,7 +16,7 @@
|
||||
<div class="row">
|
||||
<div class="col-4">Номер телефона</div>
|
||||
<div class="col-8">
|
||||
<input type="number" id="phone" name="phone" />
|
||||
<input type="tel" id="phone" name="phone" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
@ -19,9 +19,6 @@
|
||||
</button>
|
||||
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
|
||||
<ul class="navbar-nav flex-grow-1">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Lawyers">Home</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Lawyers">Юристы</a>
|
||||
</li>
|
||||
|
Loading…
x
Reference in New Issue
Block a user