-
Notifications
You must be signed in to change notification settings - Fork 0
/
ModifyContributor.xaml.cs
55 lines (49 loc) · 1.65 KB
/
ModifyContributor.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
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 ModifyContributor : ContentPage
{
ContributorDataAccessClass dataAccess;
public ModifyContributor()
{
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());
}
//Update button to modify contributor details.
public void Update_Clicked(object sender, EventArgs e)
{
ContributorModel Contributors = (ContributorModel)(((BindableObject)sender).BindingContext);
if (Contributors == null || Contributors.Id < 1)
{
Console.WriteLine("Save data: ");
dataAccess.SaveContributor(Contributors);
dataAccess.AddNewContributor();
}
else
{
dataAccess.SaveContributor(Contributors);
}
}
}
}