public async Task <IActionResult> Delete(Customer customer) { if (await _customersService.DeleteAsync(customer.Id)) { return(RedirectToAction("Index")); } return(View(customer.Id)); }
public async Task <ActionResult> Delete([Required] List <Guid> ids, CancellationToken ct = default) { var customers = await _customersService.GetListAsync(ids, ct); return(await ActionIfAllowed( () => _customersService.DeleteAsync(_userContext.UserId, customers.Select(x => x.Id), ct), Roles.Customers, customers.Select(x => x.AccountId))); }
public async Task <IActionResult> Delete(int id) { var customer = await _customersService.GetAsync(id); if (customer == null) { return(NotFound()); } if (!await _customersService.DeleteAsync(id)) { return(StatusCode(304)); } return(NoContent()); }
public async Task <IActionResult> Delete(int id) { try { var success = await _customersService.DeleteAsync(id); if (!success) { return(NotFound()); } return(Ok()); } catch (Exception ex) { return(NotFound(ex)); } }
public async Task <IHttpActionResult> delete([FromBody] CustomersVM entity) { var q1 = entryMasterService.getByCust(entity.ACC_ID); var q = billMasterService.getByCust(entity.ACC_ID); if (q.Count == 0 && q1.Count == 0) { var result = await customerService.DeleteAsync(entity); await LogData("&" + entity.ACC_ID + "&" + entity.CUST_CODE, entity.ACC_ID.ToString()); return(Ok(result)); } else { return(Ok(false)); } //return Ok(await customerService.DeleteAsync(entity)); }
public async Task DeleteAsync(int customerId) { await _customersService.DeleteAsync(customerId); }