Exemplo n.º 1
0
 private void ContractMainBtnNewContract_Click(object sender, RoutedEventArgs e)
 {
     Contract = new LokaVerkefniCL.Contract();
     ContractNew.DataContext = Contract;
     ContractNewComboBoxApartment.DataContext = ApartmentViewSource;
     ContractNewComboBoxTenant.DataContext    = TenantViewSource;
     ContractNewTxtEstimatedPrice.DataContext = ApartmentViewSource;
     ContractMain.Visibility = Visibility.Collapsed;
     ContractNew.Visibility  = Visibility.Visible;
 }
Exemplo n.º 2
0
        private void ContractMainBtnDeleteContract_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult result = MessageBox.Show("Ertu viss um að þú viljir eyða samningnum?", "Staðfesting", MessageBoxButton.YesNo);

            if (result == MessageBoxResult.No)
            {
            }
            else if (result == MessageBoxResult.Yes)
            {
                LokaVerkefniCL.Contract temp = (LokaVerkefniCL.Contract)ContractMainComboBoxApartment.SelectedItem;
                DContext.context.Contracts.Remove(temp);
                DContext.context.SaveChanges();
            }
        }
Exemplo n.º 3
0
 private void ContractMainBtnEditContract_Click(object sender, RoutedEventArgs e)
 {
     Contract = new LokaVerkefniCL.Contract((LokaVerkefniCL.Contract)ContractMainComboBoxApartment.SelectedItem);
     ContractMain.Visibility = Visibility.Collapsed;
     ContractEdit.Visibility = Visibility.Visible;
 }