-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUpdateClubsDescription.cs
80 lines (73 loc) · 2.65 KB
/
UpdateClubsDescription.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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 Clubs_Management_System
{
public partial class UpdateClubsDescription : Form
{
DashboardScreens DBScreen = new DashboardScreens();
Controller cntrl = new Controller();
public UpdateClubsDescription()
{
InitializeComponent();
}
private void UpdateClubsDescription_FormClosing(object sender, FormClosingEventArgs e)
{
DBScreen.UpdateClubDescChild = null;
}
private void UpdateClubsDescription_Load_1(object sender, EventArgs e)
{
this.WindowState = FormWindowState.Maximized;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.ControlBox = false;
txtClubDesc.ForeColor = Color.Silver;
txtDisabledClubName.Enabled = false;
cntrl.LoggedInSecClub(LoggedInUser.Username);
txtDisabledClubName.Text = LoggedInUser.ClubName;
}
private void txtClubDesc_Enter(object sender, EventArgs e)
{
if(txtClubDesc.Text == "Enter New Description")
{
txtClubDesc.Text = "";
txtClubDesc.ForeColor = Color.Black;
}
}
private void txtClubDesc_Leave(object sender, EventArgs e)
{
if (txtClubDesc.Text == "")
{
txtClubDesc.Text = "Enter New Description";
txtClubDesc.ForeColor = Color.Silver;
}
}
private void btnUpdateClubDesc_Click(object sender, EventArgs e)
{
if (string.IsNullOrWhiteSpace(txtClubDesc.Text) || txtClubDesc.Text == "Enter New Description")
{
MessageBox.Show("Please type a new club description", "Empty Field", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else
{
int status = 0;
status = cntrl.UpdateClubsDesc(LoggedInUser.Username, txtClubDesc.Text);
if (status > 0)
{
MessageBox.Show("Club's Description Updated", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show("Something went wrong, please try again!", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
}
}