private void btnClose_Click(object sender, EventArgs e) { Program.txnum = null; if (MaintainInfo.ModuleID == "02913") { MainProcess.LogoutFromSystem(true); } if (MaintainInfo.Report == CODES.MODMAINTAIN.REPORT.FILE) { if (!string.IsNullOrEmpty(filetempname)) { DeleteFile(filetempname); } using (var ctrlSA = new SAController()) { List <string> values = new List <string>(); //values.Add(Program.FileName); ctrlSA.ExecuteStoreProcedure("sp_delfile_all", values); CloseModule(); } } else { CloseModule(); } }
private void barButtonItem1_ItemClick(object sender, ItemClickEventArgs e) { if (frmConfirm.ShowConfirm( ((IMain)this).Language.LogoutTitle, ((IMain)this).Language.LogoutConfirm, this)) { barButtonItem1.Caption = ""; MainProcess.LogoutFromSystem(true); } }
protected override void OnFormClosing(FormClosingEventArgs e) { base.OnFormClosing(e); if (App.Environment.ClientInfo.SessionKey == null || frmConfirm.ShowConfirm(Language.ExitTitle, Language.ExitConfirm, this)) { MainProcess.LogoutFromSystem(false); e.Cancel = false; } else { e.Cancel = true; } }
private void ribbon_ItemClick(object sender, ItemClickEventArgs e) { if (e.Item.Name == CONSTANTS.MENU_NAME_LOGOUT) { if (frmConfirm.ShowConfirm( ((IMain)this).Language.LogoutTitle, ((IMain)this).Language.LogoutConfirm, this)) { barButtonItem1.Caption = ""; MainProcess.LogoutFromSystem(true); } } else { MainProcess.ExecuteMenu(e.Item.Name, e.Item.Tag as RibbonItemInfo); } }
protected override void DestroyHandle() { base.DestroyHandle(); MainProcess.LogoutFromSystem(false); }
public static void ShowError(string title, FaultException ex, Control owner) { if (ex.Code.Name == ERR_SYSTEM.ERR_SYSTEM_MODULE_SINGLE_INSTANCE.ToString()) { return; } if (App.Environment.ClientInfo.SessionKey != null) { if (int.Parse(ex.Code.Name) == ERR_SYSTEM.ERR_SYSTEM_SESSION_TERMINATED_BY_ADMIN || int.Parse(ex.Code.Name) == ERR_SYSTEM.ERR_SYSTEM_SESSION_NOT_EXISTS_OR_DUPLICATE || int.Parse(ex.Code.Name) == ERR_SYSTEM.ERR_SYSTEM_SESSION_TERMINATED_BY_SELF) { MainProcess.LogoutFromSystem(false); App.Environment.ClientInfo.UserName = null; App.Environment.ClientInfo.SessionKey = null; MainProcess.ShowLogin(); return; } } if (owner == null || owner.IsDisposed || owner.Disposing) { var frmMain = MainProcess.GetMainForm(); if (frmMain != null && !frmMain.IsDisposed && !frmMain.Disposing) { ShowError(title, ex, frmMain); } else { EventLog.WriteEntry( "IMSS.Client", string.Format("{0}\r\n{1}", ex.ToMessage(), ex.Reason), EventLogEntryType.Error); } return; } if (owner.InvokeRequired) { owner.Invoke(new ShowErrorInfoInvoker(ShowError), title, ex, owner); return; } if (!owner.InvokeRequired) { var frmDialog = new frmInfo { Text = title, lbErrorInfo = { Text = string.Format("<b>{0}</b>\r\n{1}", ex.ToMessage(), ex.Reason) } }; if (ex.Code.Name == "101") { try { File.AppendAllText("LastErrors.log", string.Format("{0}\r\n-------------\r\n", ex.Reason)); } catch { } } frmDialog.ShowDialog(owner); } }