Пример #1
0
        public ZeroResponse<string> SayHello(string name, int terminal)
        {
            var ret = new ZeroResponse<string>();
            using (var hlp = new ServiceLogHelper(System.Reflection.MethodBase.GetCurrentMethod().Name, "", name, terminal))
            {
                hlp.TerminalCode = terminal;
                hlp.Handle(() =>
                    {
                        using (var Config = new ZeroServerConfiguration())
                        {
                            if (Config.ValidateTerminal(terminal, name, out hlp.StatusMessage))
                            {
                                string ip = GetWCFMethodCallerIp();
                                ret.Result = Config.CreateConnection(terminal, ip);
                                Trace.WriteLine(string.Format("Iniciando Conexión con terminal {0} - ID {1} - ConnID {2} - IP: {3}", name, terminal, ret.Result, ip));
                            }
                        }
                    });

                ret.IsValid = hlp.IsValid;
                ret.Message = hlp.StatusMessage;
            }

            return ret;
        }
Пример #2
0
 public ZeroResponse<string> SayHello(string name, int terminal)
 {
     System.Diagnostics.Trace.WriteLine(string.Format("Name: {0}, Code: {1}",name,terminal), "SayHello");
     System.Diagnostics.Trace.Indent();
     ZeroResponse<string> ret = new ZeroResponse<string>();
     ZeroServerConfiguration Config = new ZeroServerConfiguration();
     string msg = "";
     ret.IsValid = Config.ValidateTerminal(terminal, name, out msg);
     if (ret.IsValid)
     {
         ret.Result = Config.CreateConnection(terminal);
         msg += " OK";
     }
     System.Diagnostics.Trace.Unindent();
     System.Diagnostics.Trace.WriteLine(string.Format("Name: {0}, Code: {1}, Message: {2}", name, terminal, ret), "SayHello");
     ret.Status = msg;
     return ret;
 }