-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdminEmoneyForm.cs
59 lines (51 loc) · 1.84 KB
/
AdminEmoneyForm.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
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;
using Telecommunication_Franchise_Management_System.BL;
using Telecommunication_Franchise_Management_System.DL;
namespace Telecommunication_Franchise_Management_System
{
public partial class AdminEmoneyForm : Form
{
public AdminEmoneyForm()
{
InitializeComponent();
}
private void AdminEmoneyForm_Load(object sender, EventArgs e)
{
AdminEmoneyGV.DataSource = WorkerDL.WorkersList;
AdminEmoneyGV.Columns["Password"].Visible = false;
AdminEmoneyGV.Columns["Role"].Visible = false;
AdminEmoneyGV.Columns["Balance"].Visible = false;
AdminEmoneyGV.Columns["requestedBalanceAmount"].Visible = false;
}
private void AdminEmoneyGV_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
Worker worker = (Worker)AdminEmoneyGV.CurrentRow.DataBoundItem;
if (AdminEmoneyGV.Columns["Approve"].Index == e.ColumnIndex)
{
worker.Emoney = worker.Emoney + worker.RequestedEmoneyAmount;
dataBind();
}
else if (AdminEmoneyGV.Columns["Change"].Index == e.ColumnIndex)
{
EmoneyAprovalAmountChangeForm myform = new EmoneyAprovalAmountChangeForm(worker);
myform.ShowDialog();
WorkerDL.storeAllDataIntoFile("Workers.txt");
dataBind();
}
}
public void dataBind()
{
AdminEmoneyGV.DataSource = null;
AdminEmoneyGV.DataSource = WorkerDL.WorkersList;
AdminEmoneyGV.Refresh();
}
}
}