-
Notifications
You must be signed in to change notification settings - Fork 0
/
DeleteContributor.xaml.cs
56 lines (50 loc) · 1.61 KB
/
DeleteContributor.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace MobileApp
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class DeleteContributor : ContentPage
{
ContributorDataAccessClass dataAccess;
public int id;
public DeleteContributor ()
{
InitializeComponent ();
//Accessing Contributor Data
dataAccess = new ContributorDataAccessClass();
this.BindingContext = dataAccess;
}
async void Home_Clicked(object sender, EventArgs e)
{
await Navigation.PushAsync(new MainPage());
}
async void ContributorViewOnClicked(object sender, EventArgs e)
{
await Navigation.PushAsync(new ContributorList());
}
async void RaisersViewOnClicked(object sender, EventArgs e)
{
await Navigation.PushAsync(new IssueRaisers());
}
//Delete button to delete a contributor.
public void Delete_Clicked(object sender, EventArgs e)
{
ContributorModel Contributors = (ContributorModel)(((BindableObject)sender).BindingContext);
if (id != 0)
{
Console.WriteLine("Delete data: ");
dataAccess.DeleteContributor(Contributors);
dataAccess.DeleteContributor();
}
else
{
dataAccess.DeleteContributor(Contributors);
}
}
}
}