правочки

This commit is contained in:
Галина Федоренко 2024-05-29 21:54:22 +04:00
parent 5016a2ed4d
commit d75faff2b7
9 changed files with 63 additions and 34 deletions

View File

@ -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);
} }

View File

@ -13,7 +13,7 @@ namespace LawFirmExecutorApp.Controllers
{ {
if (APIClient.Executor == null) if (APIClient.Executor == null)
{ {
return Redirect("~/Home/EnterExecutor"); return Redirect("/Home/EnterExecutor");
} }
return return
View(APIClient.GetRequest<List<ClientViewModel>>($"api/case/getclientlisttocase?conId={id}")); View(APIClient.GetRequest<List<ClientViewModel>>($"api/case/getclientlisttocase?conId={id}"));
@ -39,7 +39,7 @@ namespace LawFirmExecutorApp.Controllers
} }
APIClient.PostRequest("api/case/addclienttocase", Tuple.Create(new CaseSearchModel { Id = conId }, clientId)); APIClient.PostRequest("api/case/addclienttocase", Tuple.Create(new CaseSearchModel { Id = conId }, clientId));
Response.Redirect("~/Home/Cases"); Response.Redirect("/Home/Cases");
} }
[HttpGet] [HttpGet]
public IActionResult CreateCase() public IActionResult CreateCase()
@ -63,7 +63,7 @@ namespace LawFirmExecutorApp.Controllers
CaseType = type, CaseType = type,
DateCreate = DateTime.Now DateCreate = DateTime.Now
}); });
Response.Redirect("~/Home/Cases"); Response.Redirect("/Home/Cases");
} }
[HttpGet] [HttpGet]
public IActionResult UpdateCase() public IActionResult UpdateCase()
@ -87,7 +87,7 @@ namespace LawFirmExecutorApp.Controllers
CaseType = type, CaseType = type,
DateCreate = date DateCreate = date
}); });
Response.Redirect("~/Home/Cases"); Response.Redirect("/Home/Cases");
} }
[HttpPost] [HttpPost]
public void DeleteCase(int id) public void DeleteCase(int id)
@ -107,7 +107,7 @@ namespace LawFirmExecutorApp.Controllers
DateCreate = DateTime.Now DateCreate = DateTime.Now
}); });
Response.Redirect("~/Home/Cases"); Response.Redirect("/Home/Cases");
} }
} }

View File

@ -30,7 +30,7 @@ namespace LawFirmExecutorApp.Controllers
Email = email Email = email
}); });
Response.Redirect("~/Home/Clients"); Response.Redirect("/Home/Clients");
} }
[HttpPost] [HttpPost]
@ -47,7 +47,7 @@ namespace LawFirmExecutorApp.Controllers
Id = id Id = id
}); });
Response.Redirect("~/Home/Clients"); Response.Redirect("/Home/Clients");
} }
[HttpGet] [HttpGet]
public IActionResult UpdateClient() public IActionResult UpdateClient()
@ -71,7 +71,7 @@ namespace LawFirmExecutorApp.Controllers
Email = email, Email = email,
Phone = phone Phone = phone
}); });
Response.Redirect("~/Home/Clients"); Response.Redirect("/Home/Clients");
} }
} }
} }

View File

@ -21,7 +21,7 @@ namespace LawFirmExecutorApp.Controllers
{ {
if (APIClient.Executor == null) if (APIClient.Executor == null)
{ {
return Redirect("~/Home/EnterExecutor"); return Redirect("/Home/EnterExecutor");
} }
return return
View(APIClient.GetRequest<List<CaseViewModel>>($"api/case/getcaselist?executorid={APIClient.Executor.Id}")); View(APIClient.GetRequest<List<CaseViewModel>>($"api/case/getcaselist?executorid={APIClient.Executor.Id}"));
@ -32,7 +32,7 @@ namespace LawFirmExecutorApp.Controllers
{ {
if (APIClient.Executor == null) if (APIClient.Executor == null)
{ {
return Redirect("~/Home/EnterExecutor"); return Redirect("/Home/EnterExecutor");
} }
return return
View(APIClient.GetRequest<List<ClientViewModel>>($"api/client/getclientlist?executorid={APIClient.Executor.Id}")); View(APIClient.GetRequest<List<ClientViewModel>>($"api/client/getclientlist?executorid={APIClient.Executor.Id}"));
@ -42,7 +42,7 @@ namespace LawFirmExecutorApp.Controllers
{ {
if (APIClient.Executor == null) if (APIClient.Executor == null)
{ {
return Redirect("~/Home/EnterExecutor"); return Redirect("/Home/EnterExecutor");
} }
return return
View(APIClient.GetRequest<List<VisitViewModel>>($"api/visit/getvisitlist?executorid={APIClient.Executor.Id}")); View(APIClient.GetRequest<List<VisitViewModel>>($"api/visit/getvisitlist?executorid={APIClient.Executor.Id}"));
@ -53,7 +53,7 @@ namespace LawFirmExecutorApp.Controllers
{ {
if (APIClient.Executor == null) if (APIClient.Executor == null)
{ {
return Redirect("~/Home/EnterExecutor"); return Redirect("/Home/EnterExecutor");
} }
//ViewBag.Executors = APIClient.GetRequest<List<ExecutorViewModel>>($"api/executor/getexecutorlist"); //ViewBag.Executors = APIClient.GetRequest<List<ExecutorViewModel>>($"api/executor/getexecutorlist");
return View(APIClient.Executor); return View(APIClient.Executor);
@ -82,7 +82,7 @@ namespace LawFirmExecutorApp.Controllers
APIClient.Executor.FIO = fio; APIClient.Executor.FIO = fio;
APIClient.Executor.Email = login; APIClient.Executor.Email = login;
APIClient.Executor.Password = password; APIClient.Executor.Password = password;
Response.Redirect("~/Home/Clients"); Response.Redirect("/Home/Clients");
} }
// РЕГИСТРАЦИЯ ИСПОЛНИТЕЛЯ // РЕГИСТРАЦИЯ ИСПОЛНИТЕЛЯ
@ -108,7 +108,7 @@ namespace LawFirmExecutorApp.Controllers
Email = login, Email = login,
Password = password Password = password
}); });
Response.Redirect("~/Home/EnterExecutor"); Response.Redirect("/Home/EnterExecutor");
return; return;
} }
@ -134,7 +134,7 @@ namespace LawFirmExecutorApp.Controllers
} }
else else
{ {
Response.Redirect("~/Home/Clients"); Response.Redirect("/Home/Clients");
} }
} }

View File

@ -12,7 +12,7 @@ namespace LawFirmExecutorApp.Controllers
{ {
if (APIClient.Executor == null) if (APIClient.Executor == null)
{ {
return Redirect("~/Home/EnterExecutor"); return Redirect("/Home/EnterExecutor");
} }
return return
View(APIClient.GetRequest<List<ClientViewModel>>($"api/visit/getclientlisttovisit?visitId={id}")); View(APIClient.GetRequest<List<ClientViewModel>>($"api/visit/getclientlisttovisit?visitId={id}"));
@ -37,7 +37,7 @@ namespace LawFirmExecutorApp.Controllers
} }
APIClient.PostRequest("api/visit/addclienttovisit", Tuple.Create(new VisitSearchModel { Id = hearId }, clientId)); APIClient.PostRequest("api/visit/addclienttovisit", Tuple.Create(new VisitSearchModel { Id = hearId }, clientId));
Response.Redirect("~/Home/Visits"); Response.Redirect("/Home/Visits");
} }
[HttpGet] [HttpGet]
public IActionResult CreateVisit() public IActionResult CreateVisit()
@ -45,7 +45,7 @@ namespace LawFirmExecutorApp.Controllers
return View(); return View();
} }
[HttpPost] [HttpPost]
public void CreateVisit(DateTime date) public void CreateVisit(DateTime date, int hearId)
{ {
if (APIClient.Executor == null) if (APIClient.Executor == null)
{ {
@ -57,8 +57,9 @@ namespace LawFirmExecutorApp.Controllers
{ {
ExecutorId = APIClient.Executor.Id, ExecutorId = APIClient.Executor.Id,
VisitDate = date, VisitDate = date,
HearingId = hearId,
}); });
Response.Redirect("~/Home/Visits"); Response.Redirect("/Home/Visits");
} }
[HttpGet] [HttpGet]
public IActionResult UpdateVisit() public IActionResult UpdateVisit()
@ -81,7 +82,7 @@ namespace LawFirmExecutorApp.Controllers
VisitDate = date, VisitDate = date,
}); });
Response.Redirect("~/Home/Visits"); Response.Redirect("/Home/Visits");
} }
[HttpPost] [HttpPost]
public void DeleteVisit(int id) public void DeleteVisit(int id)
@ -99,7 +100,7 @@ namespace LawFirmExecutorApp.Controllers
Id = id Id = id
}); });
Response.Redirect("~/Home/Visits"); Response.Redirect("/Home/Visits");
} }
} }
} }

View File

@ -68,13 +68,22 @@
@Html.DisplayFor(modelItem => item.DateImplement) @Html.DisplayFor(modelItem => item.DateImplement)
</td> </td>
<td> <td>
<button type="submit" class="btn btn-danger">Удалить</button> <form action="/Case/DeleteCase" 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="/Case/UpdateCase">
<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="/Case/CaseClients">
<input type="hidden" name="id" value="@item.Id" />
<button type="submit" class="btn btn-danger">Клиенты</button>
</form>
</td> </td>
</tr> </tr>
} }

View File

@ -54,11 +54,16 @@
@Html.DisplayFor(modelItem => item.Phone) @Html.DisplayFor(modelItem => item.Phone)
</td> </td>
<td> <td>
<button type="submit" class="btn btn-danger">Удалить</button> <form action="/Client/DeleteClient" 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="/Client/UpdateClient">
<input type="hidden" name="id" value="@item.Id" />
<button type="submit" class="btn btn-danger">Изменить</button>
</form>
</td> </td>
</tr> </tr>
} }

View File

@ -53,13 +53,22 @@
</td> </td>
<td> <td>
<button type="submit" class="btn btn-danger">Удалить</button> <form action="/Visit/DeleteVisit" 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="/Visit/UpdateVisit">
<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="/Visit/VisitClients">
<input type="hidden" name="id" value="@item.Id" />
<button type="submit" class="btn btn-danger">Клиенты</button>
</form>
</td> </td>
</tr> </tr>

View File

@ -16,7 +16,12 @@
<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="hearingId" name="hearingId" class="form-control" asp-items="@(new SelectList(@ViewBag.Hearings,"Id", "Id"))"></select> <select name="hearings" class="form-control" multiple size="6" id="hearings">
@foreach (var hearing in ViewBag.Hearings)
{
<option value="@hearing.Id">@hearing.HearingDate</option>
}
</select>
</div> </div>
</div> </div>
<div class="row"> <div class="row">