private GridProteinFolding.Data.XMLData.Entity.Process CallPendencies()
        {
            GridProteinFolding.Data.XMLData.Entity.Process ret = Sql.SelectPend();
            if (ret != null)
            {
                previousSimulation = returnOfProcess = true;
            }
            else
            {
                previousSimulation = returnOfProcess = false;
            }

            return(ret);
        }
        private bool CallServer(GridProteinFolding.Data.XMLData.Entity.Process process)
        {
            bool retRun = false;

            try
            {
                ServiceParamWcf paramWCF;

                bool oneProcessPeerGuid = false;
                //Se não existir pendência no cliente
                if (process == null)
                {
                    paramWCF = ProxyServiceClient.GetOneProcess();
                }
                else
                {
                    paramWCF           = ProxyServiceClient.GetOneProcessGui(process.guid);
                    oneProcessPeerGuid = true;

                    //Implementar a mudança de STATUS - qdo ocorrer erro POS processamento = UPLOAD e etc
                    //variavel RET (estara dentro Run) tem q estar setada pra TRUE...senao dara ERRO 99...
                    //Proxy.SetStatus(paramWCF, BasicEnums.State.Upload);
                }

                if (paramWCF != null)
                {
                    ConsoleColor oldColour = Console.ForegroundColor;
                    GICO.ForegroundColor(ConsoleColor.Yellow);
                    DisplayMessage(string.Empty);
                    DisplayMessage(ExtendedString.Format("{0}> {1}", paramWCF.param.dataToProcess.Guid, Resource.Started));

                    GICO.ForegroundColor(oldColour);
                    if (oneProcessPeerGuid)
                    {
                        DisplayMessage(ExtendedString.Format("{0}> {1}", paramWCF.param.dataToProcess.Guid, Resource.GetOneProcess));
                    }
                    else
                    {
                        DisplayMessage(ExtendedString.Format("{0}> {1}", paramWCF.param.dataToProcess.Guid, Resource.GetOneProcessGui));
                    }

                    //Responde que esta sendo PROCESSADO
                    DisplayMessage(ExtendedString.Format("{0}> {1}", paramWCF.param.dataToProcess.Guid, Resource.Running));

                    retRun = Run(paramWCF);

                    DisplayMessage(ExtendedString.Format("{0}> {1}", paramWCF.param.dataToProcess.Guid, Resource.Finished));
                    DisplayMessage(string.Empty);
                }

                return(retRun);
            }
            catch (EndpointNotFoundException ex)
            {
                ConsoleColor oldColour = Console.ForegroundColor;
                GICO.ForegroundColor(ConsoleColor.Red);
                DisplayMessage(ex.Message);
                GICO.ForegroundColor(oldColour);

                new CustomLog().EndpointNotFoundException(ex);
            }

            return(false);
        }