public ActionResult DeleteConfirmed(int id) { Machine machine = _MachineService.GetById(id); _MachineService.Delete(machine); return(RedirectToAction("Index")); }
private void btnDelete_Click(object sender, EventArgs e) { int id = Int32.Parse(dgvMachines.Rows[dgvMachines.CurrentCell.RowIndex].Cells[0].Value.ToString()); _machineService.Delete(id); dgvMachines.DataSource = _machineService.GetAll(); tbIp.Text = ""; tbMachineName.Text = ""; tbCategory.Text = ""; MessageBox.Show("Kayıt Silindi"); }
public async Task <IActionResult> DeleteMachine(int id) { try { var result = await _service.Delete(id).ConfigureAwait(false); return(Ok(result)); } catch (Exception e) { return(BadRequest(e.Message)); } }
public IActionResult Delete(string id) { if (id == null) { return(BadRequest()); } bool machine = machineService.Delete(id); if (machine == false) { return(NotFound()); } return(Ok()); }
public ActionResult Delete(MachineViewModel viewModel) { if (ModelState.IsValid) { var result = _machineService.Delete(viewModel.MachineId); if (result.Success) { var message = "Machine Name :" + viewModel.Name + "<br/>Machine Serial No :" + viewModel.SerialNumber + "<br/> Machine deleted successsfully."; SendMailToAdmin(message); Success(result.Results.FirstOrDefault().Message); ModelState.Clear(); } else { _logger.Warn(result.Results.FirstOrDefault().Message); Warning(result.Results.FirstOrDefault().Message, true); } } return(RedirectToAction("Index")); }
public async Task Delete(int id, Machine value) { await _service.Delete(value); }
public IActionResult Delete(string id) { return(Ok(_machineService.Delete(id))); }