コード例 #1
0
        public IHttpActionResult PostTerminalGeoLocation(TerminalGeoLocationViewModel geoLocation)
        {
            string serialNo = geoLocation.SerialNo.Trim().ToLower();

            Terminals terminal = TerminalServices.GetTerminalBySerial(serialNo);

            if (terminal == null)
            {
                return(Unauthorized());
            }
            else
            {
                geoLocation.TerminalId = terminal.TerminalId;
                geoLocation.TenantId   = terminal.TenantId;
            }

            int res = TerminalServices.SaveTerminalGeoLocation(geoLocation);

            if (res > 0)
            {
                return(Ok("Success"));
            }
            else
            {
                return(BadRequest("Unable to save records"));
            }
        }