public string DeleteUploadedFile(string idFile)
        {
            IBusinessService businessService = Factory.Create <IBusinessService>("UploadedFile", ClassType.clsTypeBusinessService);
            OperationResult  result          = businessService.Delete(idFile);

            return(Serializer.Json.Serialize(result));
        }
Beispiel #2
0
 public ActionResult Details(int id, BusinessViewModel collection)
 {
     try
     {
         if (id > 0)
         {
             collection.UpdaterId = LogedInAdmin.Id;
             _businessService.Delete(_mapper.Map <Business>(collection));
             return(RedirectToAction("Index"));
         }
         ModelState.AddModelError(string.Empty, GeneralMessages.EmptyId);
     }
     catch (Exception ex)
     {
         _logger.Error(ex);
         if (ex.InnerException != null && ex.InnerException.Source.Equals(GeneralMessages.ExceptionSource))
         {
             ModelState.AddModelError(string.Empty, ex.Message);
         }
         else
         {
             ModelState.AddModelError(string.Empty, GeneralMessages.UnexpectedError);
         }
     }
     return(View(collection));
 }
Beispiel #3
0
        public string DeleteSenderEmailAccount(string idSender)
        {
            IBusinessService businessService = Factory.Create <IBusinessService>("SenderEmailAccount", ClassType.clsTypeBusinessService);
            OperationResult  result          = businessService.Delete(idSender);

            return(Serializer.Json.Serialize(result));
        }
Beispiel #4
0
        public string DeleteEmailReceiver(string idReceiver)
        {
            IBusinessService businessService = Factory.Create <IBusinessService>("EmailReceiver", ClassType.clsTypeBusinessService);
            OperationResult  result          = businessService.Delete(idReceiver);

            return(Serializer.Json.Serialize(result));
        }
        public OperationResult Delete(object id)
        {
            OperationResult result = new OperationResult(true, id);

            IBusinessService businessService = Factory.Create <IBusinessService>(this.Key, ClassType.clsTypeBusinessService);

            result = businessService.Delete(id);
            return(result);
        }
        public async Task <IActionResult> Delete(Guid id)
        {
            try
            {
                var response = await _service.Delete(id);

                if (!response.IsSuccessful)
                {
                    return(BadRequest(response));
                }
                return(Ok(response));
            }
            catch
            {
                return(StatusCode(500, "Internal Server Error."));
            }
        }
        public IActionResult Delete(int id)
        {
            if (Convert.ToInt32(User.Identity.Name) != id)
            {
                return(Unauthorized());
            }

            try
            {
                _businessService.Delete(id);
                return(Ok());
            }
            catch (ValidationException ex)
            {
                return(BadRequest(new { message = ex.Message }));
            }
        }
        public async Task <ActionResult> Delete(string id)
        {
            await _businessService.Delete(id);

            return(new OkObjectResult(true));
        }
Beispiel #9
0
        public async override Task Compensate(SagaContext <string> context)
        {
            var b = await service.GetByUser(context.Data.User);

            await service.Delete(b);
        }
Beispiel #10
0
 public ActionResult Delete(string id)
 {
     _businessService.Delete(id);
     return(new OkObjectResult(true));
 }