private void DeleteButton_Click(object sender, RoutedEventArgs e) { if (workerListView.SelectedItem == null) { MessageBox.Show("errror"); return; } Items it = (Items)workerListView.SelectedItem; workerRepositoty.Delete(it.wrk); workerRepositoty.DeleteFromCache(it.wrk.ID); IEnumerable <Worker> workers; workers = workerRepositoty.GetListFromCache(); foreach (Worker wr in workers) { DateTime d2 = contractRepositoty.Get(p => p.WorkerId == wr.ID).Last().EndDate; TimeSpan d3 = d2 - DateTime.Now; workerListView.Items.Add(new Items { wrk = wr, dep = departamentRepositoty.GetByIdFromCahce(wr.DepartamentID), date = d3 }); } workerListView.Items.Refresh(); }
public async Task <WorkerDTO> DeleteAsync(long Id) { Worker result = await _workerRepository.Delete(Id); var worker = _mapper.Map <Worker, WorkerDTO>(result); return(worker); }
private void DeleteWorkerButton_Click(object sender, RoutedEventArgs e) { MessageBoxResult dialogResult = MessageBox.Show($"Ви точно хочете видалити {(WorkersDataGrid.SelectedItem as Worker).FullName}?", "Видалити працівника", MessageBoxButton.YesNo); if (dialogResult == MessageBoxResult.Yes) { _workerRepository.Delete((WorkersDataGrid.SelectedItem as Worker).WorkerId); UpdateData(); } }
public string DeleteWorker(int id) { _workerRepository.Delete(id); return($"Worker with id {id} was succesfuly deleted"); }
public IActionResult Delete(string alias) { //megkapjuk a törlendő dolgozó aliasát repo.Delete(alias); return(RedirectToAction("Index")); }
public void Delete(int id) { _repository.Delete(id); }
public void Delete(int id) { _workerRepository.Delete(id); }