private void HandleServerFaultException(ServerFaultException ex) { string message = null; if (!string.IsNullOrEmpty(ex.ErrorCode)) { message = string.Format("{0}\nError Code = {1}", ex.Message, ex.ErrorCode); } else { message = ex.Message; } MessageBox.Show(message, "IMI iWMS Thin Client", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1); }
private void HandleServerFaultException(ServerFaultException ex) { try { if (ex.Type == "Imi.Wms.Mobile.Server.Adapter.ApplicationTerminatedException" && ex.ErrorCode == "0") { _form.Invoke(new Action(() => { _form.Close(); })); } else { string message = null; if (!string.IsNullOrEmpty(ex.ErrorCode)) { message = string.Format("{0}\nError Code = {1}", ex.Message, ex.ErrorCode); } else { message = ex.Message; } _form.Invoke(new Action(() => { MessageBox.Show(message, "IMI iWMS Thin Client", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1); _form.Close(); })); } } finally { _config.LastSessionId = null; ConfigurationManager.SaveConfiguration(_config); } }