private void frm_manager_home_Load(object sender, EventArgs e) { menuSettingByUserID(); lbl_user.Text = commonVar.login_name; menuControls.Add(menu_primarycode, emp); menuControls.Add(sub_empCode, emp); menuControls.Add(sub_deptCode, dept); menuControls.Add(sub_bizCode, biz); menuControls.Add(sub_duty, duty); menuControls.Add(sub_common, common); menuControls.Add(sub_machine, machine); menuControls.Add(sub_mold, mold); menuControls.Add(sub_product, product); menuControls.Add(sub_resinCode, resin); menuControls.Add(sub_errorCode, error); menuControls.Add(sub_defectiveProducts, defective); menuControls.Add(sub_nonOperation, nonOP); menuControls.Add(menu_system, permission); menuControls.Add(sub_permission, permission); menuControls.Add(sub_userSetting, subUserSetting); menuControls.Add(menu_manufacture, order); menuControls.Add(sub_workorder, order); menuControls.Add(sub_workperformance, perform); menuControls.Add(menu_conditionmanage, injection); menuControls.Add(sub_inejctCondition, injection); menuControls.Add(sub_errorBreak, errorState); menu_bar.ItemClick += new DevExpress.XtraEditors.TileItemClickEventHandler(menu_Click); sub_bar_primarycode.ItemClick += new DevExpress.XtraEditors.TileItemClickEventHandler(menu_Click); sub_bar_manufacture.ItemClick += new DevExpress.XtraEditors.TileItemClickEventHandler(menu_Click); sub_bar_system.ItemClick += new DevExpress.XtraEditors.TileItemClickEventHandler(menu_Click); sub_bar_state.ItemClick += new DevExpress.XtraEditors.TileItemClickEventHandler(menu_Click); menu_switch.ItemClick += (senderL, eL) => { frm_worker_main worker = new frm_worker_main(); Program.ac.MainForm = worker; worker.Show(); this.Close(); }; menu_logout.ItemClick += (senderL, eL) => { frm_login login = new frm_login(); Program.ac.MainForm = login; login.Show(); this.Close(); }; }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); #region AppInfo.xml 데이터 읽어오는 과정 string fileName = ""; string appVersion = ""; string appAddress = ""; fileName = Application.StartupPath + "\\AppInfo.xml"; XmlDocument xDoc = new XmlDocument(); try { xDoc.Load(fileName); XmlNodeList nodeList = xDoc.GetElementsByTagName("AppInfo"); appVersion = nodeList[0]["version"].InnerText; commonVar.version = appVersion; XmlNodeList nodeList2 = xDoc.GetElementsByTagName("ServerInfo"); appAddress = nodeList2[0]["addr"].InnerText; } catch { } #endregion try {//독립형 모델인지 확인 if (Settings.SettingHelper.IsStandAlone()) { //인증 정보확인 if (Settings.SettingHelper.ReadSetting("Authentication").ToLower().Equals("true") == false) { FormAuthentication_StandAlone f = new FormAuthentication_StandAlone(); f.ShowDialog(); if (f.Certified == false) { return; } } initializeSetting(); } else { if (Settings.SettingHelper.ReadSetting("Authentication").ToLower().Equals("true") == false) { FormAuthentication f = new FormAuthentication(); f.ShowDialog(); if (f.Certified == false) { return; } } string companyCode = Settings.SettingHelper.ReadSetting("CompanyCode"); Console.WriteLine("load : " + companyCode); initializeSetting(companyCode); } //로그 생성 경로 지정 string localFilePath = Settings.SettingHelper.ReadSetting("LocalFilePath"); commonVar.LocalFilePath = localFilePath.Length > 0 ? localFilePath : Application.StartupPath; LogWriter.FileBasePath = commonVar.LocalFilePath; frm_login login = new frm_login(); ac.MainForm = login; Application.Run(ac); } catch (Exception ex) { MessageBox.Show(ex.Message); } }