示例#1
0
 private void RefreshUser()
 {
     if (selectedEvent != null)
     {
         ReaderViewModel rvm = new ReaderViewModel(rs.GetReader(selectedEvent.reader1).ID,
                                                   rs.GetReader(selectedEvent.reader1).name,
                                                   rs.GetReader(selectedEvent.reader1).surname);
         Task.Run(() => this.selectedReader = rvm);
     }
 }
示例#2
0
        // ObjectResult<Reader>
        public async Task <ObjectResult> Get(string Nickname)
        {
            _logger.LogInformation($"Get reader: {Nickname}");
            var response = await readerService.GetReader(Nickname);

            if (response == null)
            {
                _logger.LogInformation("Internal gateway error");
                return(StatusCode(500, "Internal error"));
            }

            if (response.Code != 200)
            {
                _logger.LogInformation("Can't get reader");
                return(StatusCode(response.Code, response.Message));
            }

            _logger.LogInformation("Succesfully get reader");
            return(Ok(response.Value));
        }
示例#3
0
        public void InsertUsers(Stream stream)
        {
            var reader           = _readerService.GetReader(stream);
            var connectionString = NitkaContext.CONNECTION_STRING;

            using (var loader = new System.Data.SqlClient.SqlBulkCopy(connectionString))
            {
                loader.DestinationTableName = "Users";
                loader.WriteToServer(reader);
            }
        }