Пример #1
0
        public IHttpActionResult VerifyAcknowlegement(Guid id, int count, string serialNo)
        {
            serialNo = serialNo.Trim().ToLower();

            Terminals terminal = TerminalServices.GetTerminalBySerial(serialNo);

            if (terminal == null)
            {
                return(Unauthorized());
            }

            TerminalsLog log = TerminalServices.GetTerminalLogByLogId(id);

            if (log == null)
            {
                return(BadRequest());
            }

            log.Ack           = true;
            log.RecievedCount = count;

            TerminalServices.UpdateTerminalLog(log);

            if (log.SentCount != count)
            {
                return(BadRequest());
            }

            return(Ok("Success"));
        }