правочки

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)
{
//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);
}

View File

@ -13,7 +13,7 @@ namespace LawFirmExecutorApp.Controllers
{
if (APIClient.Executor == null)
{
return Redirect("~/Home/EnterExecutor");
return Redirect("/Home/EnterExecutor");
}
return
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));
Response.Redirect("~/Home/Cases");
Response.Redirect("/Home/Cases");
}
[HttpGet]
public IActionResult CreateCase()
@ -63,7 +63,7 @@ namespace LawFirmExecutorApp.Controllers
CaseType = type,
DateCreate = DateTime.Now
});
Response.Redirect("~/Home/Cases");
Response.Redirect("/Home/Cases");
}
[HttpGet]
public IActionResult UpdateCase()
@ -87,7 +87,7 @@ namespace LawFirmExecutorApp.Controllers
CaseType = type,
DateCreate = date
});
Response.Redirect("~/Home/Cases");
Response.Redirect("/Home/Cases");
}
[HttpPost]
public void DeleteCase(int id)
@ -107,7 +107,7 @@ namespace LawFirmExecutorApp.Controllers
DateCreate = DateTime.Now
});
Response.Redirect("~/Home/Cases");
Response.Redirect("/Home/Cases");
}
}

View File

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

View File

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

View File

@ -12,7 +12,7 @@ namespace LawFirmExecutorApp.Controllers
{
if (APIClient.Executor == null)
{
return Redirect("~/Home/EnterExecutor");
return Redirect("/Home/EnterExecutor");
}
return
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));
Response.Redirect("~/Home/Visits");
Response.Redirect("/Home/Visits");
}
[HttpGet]
public IActionResult CreateVisit()
@ -45,7 +45,7 @@ namespace LawFirmExecutorApp.Controllers
return View();
}
[HttpPost]
public void CreateVisit(DateTime date)
public void CreateVisit(DateTime date, int hearId)
{
if (APIClient.Executor == null)
{
@ -57,8 +57,9 @@ namespace LawFirmExecutorApp.Controllers
{
ExecutorId = APIClient.Executor.Id,
VisitDate = date,
HearingId = hearId,
});
Response.Redirect("~/Home/Visits");
Response.Redirect("/Home/Visits");
}
[HttpGet]
public IActionResult UpdateVisit()
@ -81,7 +82,7 @@ namespace LawFirmExecutorApp.Controllers
VisitDate = date,
});
Response.Redirect("~/Home/Visits");
Response.Redirect("/Home/Visits");
}
[HttpPost]
public void DeleteVisit(int id)
@ -99,7 +100,7 @@ namespace LawFirmExecutorApp.Controllers
Id = id
});
Response.Redirect("~/Home/Visits");
Response.Redirect("/Home/Visits");
}
}
}

View File

@ -68,13 +68,22 @@
@Html.DisplayFor(modelItem => item.DateImplement)
</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>
<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>
<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>
</tr>
}

View File

@ -54,11 +54,16 @@
@Html.DisplayFor(modelItem => item.Phone)
</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>
<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>
</tr>
}

View File

@ -53,13 +53,22 @@
</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>
<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>
<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>
</tr>

View File

@ -16,7 +16,12 @@
<div class="row">
<div class="col-4">Слушание</div>
<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 class="row">