public async Task <ActionResult <SirketDTO> > UpdateSirket(int id, [FromBody] Sirket updateSirketResource) { var sirketToBeUpdate = await _sirketService.GetSirketById(id); if (sirketToBeUpdate == null) { return(NotFound()); } await _sirketService.UpdateSirket(sirketToBeUpdate, updateSirketResource); var updatedSirket = await _sirketService.GetSirketById(id); return(Ok(updatedSirket)); }
public ActionResult Edit(Sirketler sirketler) { if (permissionUser.SysAdmin == false) { throw new Exception("Yetkisiz Erişim!"); } else { if (ModelState.IsValid) { var sirket = _sirketService.GetById(sirketler.Sirket_No); if (sirket != null) { _sirketService.UpdateSirket(sirketler); _accessDatasService.AddOperatorLog(181, user.Kullanici_Adi, sirketler.Sirket_No, 0, 0, 0); return(RedirectToAction("Index")); } } return(View(sirketler)); } }