public void CreateTpUser(string name, int id)
 {
     TpUsers.Add(new TpUserMappingInfo
     {
         Name = name, Id = id, Email = Guid.NewGuid() + "@mail.com", Login = Guid.NewGuid() + "_login"
     });
 }
예제 #2
0
        public async Task <IActionResult> PutTpUsers(Guid id, TpUsers tpUsers)
        {
            if (id != tpUsers.UsrId)
            {
                return(BadRequest());
            }

            _context.Entry(tpUsers).State = EntityState.Modified;

            try {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException) {
                if (!TpUsersExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public void CreateTpUserWithLogin(string login, string name, string mail)
        {
            var userLookup = new TpUserMappingInfo {
                Id = EntityId.Next(), Name = name, Login = login, Email = mail
            };

            TpUsers.Add(userLookup);
        }
예제 #4
0
        public void CreateTpUser(string userName, string userLogin, string email, int userId)
        {
            var userLookup = new TpUserMappingInfo {
                Id = EntityId.Next(), Name = userName, Login = userLogin, Email = email
            };

            TpUsers.Add(userLookup);
        }
        public void CreateTpUser(string userName, string userLogin, int userId)
        {
            var userLookup = new TpUserMappingInfo
            {
                Id = EntityId.Next(), Name = userName, Login = userLogin, Email = Guid.NewGuid() + "@mail.com"
            };

            TpUsers.Add(userLookup);
        }
        public void CreateTpUser(string name, string mail)
        {
            var userLookup = new TpUserMappingInfo
            {
                Id = EntityId.Next(), Name = name, Email = mail, Login = Guid.NewGuid() + "_login"
            };

            TpUsers.Add(userLookup);
        }
예제 #7
0
        public async Task <ActionResult <TpUsers> > PostTpUsers(TpUsers tpUsers)
        {
            _context.TpUsers.Add(tpUsers);
            await _context.Database.ExecuteSqlRawAsync("tpsrv_logon", new SqlParameter("@Login", "sa"), new SqlParameter("@Password", "tillypad"));

            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetTpUsers", new { id = tpUsers.UsrId }, tpUsers));
        }
예제 #8
0
        public TimeRecordExportViewModel()
        {
            ShowSettingsViewCommand = new RelayCommand(ShowSettingsView);
            _service = new TargetProcessService();
            _service.ConnectToTp(Settings.Default.TPAddress, Settings.Default.Login, Settings.Default.Password);

            TpUsers    = _service.GetAllUsers().ToList();
            AllTpUsers = TpUsers.GetRange(0, TpUsers.Count());
            Projects   = _service.GetAllProjects().ToList();
        }
 public void MapUser(string vcsuser, string tpuserName)
 {
     Profile.UserMapping.Add(new MappingElement
     {
         Key   = vcsuser,
         Value =
             new MappingLookup {
             Name = tpuserName, Id = TpUsers.Single(x => x.Name == tpuserName).Id
         }
     });
 }
        private ISagaMessage[] CreateRetrieveAllUsersQueryReply()
        {
            var users = TpUsers.Select(u => new UserDTO
            {
                ID        = u.Id,
                Login     = u.Login,
                FirstName = u.Name,
                LastName  = u.Name,
                IsActive  = true
            }).ToArray();


            if (!users.Any())
            {
                return(new[] { new UserQueryResult {
                                   Dtos = null, QueryResultCount = 0
                               } });
            }
            return(users.Select(
                       dto => new UserQueryResult {
                Dtos = new[] { dto }, QueryResultCount = users.Count()
            }).ToArray());
        }
 public TpUserMappingInfo GetTpUserByLogin(string userLogin)
 {
     return(TpUsers.FirstOrDefault(x => x.Login == userLogin));
 }
 public TpUserMappingInfo GetTpUserByName(string userName)
 {
     return(TpUsers.FirstOrDefault(x => x.Name == userName));
 }