Ejemplo n.º 1
0
        public ZeroResponse<bool> SendClientTerminals(string ID, string terminals)
        {
            var ret = new ZeroResponse<bool>();

            using (var hlp = new ServiceLogHelper(System.Reflection.MethodBase.GetCurrentMethod().Name, ID, terminals))
            {
                hlp.Handle(() =>
                    {
                        using (var Config = new ZeroServerConfiguration())
                        {
                            if (Config.ValidateConnection(ID, out hlp.TerminalCode, out hlp.StatusMessage))
                            {
                                ret.Result = true;
                                Config.MergeTerminal(hlp.TerminalCode, ContextExtentions.GetEntitiesFromXMLObjectList<Terminal>(terminals));
                            }
                        }
                    });

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

            return ret;
        }
Ejemplo n.º 2
0
        public ZeroResponse<bool> SendClientTerminals(string ID, string terminals)
        {
            ZeroResponse<bool> ret = new ZeroResponse<bool>();
            ret.IsValid = true;
            using (ZeroServerConfiguration Config = new ZeroServerConfiguration())
            {
                string msg;
                int tCode = -1;
                if (Config.ValidateConnection(ID, out tCode, out msg))
                {
                    ret.Result = true;
                    Config.MergeTerminal(tCode, IEnumerableExtentions.GetEntitiesFromXMLObjectList<Terminal>(terminals));
                }

                ret.Result = false;
                ret.Status = msg;
            }

            return ret;
        }