Esempio n. 1
0
        public async Task <IActionResult> Delete(int id)
        {
            try
            {
                await _devicesRepository.Delete(id);

                return(NoContent());
            }
            catch (InvalidDeviceException)
            {
                return(NotFound());
            }
        }
        public async Task <IActionResult> Delete(string partitionKey, string rowKey)
        {
            var response = await devicesRepository.Delete(partitionKey, rowKey);

            return(Ok(new
            {
                correct = response,
                title = "Mensaje del sistema",
                message = "Dispositivo eliminado correctamente",
                deviceData = response,
                fullStackTrace = "",
            }));
        }
Esempio n. 3
0
        public ActionResult Delete(Guid id)
        {
            try
            {
                var devices = devicesRepository.RetrieveByPK(id);
                if (devices == null || devices.User != CurrentUser(hunter))
                {
                    return(JsonResponse(ResponseType.error, ResponseMessage.ItemNotFound));
                }

                devicesRepository.Delete(devices);
                devicesRepository.SaveChanges();

                return(JsonResponse(ResponseType.success, ResponseMessage.DeletedSuccessfully));
            }
            catch (Exception ex)
            {
                return(InternalException(ex));
            }
        }
Esempio n. 4
0
 public RedirectResult Delete(Guid id)//delete user and his videos
 {
     _usersRepository.Delete(id);
     _devicesRepository.Delete(id);
     return(Redirect("~/Admin/Index"));
 }
 public RedirectResult Delete(string name)
 {
     _devicesRepository.Delete(name);
     return(Redirect("~/Admin/Index"));
 }