public Ticket UpdateFromDto(TicketDto ticketDto) { TicketId = ticketDto.id; TitleName = ticketDto.title; CategoryName = ticketDto.group?.title; ReviewText = ticketDto.details; DateReview = !string.IsNullOrEmpty(ticketDto.date_review) ? DateTime.Parse(ticketDto.date_review) : default(DateTime); UserServerId = ticketDto.user?.binary_id; GroupId = ticketDto.group_id; OffersCount = ticketDto.offers_count; ListOfTagTitles.Clear(); if (ticketDto.tags != null) { foreach (var ticketTagDto in ticketDto.tags) { ListOfTagTitles.Add(ticketTagDto.title); } } ListOfUsers.Clear(); if (ticketDto.users != null) { foreach (var userTicketDto in ticketDto.users) { ListOfUsers.Add(new UserTicket().UpdateFromDto(userTicketDto)); } } return(this); }
private void AddNewUser() { var newUser = new User(); var addNewUserWindow = new AddNewUserWindow { DataContext = newUser }; addNewUserWindow.ShowDialog(); if (addNewUserWindow.DialogResult == true) { ListOfUsers.Add(newUser); } }