private void DeleteEmployee_Click(object sender, RoutedEventArgs e) { VolunteerRepo emp = new VolunteerRepo(); emp.delete(((VolunteerCardViewModel)this.DataContext).volunteer); VolunteerDataStore.instance.data.Remove(((VolunteerCardViewModel)this.DataContext).volunteer); }
private void UpdateEmployeeClick(object sender, RoutedEventArgs e) { VolunteerRepo employeeRepo = new VolunteerRepo(); Volunteer employee = ((VolunteerCardViewModel)this.DataContext).volunteer; if (employeeGender.SelectedValue != null) { employee.gender = employeeGender.Text[0]; } if (nameTextBox.Text != null) { employee.name = nameTextBox.Text; } if (birthdayBox.SelectedDate != null) { employee.birthDate = birthdayBox.SelectedDate.Value.Date; } employee.mobile = mobileTextBox.Text; employee.email = emailTextBox.Text; employee.addressLine1 = line1TextBox.Text; employee.addressLine2 = line2TextBox.Text; employee.city = cityTextBox.Text; employee.governorate = governorateTextBox.Text; employee.branch = new Branch { id = int.Parse(EmployeeBranchComboBox.Text.ToString()) }; employeeRepo.update(employee); }
public IActionResult Login(Volunteer VM) { VolunteerRepo rep = new VolunteerRepo(new VolunteerSqlContext()); Volunteer Gebruiker = rep.GetGebruiker(VM.Username, VM.Password); //if ("@Username" != VM.Username || "@Password" != VM.Password) //{ // return View(); //} if (Gebruiker == null) { } //als gebruiker hier komt is alles goed return(RedirectToAction("Dashboard", "Volunteer")); }