багает изменение посещений остальное пока не делал
This commit is contained in:
parent
6ba7695422
commit
a70edccc23
@ -18,10 +18,7 @@ namespace VeterinaryDatabaseImplement.Implements
|
||||
}
|
||||
public List<VisitViewModel> GetFilteredList(VisitSearchModel model)
|
||||
{
|
||||
if (string.IsNullOrEmpty(model.VisitName))
|
||||
{
|
||||
return new();
|
||||
}
|
||||
|
||||
using var context = new VeterinaryDatabase();
|
||||
return context.Visits.Include(x => x.Owner).Include(x => x.Pets).ThenInclude(x => x.Pet).Include(x => x.Doctor)
|
||||
.Where(x => ((!model.Id.HasValue || x.Id == model.Id) &&
|
||||
|
@ -75,5 +75,19 @@ namespace VeterinaryRestApi.Controllers
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public bool UpdateVisit(VisitBindingModel model)
|
||||
{
|
||||
try
|
||||
{
|
||||
return _visit.Update(model);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Не удалось обновить лекарства");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -206,6 +206,7 @@ namespace VeterinaryShowOwnerApp.Controllers
|
||||
}
|
||||
return result;
|
||||
}
|
||||
[HttpGet]
|
||||
public IActionResult Visits()
|
||||
{
|
||||
if (APIOwner.Owner == null)
|
||||
|
@ -22,4 +22,27 @@
|
||||
<div class="col-8"></div>
|
||||
<div class="col-4"><input type="submit" value="Сохранить" class="btn btn-primary" /></div>
|
||||
</div>
|
||||
</form>
|
||||
</form>
|
||||
|
||||
@section Scripts
|
||||
{
|
||||
<script>
|
||||
function check() {
|
||||
var visit = $('#visit').val();
|
||||
if (visit) {
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
url: "/Home/GetVisit",
|
||||
data: { visitId: visit },
|
||||
success: function (result) {
|
||||
$('#name').val(result.item1.visitName);
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
check();
|
||||
$('#visit').on('change', function () {
|
||||
check();
|
||||
});
|
||||
</script>
|
||||
}
|
Loading…
Reference in New Issue
Block a user