Exemplo n.º 1
0
        /// <summary>
        /// news a account
        /// </summary>
        /// <param name="praiseDTO"></param>
        /// <returns></returns>
        public MsgDTO AddNewMsg(MsgDTO msgDTO)
        {
            //check preconditions
            if (msgDTO == null)
            {
                throw new ArgumentException(Messages.warning_CannotAddMsgWithEmptyInformation);
            }

            //Create the entity and the required associated data
            var msg = MsgFactory.CreateMsg(msgDTO.Context, msgDTO.MsType);

            //save entity
            SaveMsg(msg);

            //return the data with id and assigned default values
            return(msg.ProjectedAs <MsgDTO>());
        }
Exemplo n.º 2
0
        private async Task WhatsAppAsync(Service service)
        {
            try
            {
                MsgDTO apiRetorno = await Utils.GetApi().GetWhatsapp(service.id);

                _ = Launcher.OpenAsync(apiRetorno.msg);
            }
            catch (Exception ex)
            {
                await PageDialogService.DisplayAlertAsync("Erro", ex.Message, "OK");
            }
            finally
            {
                IsBusy = false;
            }
        }