уже не помню что я сделала
This commit is contained in:
parent
bd3a689ebf
commit
51467aacd4
@ -11,9 +11,9 @@ namespace LawFirmDatabaseImplement
|
||||
{
|
||||
if (optionsBuilder.IsConfigured == false)
|
||||
{
|
||||
optionsBuilder.UseSqlServer(@"Data Source=ZIRAEL\SQLEXPRESS;Initial Catalog=LawFirmDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
||||
//optionsBuilder.UseSqlServer(@"Data Source=ZIRAEL\SQLEXPRESS;Initial Catalog=LawFirmDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
||||
|
||||
// optionsBuilder.UseSqlServer(@"Data Source=PC-Anna\SQLEXPRESS;Initial Catalog=LawFirmDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
||||
optionsBuilder.UseSqlServer(@"Data Source=PC-Anna\SQLEXPRESS;Initial Catalog=LawFirmDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
||||
}
|
||||
base.OnConfiguring(optionsBuilder);
|
||||
}
|
||||
|
@ -43,6 +43,7 @@ namespace LawFirmGuarantorApp.Controllers
|
||||
[HttpGet]
|
||||
public IActionResult CreateConsultation()
|
||||
{
|
||||
ViewBag.Cases = APIClient.GetRequest<List<CaseViewModel>>($"api/case/getcaselist?executorId={APIClient.Guarantor.Id}");
|
||||
return View();
|
||||
}
|
||||
[HttpPost]
|
||||
|
@ -1,6 +1,8 @@
|
||||
using LawFirmContracts.BindingModels;
|
||||
using LawFimDataModels.Models;
|
||||
using LawFirmContracts.BindingModels;
|
||||
using LawFirmContracts.SearchModels;
|
||||
using LawFirmContracts.ViewModels;
|
||||
using LawFirmDatabaseImplement.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace LawFirmGuarantorApp.Controllers
|
||||
@ -30,14 +32,14 @@ namespace LawFirmGuarantorApp.Controllers
|
||||
return View();
|
||||
}
|
||||
[HttpPost]
|
||||
public void AddLawyer(int hearId, int lawyerId)
|
||||
public void AddLawyer(int Id, int lawyerId)
|
||||
{
|
||||
if (APIClient.Guarantor == null)
|
||||
{
|
||||
throw new Exception("Вы как суда попали? Суда вход только авторизованным");
|
||||
}
|
||||
|
||||
APIClient.PostRequest("api/hearing/addlawyertohearing", Tuple.Create(new HearingSearchModel { Id = hearId }, lawyerId));
|
||||
APIClient.PostRequest("api/hearing/addlawyertohearing", Tuple.Create(new HearingSearchModel { Id = Id }, lawyerId));
|
||||
Response.Redirect("/Home/Lawyers");
|
||||
}
|
||||
[HttpGet]
|
||||
@ -46,19 +48,29 @@ namespace LawFirmGuarantorApp.Controllers
|
||||
return View();
|
||||
}
|
||||
[HttpPost]
|
||||
public void CreateHearing(DateTime date, string judge)
|
||||
public void CreateHearing(DateTime date, string judge, List<int> lawyers)
|
||||
{
|
||||
if (APIClient.Guarantor == null)
|
||||
{
|
||||
throw new Exception("Вы как суда попали? Суда вход только авторизованным");
|
||||
}
|
||||
if (string.IsNullOrEmpty(judge))
|
||||
{
|
||||
throw new Exception("Суд пуст!");
|
||||
}
|
||||
Dictionary<int, ILawyerModel> a = new Dictionary<int, ILawyerModel>();
|
||||
foreach (int lawyer in lawyers)
|
||||
{
|
||||
a.Add(lawyer, new LawyerSearchModel { Id = lawyer } as ILawyerModel);
|
||||
}
|
||||
|
||||
APIClient.PostRequest("api/hearing/createhearing", new
|
||||
HearingBindingModel
|
||||
{
|
||||
GuarantorId = APIClient.Guarantor.Id,
|
||||
HearingDate = date,
|
||||
Judge = judge
|
||||
Judge = judge,
|
||||
HearingLawyers = a
|
||||
|
||||
});
|
||||
Response.Redirect("/Home/Hearings");
|
||||
@ -69,12 +81,21 @@ namespace LawFirmGuarantorApp.Controllers
|
||||
return View();
|
||||
}
|
||||
[HttpPost]
|
||||
public void UpdateHearing(int id, DateTime date, string judge)
|
||||
public void UpdateHearing(int id, DateTime date, string judge, List<int> lawyers)
|
||||
{
|
||||
if (APIClient.Guarantor == null)
|
||||
{
|
||||
throw new Exception("Вы как суда попали? Суда вход только авторизованным");
|
||||
}
|
||||
if (string.IsNullOrEmpty(judge))
|
||||
{
|
||||
throw new Exception("Суд пуст!");
|
||||
}
|
||||
Dictionary<int, ILawyerModel> a = new Dictionary<int, ILawyerModel>();
|
||||
foreach (int lawyer in lawyers)
|
||||
{
|
||||
a.Add(lawyer, new LawyerSearchModel { Id = lawyer } as ILawyerModel);
|
||||
}
|
||||
|
||||
APIClient.PostRequest("api/hearing/updatehearing", new
|
||||
HearingBindingModel
|
||||
@ -82,7 +103,8 @@ namespace LawFirmGuarantorApp.Controllers
|
||||
Id = id,
|
||||
GuarantorId = APIClient.Guarantor.Id,
|
||||
HearingDate = date,
|
||||
Judge = judge
|
||||
Judge = judge,
|
||||
HearingLawyers = a
|
||||
|
||||
});
|
||||
Response.Redirect("/Home/Hearings");
|
||||
|
@ -65,6 +65,7 @@ namespace LawFirmGuarantorApp.Controllers
|
||||
APIClient.PostRequest("api/lawyer/updatelawyer", new
|
||||
LawyerBindingModel
|
||||
{
|
||||
Id = id,
|
||||
GuarantorId = APIClient.Guarantor.Id,
|
||||
FIO = fio,
|
||||
Email = email,
|
||||
|
@ -12,7 +12,7 @@
|
||||
<div class="row">
|
||||
<div class="col-4">Слушание</div>
|
||||
<div class="col-8">
|
||||
<select id="id" name="id" class="form-control" asp-items="@(new SelectList(@ViewBag.Hearings,"Id", "HearingDate"))"></select>
|
||||
<select id="Id" name="Id" class="form-control" asp-items="@(new SelectList(@ViewBag.Hearings,"Id", "HearingDate"))"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
@ -54,13 +54,22 @@
|
||||
item.CaseName)
|
||||
</td>
|
||||
<td>
|
||||
<button type="submit" class="btn btn-danger">Удалить</button>
|
||||
<form action="/Consultation/DeleteConsultation" method="post">
|
||||
<input type="hidden" name="id" value="@item.Id" />
|
||||
<button type="submit" class="btn btn-danger">Удалить</button>
|
||||
</form>
|
||||
</td>
|
||||
<td>
|
||||
<button type="submit" class="btn btn-danger">Изменить</button>
|
||||
<form action="/Consultation/UpdateConsultation">
|
||||
<input type="hidden" name="id" value="@item.Id" />
|
||||
<button type="submit" class="btn btn-danger">Изменить</button>
|
||||
</form>
|
||||
</td>
|
||||
<td>
|
||||
<button type="submit" class="btn btn-danger">Юристы</button>
|
||||
<form action="/Consultation/ConsultationClients">
|
||||
<input type="hidden" name="id" value="@item.Id" />
|
||||
<button type="submit" class="btn btn-danger">Клиенты</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
|
@ -50,13 +50,22 @@
|
||||
item.Judge)
|
||||
</td>
|
||||
<td>
|
||||
<button type="submit" class="btn btn-danger">Удалить</button>
|
||||
<form action="/Hearing/DeleteHearing" method="post">
|
||||
<input type="hidden" name="id" value="@item.Id" />
|
||||
<button type="submit" class="btn btn-danger">Удалить</button>
|
||||
</form>
|
||||
</td>
|
||||
<td>
|
||||
<button type="submit" class="btn btn-danger">Изменить</button>
|
||||
<form action="/Hearing/UpdateHearing">
|
||||
<input type="hidden" name="id" value="@item.Id" />
|
||||
<button type="submit" class="btn btn-danger">Изменить</button>
|
||||
</form>
|
||||
</td>
|
||||
<td>
|
||||
<button type="submit" class="btn btn-danger">Юристы</button>
|
||||
<form action="/Hearing/HearingClients">
|
||||
<input type="hidden" name="id" value="@item.Id" />
|
||||
<button type="submit" class="btn btn-danger">Клиенты</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
|
@ -53,11 +53,17 @@
|
||||
@Html.DisplayFor(modelItem => item.Email)
|
||||
</td>
|
||||
<td>
|
||||
<button type="submit" class="btn btn-danger">Удалить</button>
|
||||
<form action="/Lawyer/DeleteLawyer" method="post">
|
||||
<input type="hidden" name="id" value="@item.Id" />
|
||||
<button type="submit" class="btn btn-danger">Удалить</button>
|
||||
</form>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<button type="submit" class="btn btn-danger">Изменить</button>
|
||||
<form action="/Lawyer/UpdateLawyer">
|
||||
<input type="hidden" name="id" value="@item.Id" />
|
||||
<button type="submit" class="btn btn-danger">Изменить</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user