private void btnUpdateWork_Click(object sender, RoutedEventArgs e) { object id_obj = ((Button)sender).CommandParameter; int id; int.TryParse(id_obj.ToString(), out id); WorkPerformanceController.getInstance().openUpdateWork(id).Show(); load(); }
private void btnSubmit_Click(object sender, RoutedEventArgs e) { if (txtDetail.Text == "") { MessageBox.Show("Invalid input!"); return; } WorkPerformanceController.getInstance().update(id, txtDetail.Text); MessageBox.Show("Success update the data!"); Close(); }
private dynamic getWorkList() { List <WorkPerformance> works = WorkPerformanceController.getInstance().getAll(); var works_status = works.Where(w => w.Status == "Active").ToList(); var works_filtered = works_status.Select(w => new { w.Id, w.EmployeeId, EmployeeName = w.Employee.Name, w.PerformanceDetail }); return(works_filtered); }
private void btnRemoveWork_Click(object sender, RoutedEventArgs e) { object id_obj = ((Button)sender).CommandParameter; int id; int.TryParse(id_obj.ToString(), out id); MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show("Are you sure?", "Delete Confirmation", System.Windows.MessageBoxButton.YesNo); if (messageBoxResult == MessageBoxResult.Yes) { WorkPerformanceController.getInstance().remove(id); MessageBox.Show("Success remove the data!"); load(); } }
private void btnSubmit_Click(object sender, RoutedEventArgs e) { if (txtDetail.Text == "") { MessageBox.Show("Invalid input!"); return; } if (WorkPerformanceController.getInstance().add(id, txtDetail.Text)) { MessageBox.Show("Success add work performance detail!"); return; } else { MessageBox.Show("You have already added this employee's work perfiormance!"); } Close(); }