Example #1
0
        private static void CatchReturnServer(ServerDataTransfer sdt)
        {
            if(sdt.ContainsKey(IntegrationClient.DoIntegration) &&
                Unimake.Convert.ToBoolean(sdt[IntegrationClient.DoIntegration]))
            {
                ServerLog.Log(Settings.Server.IPAddress, TipoEvento.ClientOnError, sdt.Message);
            }
            else
            {
                switch(sdt.Status)
                {
                    case OpenPOS.Enuns.UniBot.Server.Status.Connected:
                        //Ok. Pode continuar sem erros
                        //por enquanto não existe nenhum tratamento
                        break;
                    case OpenPOS.Enuns.UniBot.Server.Status.Rejected:
                        MessageBox.Show("A conexão foi rejeitada pelo servidor.\r\n" + sdt.Message, MessageBoxIcon.Error);
                        return;
                    case OpenPOS.Enuns.UniBot.Server.Status.Error:
                        MessageBox.ShowError("O Servidor retornou um erro.\r\n\r\n" + sdt.Message);
                        return;
                    case OpenPOS.Enuns.UniBot.Server.Status.NotAuthorized:
                        MessageBox.Show("A conexão ao servidor não foi autorizada.\r\n" + sdt.Message, MessageBoxIcon.Stop);
                        return;
                    default:
                        MessageBox.ShowWarning("O Servidor retornou um estado desconhecido.\r\n" + sdt.Message);
                        return;
                }
            }

            return;
        }