-
Notifications
You must be signed in to change notification settings - Fork 0
/
Admin_Page.cs
174 lines (130 loc) · 4.82 KB
/
Admin_Page.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
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 System.Data.SqlClient;
namespace Movie_Ticketing_System
{
public partial class Admin_Page : Form
{
String ConnectionString = @"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\Ali Khattak\Documents\Visual Studio 2013\Projects\Movie Ticketing System\Movie Ticketing System\CinemaTicketing_DBS.mdf;Integrated Security=True";
public Admin_Page()
{
InitializeComponent();
DatedLabel.Text = "Dated: " + DateTime.Now.ToString("dd-MM-yyyy");
SqlConnection connection = new SqlConnection(ConnectionString);
connection.Open();
string query = "SELECT COUNT(*) from UserPage";
SqlCommand command = new SqlCommand(query, connection);
Int32 count = Convert.ToInt32(command.ExecuteScalar());
User_label.Text = count.ToString();
query = "SELECT COUNT(*) from Movies";
command = new SqlCommand(query, connection);
count = Convert.ToInt32(command.ExecuteScalar());
movies_label.Text = count.ToString();
query = "SELECT COUNT(*) from TicketBooking WHERE BillPayed='Yes'";
command = new SqlCommand(query, connection);
count = Convert.ToInt32(command.ExecuteScalar());
confirmedtickets.Text = count.ToString();
query = "SELECT ISNULL(SUM(TotalBill),0) from TicketBooking WHERE BillPayed='Yes'";
command = new SqlCommand(query, connection);
count = Convert.ToInt32(command.ExecuteScalar());
totalblace.Text = count.ToString();
connection.Close();
}
private void Edit_Movie_AP_Click(object sender, EventArgs e)
{
EditDetails_ID edit = new EditDetails_ID();
edit.Show();
this.Hide();
}
private void Add_Movie_AP_Click(object sender, EventArgs e)
{
Add_Movie_Admin add = new Add_Movie_Admin();
add.Show();
this.Hide();
}
private void Register_Users_AP_Click(object sender, EventArgs e)
{
Admin_Registered_users reg = new Admin_Registered_users();
reg.Show();
this.Hide();
}
private void Home_btn_UP_Click(object sender, EventArgs e)
{
Form1 from = new Form1();
from.Show();
this.Hide();
}
private void Back_btn_UP_Click(object sender, EventArgs e)
{
Admin_Login AL = new Admin_Login();
AL.Show();
this.Hide();
}
private void Manage_Movies_AP_Click(object sender, EventArgs e)
{
Admin_Manage_Movies admin_manage = new Admin_Manage_Movies();
admin_manage.Show();
this.Hide();
}
private void pictureBox6_Click(object sender, EventArgs e)
{
Form1 Home = new Form1();
Home.Show();
this.Hide();
}
private void pictureBox5_Click(object sender, EventArgs e)
{
string message = "Are You Sure You Want to Proceed?\nThis Action will Sign Out!";
string title = "Log Out";
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
DialogResult result = MessageBox.Show(message, title, buttons);
if (result == DialogResult.Yes)
{
Admin_Login login = new Admin_Login();
login.Show();
this.Hide();
}
else
{
}
}
private void pictureBox7_Click(object sender, EventArgs e)
{
string message = "Are You Sure You Want to Logout?";
string title = "Log Out";
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
DialogResult result = MessageBox.Show(message, title, buttons);
if (result == DialogResult.Yes)
{
Admin_Login login = new Admin_Login();
login.Show();
this.Hide();
}
else
{
}
}
private void panel1_Paint(object sender, PaintEventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
Admin_UpdatePricing Update = new Admin_UpdatePricing();
Update.Show();
this.Hide();
}
private void ManageTickets_Click(object sender, EventArgs e)
{
Admin_Manage_Tickets Admin = new Admin_Manage_Tickets();
Admin.Show();
this.Hide();
}
}
}