уже не помню что я сделала
This commit is contained in:
parent
bd3a689ebf
commit
51467aacd4
@ -11,9 +11,9 @@ namespace LawFirmDatabaseImplement
|
|||||||
{
|
{
|
||||||
if (optionsBuilder.IsConfigured == false)
|
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);
|
base.OnConfiguring(optionsBuilder);
|
||||||
}
|
}
|
||||||
|
@ -43,6 +43,7 @@ namespace LawFirmGuarantorApp.Controllers
|
|||||||
[HttpGet]
|
[HttpGet]
|
||||||
public IActionResult CreateConsultation()
|
public IActionResult CreateConsultation()
|
||||||
{
|
{
|
||||||
|
ViewBag.Cases = APIClient.GetRequest<List<CaseViewModel>>($"api/case/getcaselist?executorId={APIClient.Guarantor.Id}");
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
using LawFirmContracts.BindingModels;
|
using LawFimDataModels.Models;
|
||||||
|
using LawFirmContracts.BindingModels;
|
||||||
using LawFirmContracts.SearchModels;
|
using LawFirmContracts.SearchModels;
|
||||||
using LawFirmContracts.ViewModels;
|
using LawFirmContracts.ViewModels;
|
||||||
|
using LawFirmDatabaseImplement.Models;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace LawFirmGuarantorApp.Controllers
|
namespace LawFirmGuarantorApp.Controllers
|
||||||
@ -30,14 +32,14 @@ namespace LawFirmGuarantorApp.Controllers
|
|||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public void AddLawyer(int hearId, int lawyerId)
|
public void AddLawyer(int Id, int lawyerId)
|
||||||
{
|
{
|
||||||
if (APIClient.Guarantor == null)
|
if (APIClient.Guarantor == null)
|
||||||
{
|
{
|
||||||
throw new Exception("Вы как суда попали? Суда вход только авторизованным");
|
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");
|
Response.Redirect("/Home/Lawyers");
|
||||||
}
|
}
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
@ -46,19 +48,29 @@ namespace LawFirmGuarantorApp.Controllers
|
|||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public void CreateHearing(DateTime date, string judge)
|
public void CreateHearing(DateTime date, string judge, List<int> lawyers)
|
||||||
{
|
{
|
||||||
if (APIClient.Guarantor == null)
|
if (APIClient.Guarantor == null)
|
||||||
{
|
{
|
||||||
throw new Exception("Вы как суда попали? Суда вход только авторизованным");
|
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
|
APIClient.PostRequest("api/hearing/createhearing", new
|
||||||
HearingBindingModel
|
HearingBindingModel
|
||||||
{
|
{
|
||||||
GuarantorId = APIClient.Guarantor.Id,
|
GuarantorId = APIClient.Guarantor.Id,
|
||||||
HearingDate = date,
|
HearingDate = date,
|
||||||
Judge = judge
|
Judge = judge,
|
||||||
|
HearingLawyers = a
|
||||||
|
|
||||||
});
|
});
|
||||||
Response.Redirect("/Home/Hearings");
|
Response.Redirect("/Home/Hearings");
|
||||||
@ -69,12 +81,21 @@ namespace LawFirmGuarantorApp.Controllers
|
|||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
[HttpPost]
|
[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)
|
if (APIClient.Guarantor == null)
|
||||||
{
|
{
|
||||||
throw new Exception("Вы как суда попали? Суда вход только авторизованным");
|
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
|
APIClient.PostRequest("api/hearing/updatehearing", new
|
||||||
HearingBindingModel
|
HearingBindingModel
|
||||||
@ -82,7 +103,8 @@ namespace LawFirmGuarantorApp.Controllers
|
|||||||
Id = id,
|
Id = id,
|
||||||
GuarantorId = APIClient.Guarantor.Id,
|
GuarantorId = APIClient.Guarantor.Id,
|
||||||
HearingDate = date,
|
HearingDate = date,
|
||||||
Judge = judge
|
Judge = judge,
|
||||||
|
HearingLawyers = a
|
||||||
|
|
||||||
});
|
});
|
||||||
Response.Redirect("/Home/Hearings");
|
Response.Redirect("/Home/Hearings");
|
||||||
|
@ -65,6 +65,7 @@ namespace LawFirmGuarantorApp.Controllers
|
|||||||
APIClient.PostRequest("api/lawyer/updatelawyer", new
|
APIClient.PostRequest("api/lawyer/updatelawyer", new
|
||||||
LawyerBindingModel
|
LawyerBindingModel
|
||||||
{
|
{
|
||||||
|
Id = id,
|
||||||
GuarantorId = APIClient.Guarantor.Id,
|
GuarantorId = APIClient.Guarantor.Id,
|
||||||
FIO = fio,
|
FIO = fio,
|
||||||
Email = email,
|
Email = email,
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-4">Слушание</div>
|
<div class="col-4">Слушание</div>
|
||||||
<div class="col-8">
|
<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>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -54,13 +54,22 @@
|
|||||||
item.CaseName)
|
item.CaseName)
|
||||||
</td>
|
</td>
|
||||||
<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>
|
||||||
<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>
|
||||||
<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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
|
@ -50,13 +50,22 @@
|
|||||||
item.Judge)
|
item.Judge)
|
||||||
</td>
|
</td>
|
||||||
<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>
|
||||||
<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>
|
||||||
<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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
|
@ -53,11 +53,17 @@
|
|||||||
@Html.DisplayFor(modelItem => item.Email)
|
@Html.DisplayFor(modelItem => item.Email)
|
||||||
</td>
|
</td>
|
||||||
<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>
|
||||||
|
|
||||||
<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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user