-
Notifications
You must be signed in to change notification settings - Fork 0
/
RewardReviewer.cs
65 lines (57 loc) · 2.33 KB
/
RewardReviewer.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
57
58
59
60
61
62
63
64
65
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ChoreAssigner
{
public partial class RewardReviewer : Form
{
public RewardReviewer()
{
InitializeComponent();
}
private void RewardReviewer_Load(object sender, EventArgs e)
{
dGVSuggestedRewards.DataSource=EventListStorage.SubmittedRewards.MakeList();
dGVSuggestedRewards.Columns["Status"].Visible = false;
dGVApprovedReward.DataSource=EventListStorage.EligibleRewards.MakeList();
dGVApprovedReward.Columns["Status"].Visible = false;
}
private void btnSuggestRewardApproveSelected_Click(object sender, EventArgs e)
{
int index=dGVSuggestedRewards.CurrentRow.Index;
EventList.CopySingleElement(index,EventListStorage.SubmittedRewards,EventListStorage.EligibleRewards);
dGVApprovedReward.DataSource = EventListStorage.EligibleRewards.MakeList();
}
private void btnApproveAll_Click(object sender, EventArgs e)
{
EventList.MakeCopy(EventListStorage.SubmittedRewards, EventListStorage.EligibleRewards);
dGVApprovedReward.DataSource = EventListStorage.EligibleRewards.MakeList();
}
private void btnCloseWindow_Click(object sender, EventArgs e)
{
this.Close();
}
private void btnRemoveAllRewards_Click(object sender, EventArgs e)
{
EventListStorage.EligibleRewards.DeleteAll();
dGVApprovedReward.DataSource = EventListStorage.EligibleRewards.MakeList();
}
private void btnApprovedRewardsRemoveSelected_Click(object sender, EventArgs e)
{
int index = 0;
try
{
index = dGVApprovedReward.CurrentRow.Index;
}
catch (Exception ex) { }
EventListStorage.EligibleRewards.RemoveAnyWhere(index+1);//Plus 1 is necessary because displayed as a list but removing a linked list node
dGVApprovedReward.DataSource = EventListStorage.EligibleRewards.MakeList();
}
}
}