-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
50 lines (46 loc) · 1.67 KB
/
Program.cs
File metadata and controls
50 lines (46 loc) · 1.67 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using Pharmacy_Management_Sysytem.Services;
namespace Pharmacy_Management_Sysytem
{
/// <summary>
/// Main entry point for the Pharmacy Management System application
/// </summary>
internal static class Program
{
/// <summary>
/// Global service container for dependency injection
/// </summary>
public static IServiceContainer Services { get; private set; }
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
try
{
// Initialize service container
Services = new ServiceContainer();
// Test database connection
if (!Services.DatabaseConnection.TestConnection())
{
MessageBox.Show("Unable to connect to the database. Please check your connection settings.",
"Database Connection Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new signInForm());
}
catch (Exception ex)
{
MessageBox.Show($"Application startup error: {ex.Message}",
"Startup Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}