Beispiel #1
0
        public BrokerDto GetPestanaCobranza(CabeceraJsonDto cabecera)
        {
            BrokerDto cobranza = new BrokerDto();

            cobranza = MapperBroker.TransformarBrokerDtoMapperEnDTO(this.clientBroker.GetFormularioCcte(cabecera.IdGrupoFormulario),
                                                                    this.clientBroker.GetFormularioCorredor(cabecera.IdGrupoFormulario),
                                                                    this.clientMensaje.GetBdMensaje(cabecera.IdGrupoFormulario, cabecera.IdPestana));
            return(cobranza);
        }
Beispiel #2
0
 public async void RemoveBoard(BoardDTO board, string token)
 {
     try
     {
         CheckToken(token);
         var b = MapperBroker.GetBoardFromDTO(board);
         await repository.BoardManager.RemoveEntityAsync(b);
         await CommitAndSendCallbackAsync();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #3
0
        public async Task <IEnumerable <BoardDTO> > GetBoards()
        {
            try
            {
                var boards = await repository.BoardManager.GetEntitiesAsync();

                var boardDTOs = MapperBroker.GetBoardDTOsFromBoards(boards);
                return(boardDTOs);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #4
0
 public async void RenameCardList(CardListDTO cardList, string newName, string token)
 {
     try
     {
         CheckToken(token);
         var cl = MapperBroker.GetCardListFromDTO(cardList);
         await repository.CardListInteraction.RenameCardListAsync(cl, newName);
         await CommitAndSendCallbackAsync();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #5
0
 public async void RenameBoard(BoardDTO board, string newName, string token)
 {
     try
     {
         CheckToken(token);
         var b = MapperBroker.GetBoardFromDTO(board);
         await repository.BoardInteraction.RenameBoardAsync(b, newName);
         await CommitAndSendCallbackAsync();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #6
0
 public async void ChangeNameOfACard(CardDTO card, string newName, string token)
 {
     try
     {
         CheckToken(token);
         var c = MapperBroker.GetCardFromDTO(card);
         await repository.CardManager.ChangeNameOfACardAsync(c, newName);
         await CommitAndSendCallbackAsync();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #7
0
 public async void AddUserToBoard(BoardDTO board, UserInfo user)
 {
     try
     {
         CheckToken(user.Token);
         var b = MapperBroker.GetBoardFromDTO(board);
         var u = MapperBroker.GetUserFromDTO(user.User);
         await repository.BoardInteraction.AddUserToBoardAsync(b, u);
         await CommitAndSendCallbackAsync();
     }
     catch (Exception ex)
     {
         throw ex;
     };
 }
Beispiel #8
0
 public async void AddLabelColorToCard(CardDTO card, LabelColorDTO labelColor, string token)
 {
     try
     {
         CheckToken(token);
         var c  = MapperBroker.GetCardFromDTO(card);
         var lc = MapperBroker.GetLabelColorFromDTO(labelColor);
         await repository.CardManager.AddLabelColorToCardAsync(c, lc);
         await CommitAndSendCallbackAsync();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #9
0
 public async void AddCommentToCard(CardDTO card, CommentDTO comment, string token)
 {
     try
     {
         CheckToken(token);
         var c  = MapperBroker.GetCardFromDTO(card);
         var cm = MapperBroker.GetCommentFromDTO(comment);
         await repository.CardManager.AddCommentToCardAsync(c, cm);
         await CommitAndSendCallbackAsync();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #10
0
 public async void AddCardToCardList(CardListDTO cardList, CardDTO card, string token)
 {
     try
     {
         CheckToken(token);
         var cl = MapperBroker.GetCardListFromDTO(cardList);
         var c  = MapperBroker.GetCardFromDTO(card);
         await repository.CardListInteraction.AddCardToCardListAsync(cl, c);
         await CommitAndSendCallbackAsync();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #11
0
 public async void RemoveUserFromCard(CardDTO card, UserInfo user)
 {
     try
     {
         CheckToken(user.Token);
         var c = MapperBroker.GetCardFromDTO(card);
         var u = MapperBroker.GetUserFromDTO(user.User);
         await repository.CardManager.RemoveUserFromCardAsync(c, u);
         await CommitAndSendCallbackAsync();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #12
0
 public async void AddCardListToBoard(BoardDTO board, CardListDTO cardList, string token)
 {
     try
     {
         CheckToken(token);
         var b  = MapperBroker.GetBoardFromDTO(board);
         var cl = MapperBroker.GetCardListFromDTO(cardList);
         await repository.BoardInteraction.AddCardListToBoardAsync(b, cl);
         await CommitAndSendCallbackAsync();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #13
0
        private async Task SendCallback(bool isRegistration)
        {
            if (isRegistration)
            {
                lastRegistred.Callback.InformAboutRegistration($"Welcome to our system, {lastRegistred.ClientName}! Registration was successful! You will be redirected to login window now. Use your login data to enter");
            }
            else
            {
                var boards = await repository.BoardManager.GetEntitiesAsync();

                var boardDTOs = MapperBroker.GetBoardDTOsFromBoards(boards);
                foreach (var sc in SystemServiceClients)
                {
                    sc.Callback.RefreshBoards(boardDTOs);
                }
            }
        }
Beispiel #14
0
        public async Task <BoardDTO> UpdateBoard(BoardDTO oldBoard, BoardDTO newBoard, string token)
        {
            try
            {
                CheckToken(token);
                var oldB = MapperBroker.GetBoardFromDTO(oldBoard);
                var newB = MapperBroker.GetBoardFromDTO(newBoard);
                oldB = await repository.BoardManager.UpdateEntityAsync(oldB, newB);
                await CommitAndSendCallbackAsync();

                return(MapperBroker.GetBoardDTOFromEntity(oldB));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #15
0
        public async Task <UserInfo> Login(UserDTO user)
        {
            try
            {
                var u = MapperBroker.GetUserFromDTO(user);
                u = await repository.UserManager.LoginAsync(u);

                var userDTO = MapperBroker.GetUserDTOFromEntity(u);
                var info    = new UserInfo {
                    User = userDTO, Token = Guid.NewGuid().ToString()
                };
                Tokens.Add(info.Token);
                return(info);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #16
0
        public async Task <bool> Register(UserDTO user)
        {
            try
            {
                var u       = MapperBroker.GetUserFromDTO(user);
                var current = OperationContext.Current;
                await repository.UserManager.RegisterAsync(u);

                lastRegistred = new KanbanSystemServiceClient {
                    ClientName = user.UserName, Callback = current.GetCallbackChannel <IServiceCallback>()
                };
                SystemServiceClients.Add(lastRegistred);
                await CommitAndSendCallbackAsync(true);

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #17
0
 public Boolean SetGuardarCcte(BrokerPestanaDto datosBroker, int grupoFormulario)
 {
     return(this.clientBroker.SetBrokerCcte(MapperBroker.TransformarCcteDTOEnDtoMapper(datosBroker.DatosCarga, grupoFormulario)));
 }
Beispiel #18
0
 public Boolean SetGuardarCorredor(BrokerPestanaDto datosBroker)
 {
     ;
     return(this.clientBroker.SetBrokerCorredor(MapperBroker.TransformarCorredorDTOEnDtoMapper(datosBroker.DatosCarga)));
 }