Permalink
Browse files

waiting to fuck up so making a commit to cover my ass

  • Loading branch information...
Slatery committed Oct 12, 2017
1 parent 6288f88 commit 4ddfa55831682918a240b2f6e28365e259781de1
Showing with 35 additions and 1 deletion.
  1. +35 −1 Start-Finance-master/InstaRichie/Views/AppointmentsPage.xaml.cs
@@ -57,13 +57,47 @@ private void AppBarButton_Click(object sender, RoutedEventArgs e)
}
private void DeleteItem_Click(object sender, RoutedEventArgs e)
private async void DeleteItem_Click(object sender, RoutedEventArgs e)
{
MessageDialog ShowConf = new MessageDialog("Deleting this Account will delete all transactions of this account", "Important");
ShowConf.Commands.Add(new UICommand("Yes, Delete")
{
Id = 0
});
ShowConf.Commands.Add(new UICommand("Cancel")
{
Id = 1
});
ShowConf.DefaultCommandIndex = 0;
ShowConf.CancelCommandIndex = 1;
var result = await ShowConf.ShowAsync();
if ((int)result.Id == 0)
{
// checks if data is null else inserts
try
{
string AccountsLabel = ((Accounts)TransactionList.SelectedItem).AccountName;
var querydel = conn.Query<Accounts>("DELETE FROM Accounts WHERE AccountName='" + AccountsLabel + "'");
Results();
conn.CreateTable<Transactions>();
var querytable = conn.Query<Transactions>("DELETE FROM Transactions WHERE Account='" + AccountsLabel + "'");
}
catch (NullReferenceException)
{
MessageDialog ClearDialog = new MessageDialog("Please select the item to Delete", "Oops..!");
await ClearDialog.ShowAsync();
}
}
else
{
//
}
}
private void AptStartTime_TimeChanged(object sender, TimePickerValueChangedEventArgs e)
{
AptEndTime.SetValue() = AptStartTime.GetValue;
//--TODO -- create method to auto add 15 mins from start to end time
}
}

0 comments on commit 4ddfa55

Please sign in to comment.