53 lines
1.9 KiB
C#
53 lines
1.9 KiB
C#
using CoreUnit.Common;
|
|
using DB;
|
|
using System;
|
|
using System.Reflection;
|
|
using System.Threading;
|
|
using System.Windows.Forms;
|
|
|
|
namespace GUI
|
|
{
|
|
public static class Program
|
|
{
|
|
/// <summary>
|
|
/// 해당 응용 프로그램의 주 진입점입니다.
|
|
/// </summary>
|
|
[STAThread]
|
|
static void Main()
|
|
{
|
|
bool createdNew;
|
|
Mutex dup = new Mutex(true, "MutexName", out createdNew);
|
|
|
|
if (createdNew) {
|
|
Application.EnableVisualStyles();
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
|
|
try {
|
|
|
|
//1. 데이터 베이스 초기화
|
|
dao = new Dao();
|
|
dao.Initialize();
|
|
|
|
UtilUnit.logUnit.SetLog(LogUnit.eLogType.SYSTEM, MethodBase.GetCurrentMethod().Name, "Data Base Initialize Complete", LogUnit.eLogLevel.HIGH);
|
|
|
|
//4-2. 에러 발생하지 않을 경우 초기화 다이얼로그 닫고 메인 프로그램 실행
|
|
mainPage = new MainPage();
|
|
Application.Run(mainPage);
|
|
} catch (Exception e) {
|
|
MessageBox.Show(string.Format("System Error Occur. Closing LASA System.: Error Message\r\n[Message]:{0}\r\n[StackTrace]:{1}", e.Message, e.StackTrace), "Program Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
} finally {
|
|
dup.ReleaseMutex();
|
|
}
|
|
} else {
|
|
MessageBox.Show("현재 프로그램이 실행하고 있습니다. 프로그램 종료 후 재 실행하세요", "실행에러", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
}
|
|
}
|
|
|
|
#region SEQUENCE & DATABASE & GUI 객체 생성 및 선언
|
|
public static Dao dao;
|
|
public static MainPage mainPage;
|
|
|
|
#endregion
|
|
}
|
|
}
|