Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
 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));
     }
 }