Exemple #1
0
        public async Task <IActionResult> DeleteSirket(int id)
        {
            if (id == 0)
            {
                return(BadRequest());
            }

            var sirket = await _sirketService.GetSirketById(id);

            if (sirket == null)
            {
                return(NotFound());
            }

            await _sirketService.DeleteSirket(sirket);

            return(Ok());
        }
Exemple #2
0
 public ActionResult Delete(int id = -1)
 {
     if (permissionUser.SysAdmin == false)
     {
         throw new Exception("Yetkisiz Erişim!");
     }
     else
     {
         if (id != -1)
         {
             Sirketler sirket = _sirketService.GetById(id);
             if (sirket != null)
             {
                 _sirketService.DeleteSirket(sirket);
                 _accessDatasService.AddOperatorLog(182, user.Kullanici_Adi, id, 0, 0, 0);
                 return(RedirectToAction("Index"));
             }
         }
         return(RedirectToAction("Index"));
     }
 }