public ResponseUpdateWindow UpdateWindow(int id, RequestUpdateWindow request) { var imagePath = string.Empty; if (!(string.IsNullOrEmpty(request.FileData) || string.IsNullOrEmpty(request.FileName))) { imagePath = SaveImageToWorksampleDirectory(request.FileName, request.FileData, CATALOG_DIRECTORY); } var windowItem = dbManager.GetById(id); if (windowItem == null) { throw new Exception("Не найдено ПВХ окно в БД"); } windowItem.Name = request.Name; windowItem.Feature = request.Feature; windowItem.HasSetup = request.HasSetup; if (!string.IsNullOrEmpty(imagePath)) { windowItem.ImageUrl = imagePath; } windowItem.Size = request.Size; windowItem.Total = request.Total; dbManager.UpdateWindowPlastic(windowItem); return(new ResponseUpdateWindow()); }
public ResponseUpdateWindow UpdateWindow(int id, [FromBody] RequestUpdateWindow request) { return(ExecuteWrapper.Execute(() => { return aManager.UpdateWindow(id, request); })); }