-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForm12.Designer.cs
More file actions
326 lines (283 loc) · 12.7 KB
/
Copy pathForm12.Designer.cs
File metadata and controls
326 lines (283 loc) · 12.7 KB
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
using System.Drawing;
using System.Windows.Forms;
using System;
namespace H1
{
partial class Form12
{
private System.ComponentModel.IContainer components = null;
// Main controls
private Panel sidebarPanel;
private Panel headerPanel;
private Label headerLabel;
private Panel mainPanel;
// Form controls
private TextBox txtTitle;
private TextBox txtDescription;
private TextBox txtDestination;
private ComboBox cmbCategory;
private DateTimePicker dtpStartDate;
private DateTimePicker dtpEndDate;
private TextBox txtPrice;
private TextBox txtCapacity;
private ComboBox cmbDifficulty;
private Button btnCreateTrip;
private Button btnUpdateTrip;
private Button btnDeleteTrip;
private Button btnClearForm;
private DataGridView dgvTrips;
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1000, 600);
this.Text = "Trip Management";
this.BackColor = Color.White;
// Sidebar Panel
sidebarPanel = new Panel();
sidebarPanel.BackColor = navbarColor;
sidebarPanel.Dock = DockStyle.Left;
sidebarPanel.Width = 180;
this.Controls.Add(sidebarPanel);
// Sidebar Title
Label sidebarTitle = new Label();
sidebarTitle.Text = "Travel Explorer";
sidebarTitle.ForeColor = whiteColor;
sidebarTitle.Font = new Font("Segoe UI", 14, FontStyle.Bold);
sidebarTitle.Dock = DockStyle.Top;
sidebarTitle.Height = 50;
sidebarTitle.TextAlign = ContentAlignment.MiddleCenter;
sidebarPanel.Controls.Add(sidebarTitle);
// Menu Buttons
string[] menuItems = { "Registration", "Search & Booking", "Dashboard", "Digital Travel Pass", "Review", "Profile Management", "Trip Management" };
int buttonY = 60;
foreach (string item in menuItems)
{
Button menuButton = new Button();
menuButton.Text = item;
menuButton.FlatStyle = FlatStyle.Flat;
menuButton.FlatAppearance.BorderSize = 1;
menuButton.FlatAppearance.BorderColor = Color.White;
menuButton.BackColor = navbarColor;
menuButton.ForeColor = whiteColor;
menuButton.Font = new Font("Segoe UI", 10);
menuButton.Size = new Size(150, 40);
menuButton.Location = new Point(15, buttonY);
menuButton.TextAlign = ContentAlignment.MiddleCenter;
if (item == "Trip Management")
{
menuButton.BackColor = Color.FromArgb(64, 82, 100);
menuButton.FlatAppearance.BorderSize = 2;
}
sidebarPanel.Controls.Add(menuButton);
buttonY += 50;
}
// Header Panel
headerPanel = new Panel();
headerPanel.BackColor = headerColor;
headerPanel.Dock = DockStyle.Top;
headerPanel.Height = 70;
this.Controls.Add(headerPanel);
// Header Label
headerLabel = new Label();
headerLabel.Text = "Trip Creation & Management";
headerLabel.ForeColor = whiteColor;
headerLabel.Font = new Font("Segoe UI", 16, FontStyle.Regular);
headerLabel.Location = new Point(20, 20);
headerPanel.Controls.Add(headerLabel);
// Main Content Panel
mainPanel = new Panel();
mainPanel.Dock = DockStyle.Fill;
mainPanel.Padding = new Padding(20);
mainPanel.BackColor = lightGrayColor;
this.Controls.Add(mainPanel);
// Form Panel
Panel formPanel = new Panel();
formPanel.BackColor = whiteColor;
formPanel.BorderStyle = BorderStyle.FixedSingle;
formPanel.Size = new Size(400, 500);
formPanel.Location = new Point(20, 20);
mainPanel.Controls.Add(formPanel);
// Form Title
Label formTitle = new Label();
formTitle.Text = "Trip Details";
formTitle.Font = new Font("Segoe UI", 14, FontStyle.Bold);
formTitle.Location = new Point(20, 20);
formTitle.AutoSize = true;
formPanel.Controls.Add(formTitle);
// Form Controls
int labelY = 60;
int controlY = 60;
// int labelWidth = 100;
int controlWidth = 250;
// Title
Label lblTitle = new Label();
lblTitle.Text = "Title:";
lblTitle.Location = new Point(20, labelY);
lblTitle.AutoSize = true;
formPanel.Controls.Add(lblTitle);
txtTitle = new TextBox();
txtTitle.Location = new Point(130, controlY);
txtTitle.Size = new Size(controlWidth, 25);
formPanel.Controls.Add(txtTitle);
labelY += 40; controlY += 40;
// Description
Label lblDescription = new Label();
lblDescription.Text = "Description:";
lblDescription.Location = new Point(20, labelY);
lblDescription.AutoSize = true;
formPanel.Controls.Add(lblDescription);
txtDescription = new TextBox();
txtDescription.Multiline = true;
txtDescription.Location = new Point(130, controlY);
txtDescription.Size = new Size(controlWidth, 60);
formPanel.Controls.Add(txtDescription);
labelY += 80; controlY += 80;
// Destination
Label lblDestination = new Label();
lblDestination.Text = "Destination:";
lblDestination.Location = new Point(20, labelY);
lblDestination.AutoSize = true;
formPanel.Controls.Add(lblDestination);
txtDestination = new TextBox();
txtDestination.Location = new Point(130, controlY);
txtDestination.Size = new Size(controlWidth, 25);
formPanel.Controls.Add(txtDestination);
labelY += 40; controlY += 40;
// Category
Label lblCategory = new Label();
lblCategory.Text = "Category:";
lblCategory.Location = new Point(20, labelY);
lblCategory.AutoSize = true;
formPanel.Controls.Add(lblCategory);
cmbCategory = new ComboBox();
cmbCategory.Location = new Point(130, controlY);
cmbCategory.Size = new Size(controlWidth, 25);
cmbCategory.DropDownStyle = ComboBoxStyle.DropDownList;
formPanel.Controls.Add(cmbCategory);
labelY += 40; controlY += 40;
// Start Date
Label lblStartDate = new Label();
lblStartDate.Text = "Start Date:";
lblStartDate.Location = new Point(20, labelY);
lblStartDate.AutoSize = true;
formPanel.Controls.Add(lblStartDate);
dtpStartDate = new DateTimePicker();
dtpStartDate.Location = new Point(130, controlY);
dtpStartDate.Size = new Size(controlWidth, 25);
formPanel.Controls.Add(dtpStartDate);
labelY += 40; controlY += 40;
// End Date
Label lblEndDate = new Label();
lblEndDate.Text = "End Date:";
lblEndDate.Location = new Point(20, labelY);
lblEndDate.AutoSize = true;
formPanel.Controls.Add(lblEndDate);
dtpEndDate = new DateTimePicker();
dtpEndDate.Location = new Point(130, controlY);
dtpEndDate.Size = new Size(controlWidth, 25);
formPanel.Controls.Add(dtpEndDate);
labelY += 40; controlY += 40;
// Price
Label lblPrice = new Label();
lblPrice.Text = "Price (USD):";
lblPrice.Location = new Point(20, labelY);
lblPrice.AutoSize = true;
formPanel.Controls.Add(lblPrice);
txtPrice = new TextBox();
txtPrice.Location = new Point(130, controlY);
txtPrice.Size = new Size(controlWidth, 25);
formPanel.Controls.Add(txtPrice);
labelY += 40; controlY += 40;
// Capacity
Label lblCapacity = new Label();
lblCapacity.Text = "Capacity:";
lblCapacity.Location = new Point(20, labelY);
lblCapacity.AutoSize = true;
formPanel.Controls.Add(lblCapacity);
txtCapacity = new TextBox();
txtCapacity.Location = new Point(130, controlY);
txtCapacity.Size = new Size(controlWidth, 25);
formPanel.Controls.Add(txtCapacity);
labelY += 40; controlY += 40;
// Difficulty
Label lblDifficulty = new Label();
lblDifficulty.Text = "Difficulty:";
lblDifficulty.Location = new Point(20, labelY);
lblDifficulty.AutoSize = true;
formPanel.Controls.Add(lblDifficulty);
cmbDifficulty = new ComboBox();
cmbDifficulty.Location = new Point(130, controlY);
cmbDifficulty.Size = new Size(controlWidth, 25);
cmbDifficulty.Items.AddRange(new string[] { "Easy", "Medium", "Hard" });
cmbDifficulty.DropDownStyle = ComboBoxStyle.DropDownList;
cmbDifficulty.SelectedIndex = 0;
formPanel.Controls.Add(cmbDifficulty);
labelY += 40; controlY += 40;
// Buttons
btnCreateTrip = new Button();
btnCreateTrip.Text = "Create Trip";
btnCreateTrip.BackColor = headerColor;
btnCreateTrip.ForeColor = whiteColor;
btnCreateTrip.FlatStyle = FlatStyle.Flat;
btnCreateTrip.Size = new Size(120, 35);
btnCreateTrip.Location = new Point(20, controlY);
btnCreateTrip.Click += new EventHandler(btnCreateTrip_Click);
formPanel.Controls.Add(btnCreateTrip);
btnUpdateTrip = new Button();
btnUpdateTrip.Text = "Update Trip";
btnUpdateTrip.BackColor = Color.FromArgb(241, 196, 15);
btnUpdateTrip.ForeColor = Color.Black;
btnUpdateTrip.FlatStyle = FlatStyle.Flat;
btnUpdateTrip.Size = new Size(120, 35);
btnUpdateTrip.Location = new Point(150, controlY);
btnUpdateTrip.Enabled = false;
btnUpdateTrip.Click += new EventHandler(btnUpdateTrip_Click);
formPanel.Controls.Add(btnUpdateTrip);
btnDeleteTrip = new Button();
btnDeleteTrip.Text = "Delete Trip";
btnDeleteTrip.BackColor = Color.FromArgb(231, 76, 60);
btnDeleteTrip.ForeColor = whiteColor;
btnDeleteTrip.FlatStyle = FlatStyle.Flat;
btnDeleteTrip.Size = new Size(120, 35);
btnDeleteTrip.Location = new Point(280, controlY);
btnDeleteTrip.Enabled = false;
btnDeleteTrip.Click += new EventHandler(btnDeleteTrip_Click);
formPanel.Controls.Add(btnDeleteTrip);
controlY += 50;
btnClearForm = new Button();
btnClearForm.Text = "Clear Form";
btnClearForm.BackColor = Color.FromArgb(149, 165, 166);
btnClearForm.ForeColor = whiteColor;
btnClearForm.FlatStyle = FlatStyle.Flat;
btnClearForm.Size = new Size(120, 35);
btnClearForm.Location = new Point(150, controlY);
btnClearForm.Click += new EventHandler(btnClearForm_Click);
formPanel.Controls.Add(btnClearForm);
// Trips Grid
Label lblTrips = new Label();
lblTrips.Text = "Existing Trips";
lblTrips.Font = new Font("Segoe UI", 14, FontStyle.Bold);
lblTrips.Location = new Point(440, 20);
lblTrips.AutoSize = true;
mainPanel.Controls.Add(lblTrips);
dgvTrips = new DataGridView();
dgvTrips.Location = new Point(440, 50);
dgvTrips.Size = new Size(520, 470);
dgvTrips.BackgroundColor = whiteColor;
dgvTrips.BorderStyle = BorderStyle.None;
dgvTrips.SelectionChanged += new EventHandler(dgvTrips_SelectionChanged);
mainPanel.Controls.Add(dgvTrips);
// Bring to front
mainPanel.BringToFront();
}
}
}