예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Machine machine = _MachineService.GetById(id);

            _MachineService.Delete(machine);
            return(RedirectToAction("Index"));
        }
예제 #2
0
        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");
        }
예제 #3
0
        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));
            }
        }
예제 #4
0
        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"));
 }
예제 #6
0
 public async Task Delete(int id, Machine value)
 {
     await _service.Delete(value);
 }
예제 #7
0
 public IActionResult Delete(string id)
 {
     return(Ok(_machineService.Delete(id)));
 }