-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHomeForm.cs
189 lines (166 loc) · 5.21 KB
/
HomeForm.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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using CallCenterProgram.Presentation;
namespace CallCenterProgram
{
public partial class HomeForm : Form
{
//classes
public static HomeForm instance;
//DLL stuff
public const int WM_NCLBUTTONDOWN = 0xA1;
public const int HT_CAPTION = 0x2;
[DllImportAttribute("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
[DllImportAttribute("user32.dll")]
public static extern bool ReleaseCapture();
//fields
private bool Maximized = false;
//constructor
public HomeForm()
{
InitializeComponent();
instance = this;
CreateMyBorderlessWindow();
Maximized = false;
}
//methods
private void showForm(Form form)
{
form.Show();
this.Hide();
}
public void CreateMyBorderlessWindow()
{
this.FormBorderStyle = FormBorderStyle.None;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.StartPosition = FormStartPosition.CenterScreen;
// Remove the control box so the form will only display client area.
this.ControlBox = false;
}
//form events
//call
private void btnCallForm_Click(object sender, EventArgs e)
{
callForm callForm = new callForm();
showForm(callForm);
}
//client
private void btnClientHome_Click(object sender, EventArgs e)
{
Client_Home clienthomeform = new Client_Home();
showForm(clienthomeform);
}
//contract
private void btnContract_Click(object sender, EventArgs e)
{
Contract frmContract = new Contract();
showForm(frmContract);
}
private void btnPackage_Click(object sender, EventArgs e)
{
Package frmPackage = new Package();
showForm(frmPackage);
}
private void btnSecurityLevel_Click(object sender, EventArgs e)
{
Security_Level form = new Security_Level();
showForm(form);
}
private void btnService_Click(object sender, EventArgs e)
{
Service form = new Service();
showForm(form);
}
//incident
private void btnIncident_Click(object sender, EventArgs e)
{
frmIncident form = new frmIncident();
showForm(form);
}
private void btnJob_Click(object sender, EventArgs e)
{
job form = new job();
showForm(form);
}
private void btnServiceRequest_Click(object sender, EventArgs e)
{
frmServiceRequest form = new frmServiceRequest();
showForm(form);
}
//follow up
private void btnFollowUp_Click(object sender, EventArgs e)
{
FollowUp_Presentation form = new FollowUp_Presentation();
showForm(form);
}
private void btnEmployeeForm_Click(object sender, EventArgs e)
{
Employee_Presentation form = new Employee_Presentation();
showForm(form);
}
private void btnManager_Click(object sender, EventArgs e)
{
Manager_Presentation form = new Manager_Presentation();
showForm(form);
}
private void btnFeedback_Click(object sender, EventArgs e)
{
Feedback form = new Feedback();
showForm(form);
}
private void btnTechnician_Click(object sender, EventArgs e)
{
Technician form = new Technician();
showForm(form);
}
private void pnlTitleBar_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
ReleaseCapture();
SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
}
}
//title Bar buttons
private void btnMaximizeToggle_Click(object sender, EventArgs e)
{
if (Maximized == false)
{
this.WindowState = FormWindowState.Maximized;
Maximized = true;
}
else
{
this.WindowState = FormWindowState.Normal;
Maximized = false;
}
}
private void btnExit_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void btnServiceLevel_Click(object sender, EventArgs e)
{
Service_Level service = new Service_Level();
this.Hide();
service.Show();
}
private void btnMinimize_Click(object sender, EventArgs e)
{
this.WindowState = FormWindowState.Minimized;
}
private void HomeForm_Load(object sender, EventArgs e)
{
}
}
}