private void btnEntryPrtAdd_Click(object sender, EventArgs e) { if (this.prtInfoList.Count >= 0x63) { this.ShowModelessMessage("E548", null, null); } else { PrinterSettings settings = new PrinterSettings(); if (!settings.IsValid) { MessageDialog dialog = new MessageDialog(); dialog.ShowMessage("E607", ""); dialog.Close(); dialog.Dispose(); } else { PrinterTrayDlg dlg = null; try { dlg = new PrinterTrayDlg(); if (dlg.ShowDialog() == DialogResult.OK) { if (this.IsEntryPrinter(dlg.PrinterSettings.PrinterName)) { this.ShowModelessMessage("E549", null, null); } else { this.GetPrinterInfo(dlg.PrinterSettings); if (string.IsNullOrEmpty(this.txbDefaultPrinter.Text)) { this.txbDefaultPrinter.Text = dlg.PrinterSettings.PrinterName; this.txbDefaultBin.Text = dlg.PrinterSettings.DefaultPageSettings.PaperSource.SourceName; this.default_binno = dlg.PrinterSettings.DefaultPageSettings.PaperSource.RawKind; } this.tbpPrinter_Refresh(); } } } catch (Exception exception) { MessageDialog dialog2 = new MessageDialog(); dialog2.ShowMessage("E611", dlg.PrinterSettings.PrinterName, null, exception); dialog2.Close(); dialog2.Dispose(); } } } }
private void dgvAutoPrint_CellClick(DataGridView dgv) { PrinterSettings settings = new PrinterSettings(); if (!settings.IsValid) { MessageDialog dialog = new MessageDialog(); dialog.ShowMessage("E607", ""); dialog.Close(); dialog.Dispose(); } else { DataGridViewRow currentRow = dgv.CurrentRow; PrinterTrayDlg dlg = null; try { short num; dlg = new PrinterTrayDlg(); if (short.TryParse(currentRow.Cells[this.cAPCount.Index].Value.ToString(), out num)) { settings.Copies = num; } dlg.PrinterSettings = settings; if (dlg.ShowDialog() == DialogResult.OK) { if (this.IsEntryPrinter(dlg.PrinterSettings.PrinterName)) { currentRow.Cells[this.cAPPrinter.Index].Value = dlg.PrinterSettings.PrinterName; currentRow.Cells[this.cAPBinName.Index].Value = dlg.PrinterSettings.DefaultPageSettings.PaperSource.SourceName; currentRow.Cells[this.cAPBinNo.Index].Value = dlg.PrinterSettings.DefaultPageSettings.PaperSource.RawKind; if (dlg.PrinterSettings.Copies > 0x63) { currentRow.Cells[this.cAPCount.Index].Value = 0x63; } else { currentRow.Cells[this.cAPCount.Index].Value = dlg.PrinterSettings.Copies; } } else { this.ShowModelessMessage("E553", null, null); } } } catch (Exception exception) { MessageDialog dialog2 = new MessageDialog(); dialog2.ShowMessage("E611", dlg.PrinterSettings.PrinterName, null, exception); dialog2.Close(); dialog2.Dispose(); } } }
private void btnDefaultPrinter_Click(object sender, EventArgs e) { PrinterSettings settings = new PrinterSettings(); if (!settings.IsValid) { MessageDialog dialog = new MessageDialog(); dialog.ShowMessage("E607", ""); dialog.Close(); dialog.Dispose(); } else { PrinterTrayDlg dlg = null; try { dlg = new PrinterTrayDlg(); if (dlg.ShowDialog() == DialogResult.OK) { this.txbDefaultPrinter.Text = dlg.PrinterSettings.PrinterName; this.txbDefaultBin.Text = dlg.PrinterSettings.DefaultPageSettings.PaperSource.SourceName; this.default_binno = dlg.PrinterSettings.DefaultPageSettings.PaperSource.RawKind; if (!this.IsEntryPrinter(dlg.PrinterSettings.PrinterName)) { this.GetPrinterInfo(dlg.PrinterSettings); this.tbpPrinter_Refresh(); } } } catch (Exception exception) { MessageDialog dialog2 = new MessageDialog(); dialog2.ShowMessage("E611", dlg.PrinterSettings.PrinterName, null, exception); dialog2.Close(); dialog2.Dispose(); } } }
private void HtmlShow(string pathstr) { if (File.Exists(pathstr)) { Process.Start(pathstr); } else { MessageDialog dialog = new MessageDialog(); dialog.ShowMessage("W302", ""); dialog.Close(); dialog.Dispose(); } }
private void OnCancel(object sender, EventArgs e) { MessageDialog dialog = new MessageDialog { TopMost = true }; DialogResult result = dialog.ShowMessage("C404", ""); dialog.Close(); dialog.Dispose(); if ((result == DialogResult.Yes) && (this.RemoveProgress != null)) { this.BackWorker.CancelAsync(); } }
private void UserPathAuth() { UserPathNames names = UserPathNames.CreateInstance(); if (names.CommonPath.Specify) { try { string path = Path.Combine(names.CommonPath.Folder, Path.GetRandomFileName()); File.WriteAllText(path, Environment.UserName); File.Delete(path); } catch (Exception exception) { ULogClass.LogWrite(string.Format("{0} {1}", MessageKind.Error.ToString(), string.Format(Naccs.Core.Properties.Resources.ResourceManager.GetString("cnAuthMessage"), names.CommonPath.Folder, MessageDialog.CreateExceptionMessage(exception)))); MessageDialog dialog = new MessageDialog(); try { if (dialog.ShowMessage(ButtonPatern.YES_NO, MessageKind.Error, string.Format(Naccs.Core.Properties.Resources.ResourceManager.GetString("cnAuthMessage"), names.CommonPath.Folder, Naccs.Core.Properties.Resources.ResourceManager.GetString("cnAuthReply")), false, true, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { names.CommonPath.Specify = false; names.Save(); UserPathNames.ResetInstance(); PathInfo.ResetInstance(); ULogClass.LogWrite("=====< Common Settings Reset>====="); } else { ULogClass.LogWrite("=====< Common Settings Error >====="); Environment.Exit(0); } } finally { dialog.Close(); dialog.Dispose(); } } } }
private void DiskCheck() { DriveInfo info = new DriveInfo(Application.ExecutablePath); if (info.DriveType != DriveType.CDRom) { char ch = Application.StartupPath[0]; string driveName = ch.ToString().ToUpper(); if (('A' <= driveName[0]) && (driveName[0] <= 'Z')) { DriveInfo info2 = new DriveInfo(driveName); long num = (info2.TotalFreeSpace / 0x400L) / 0x400L; if (this.usrenv.TerminalInfo.DiskWarning > num) { MessageDialog dialog = new MessageDialog(); dialog.ShowMessage("W301", num.ToString(), ""); dialog.Close(); dialog.Dispose(); Environment.Exit(0); } } } }
private void mnACLCustomize_Click(object sender, EventArgs e) { try { if (File.Exists(Path.Combine(this.pi.CustomizeRoot, "CustomizeACL.exe"))) { Process.Start(Path.Combine(this.pi.CustomizeRoot, "CustomizeACL.exe"), ((int) this.sysenv.TerminalInfo.Protocol).ToString()); } else { MessageDialog dialog = new MessageDialog(); dialog.ShowMessage("E701", ""); dialog.Close(); dialog.Dispose(); } } catch (Exception exception) { MessageDialog dialog2 = new MessageDialog(); dialog2.ShowMessage("E701", "", null, exception); dialog2.Close(); dialog2.Dispose(); } }
private void mnFileOpen_Click(object sender, EventArgs e) { this.ofdMain.Multiselect = false; this.ofdMain.InitialDirectory = this.GetInitialDirectory(); if (this.ofdMain.ShowDialog() == DialogResult.OK) { IData data = null; try { data = DataFactory.LoadFromEdiFile(this.ofdMain.FileName); } catch (Exception exception) { MessageDialog dialog = new MessageDialog(); dialog.ShowMessage("E302", this.ofdMain.FileName, null, exception); dialog.Close(); dialog.Dispose(); return; } if (!(data.JobCode.Trim() == "")) { if (!this.SearchDispCode(data)) { UJobInputDlg dlg = new UJobInputDlg(); dlg.SetCodeSelect(data.JobCode.Trim()); if (dlg.ShowDialog() != DialogResult.OK) { dlg.Close(); dlg.Dispose(); return; } data.Header.DispCode = dlg.DispCode; dlg.Close(); dlg.Dispose(); } this.JobFormOpen(data); } else { this.JobError(-1); } } }
private void MainBase_FormClosing(object sender, FormClosingEventArgs e) { this.bMailActionFlag = true; if (!this.VersionUpFlag && (this.idv.GetCount(3) > 0)) { MessageDialog dialog = new MessageDialog(); DialogResult result = dialog.ShowMessage("C403", ""); if (result == DialogResult.Yes) { this.idv.ClearDelete(); } else if (result != DialogResult.No) { e.Cancel = true; dialog.Dispose(); this.bMailActionFlag = false; return; } dialog.Dispose(); } try { this.DisposingFlag = true; if (this.DsArrangeManager != null) { this.DsArrangeManager.Dispose(); } this.BackupFileDelete(); this.SaveUserApplication(); this.usr.Save(); this.msgc.Save(); this.idv.DataViewListSave(""); } catch (Exception exception) { MessageDialog dialog2 = new MessageDialog(); dialog2.ShowMessage("E304", Naccs.Core.Properties.Resources.ResourceManager.GetString("CORE106"), null, exception); dialog2.Close(); dialog2.Dispose(); } ULogClass.LogWrite("=====< Log End >====="); }
private void MainBase_Load(object sender, EventArgs e) { if (!this.isDesigning) { this.DiskCheck(); this.DataInfoCnt = 0; this.usr = User.CreateInstance(); this.HJobList = this.usr.HistoryJobsList; this.HUserList = this.usr.HistoryUserList; this.HMailBoxList = this.usr.HistoryAddressList; this.usr_apc = this.usr.Application; this.usr_tlb = this.usr.ToolBar; this.usr_wnd = this.usr.Window; this.usr_cwc = this.usr.ColumnWidth; this.usr_dvf = this.usr.DataViewForm; this.usr_jpc = this.usr.JobOption; this.usrenv = UserEnvironment.CreateInstance(); this.OptionSet(true); this.idv.RecvFolderSelect(); this.FldList = this.msgc.Folders; if (this.idv.GetCount(4, this.usrenv.TerminalInfo.SaveTerm) > 0) { MessageDialog dialog = new MessageDialog { TopMost = true }; if (dialog.ShowMessage("C402", this.usrenv.TerminalInfo.SaveTerm.ToString(), "") == DialogResult.Yes) { this.idv.SaveDateDataDelete(this.usrenv.TerminalInfo.SaveTerm); } dialog.Close(); dialog.Dispose(); this.uopd.Show(); Application.DoEvents(); } this.uJobInput1.HistoryJobListSet(this.HJobList); this.uJobMenu1.HistoryJobListSet(this.HJobList); this.dscl = new DispCodeList(); this.LoadUserApplication(); this.mnJobKey.Visible = false; int userKind = this.sysenv.TerminalInfo.UserKind; if ((this.sysenv.TerminalInfo.UserKind != 4) && !this.sysenv.TerminalInfo.Receiver) { this.DsArrangeManager = new ArrangeManager(this, this.idv); this.DsArrangeManager.AppendArrangeMenu(this.mnOption); this.DsArrangeManager.AutoRun(); } this.tbbJetras.Visible = this.sysenv.TerminalInfo.Jetras; this.tbbJSplitter5.Visible = this.sysenv.TerminalInfo.Jetras; this.DisposingFlag = false; this.swtbl = new SWCheckTbl(); ULogClass.LogWrite("=====< Log Start >====="); this.StatusChange(0); this.UpdateMenuItems(); this.uopd.Close(); this.uopd.Dispose(); } }
private void mnGuidance_Click(object sender, EventArgs e) { string jobcode = ""; string str2 = ""; string path = ""; PathInfo info = PathInfo.CreateInstance(); DivideConfig config = null; NormalConfig jobConfig = null; CombiConfig config3 = null; if (this.JobConfig.jobStyle == JobStyle.normal) { jobConfig = (NormalConfig) this.JobConfig; if (jobConfig.record.jobcode != null) { jobcode = jobConfig.record.jobcode; } if ((jobConfig.record.dispcode != null) && (jobConfig.record.dispcode != "")) { str2 = "." + jobConfig.record.dispcode; } } else if (this.JobConfig.jobStyle == JobStyle.divide) { config = (DivideConfig) this.JobConfig; if (config.record.jobcode != null) { jobcode = config.record.jobcode; } if ((config.record.dispcode != null) && (config.record.dispcode != "")) { str2 = "." + config.record.dispcode; } } else { config3 = (CombiConfig) this.JobConfig; if (config3.jobcode != null) { jobcode = config3.jobcode; } if ((config3.dispcode != null) && (config3.dispcode != "")) { str2 = "." + config3.dispcode; } } path = info.GuidanceRoot + jobcode + str2 + "_guidance.htm"; if (File.Exists(path)) { Process.Start(path); } else { MessageDialog dialog = new MessageDialog(); dialog.ShowMessage("W302", ""); dialog.Close(); dialog.Dispose(); } }
private void mnDelete_Click(object sender, EventArgs e) { if (((this.dlYear != "") && (this.dlMonth != "")) && ((this.dlYear == this.cmbYear.Text) && (this.dlMonth == this.cmbMonth.Text))) { this.pastDataView_YYYYMM = this.cmbYear.Text + this.cmbMonth.Text; string path = Path.Combine(this.pastDataViewPath, this.pastDataView_YYYYMM); if (Directory.Exists(path)) { MessageDialog dialog = new MessageDialog(); DialogResult result = dialog.ShowMessage("C405", this.pastDataView_YYYYMM, ""); dialog.Close(); if (result == DialogResult.Yes) { if (ArrangeDataTable.IsLock(this.pastDataView_YYYYMM)) { string message = Resources.ResourceManager.GetString("CORE23"); using (MessageDialogSimpleForm form = new MessageDialogSimpleForm()) { form.ShowMessage(ButtonPatern.OK_ONLY, MessageKind.Error, message); } Environment.Exit(0); } Directory.Delete(path, true); this.RevertDialog_Load(sender, e); } } } }
public override void mnBatchSend_Click(object sender, EventArgs e) { this.cancelflag = false; bool flg = true; if (base.idv.sExistenceCheck()) { MessageDialog dialog = new MessageDialog(); if (dialog.ShowMessage("I105", "") == DialogResult.Yes) { this.SendAllCount = base.idv.GetCount(1); flg = true; } else { this.SendAllCount = base.idv.GetCount(5); flg = false; } } else { this.SendAllCount = base.idv.GetCount(1); flg = true; } if (this.SendAllCount < 1) { MessageDialog dialog2 = new MessageDialog(); dialog2.ShowMessage("W401", ""); dialog2.Close(); dialog2.Dispose(); } else { this.bSendFlag = true; this.SendCount = 0; this.BatchSend(flg); } }
public void SetUserClass(bool DebugFlag, bool ReloadFlag) { this.usr = User.CreateInstance(); this.usrenv = UserEnvironment.CreateInstance(); this.HSearchList = this.usr.HistorySearchList; this.SearchListSet(); this.cmbSearchDiv.SelectedIndex = 0; this.msgc = MessageClassify.CreateInstance(); this.trmlist = this.msgc.TermList; this.FldList = this.msgc.Folders; this.FolderSet(); this.DBFixAdd(); this.pi = PathInfo.CreateInstance(); if (ReloadFlag) { string path = this.pi.DataViewPath + "Data.xml"; string str2 = ""; if (File.Exists(path)) { str2 = File.GetLastWriteTime(path).ToString("yyyy/MM/dd HH:mm:ss", DateTimeFormatInfo.InvariantInfo); } string upTime = this.msgc.DataView.upTime; bool flag = (upTime == null) || (str2.CompareTo(upTime) > 0); bool flag2 = true; if (!flag) { if (DebugFlag) { DialogResult result; using (MessageDialog dialog = new MessageDialog()) { result = dialog.ShowMessage("W403", null, null); } if (result == DialogResult.No) { flag2 = false; } } else { using (MessageDialog dialog2 = new MessageDialog()) { dialog2.ShowMessage("W404", null, null); } } } try { this.msgc.DataView.upTime = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss", DateTimeFormatInfo.InvariantInfo); this.msgc.Save(); } catch (Exception exception) { MessageDialog dialog3 = new MessageDialog(); dialog3.ShowMessage("E304", Resources.ResourceManager.GetString("CORE106"), null, exception); dialog3.Close(); dialog3.Dispose(); } if (flag || (!flag && !flag2)) { TreeNode selectedNode = this.tvSendRecvFolder.SelectedNode; this.tvSendRecvFolder.SelectedNode = this.tvSendRecvFolder.Nodes[0]; this.dtsDataView.Clear(); if (str2 != "") { try { this.dtsDataView.Tables[0].BeginLoadData(); try { this.dtsDataView.ReadXml(path); } finally { this.dtsDataView.Tables[0].EndLoadData(); } this.MaxID = this.GetID(); } catch (Exception exception2) { MessageDialog dialog4 = new MessageDialog(); dialog4.ShowMessage("E403", path, null, exception2); dialog4.Dispose(); this.ViewRepair(true); } } this.tvSendRecvFolder.SelectedNode = selectedNode; } else { this.ViewRepair(true); } } this.fs = FileSave.CreateInstance(); UserKeySet set = new UserKeySet(); set.ShortCutSet(this.rmnDataView.Items); set.ShortCutSet(this.rmnSendRecvFolder.Items); }
private static void Main(string[] args) { Thread.CurrentThread.CurrentCulture = new CultureInfo("vi-VN", false); Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture; Mutex mutex = null; Mutex mutex2 = null; try { bool proxyError = false; if (args.Length == 1) { proxyError = bool.Parse(args[0]); } OperatingSystem oSVersion = Environment.OSVersion; if ((oSVersion.Platform == PlatformID.Win32NT) && (oSVersion.Version.Major >= 5)) { mutex = new Mutex(false, @"Global\" + appName); mutex2 = new Mutex(false, @"Global\" + verName); } else { mutex = new Mutex(false, appName); mutex2 = new Mutex(false, verName); } ProcKeys nONE = ProcKeys.NONE; if (!mutex.WaitOne(300, false)) { nONE = ProcKeys.APP; } if (!mutex2.WaitOne(300, false)) { if (nONE == ProcKeys.LAUNCHER) { nONE = ProcKeys.WITH; } else { nONE = ProcKeys.LAUNCHER; } } if ((nONE != ProcKeys.LAUNCHER) && (nONE != ProcKeys.WITH)) { mutex2.ReleaseMutex(); mutex2.Close(); } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); NaccsWMMain mainForm = null; if (proxyError) { mainForm = new NaccsWMMain(proxyError); } else { mainForm = new NaccsWMMain(); } if (nONE == ProcKeys.NONE) { Application.Run(mainForm); mutex.ReleaseMutex(); } else { MessageDialog dialog = new MessageDialog(); dialog.ShowMessage("E001", "", ""); dialog.Close(); dialog.Dispose(); } } finally { if (mutex != null) { mutex.Close(); } if (mutex2 != null) { mutex2.Close(); } } }