Beispiel #1
0
        private async Task StartConversationBtn_Click(object sender, EventArgs e)
        {
            if (!advertisement.IsActive)
            {
                AlertsService.ShowShortToast(this, "Og³oszenie jest nieaktualne dlatego nie mo¿esz wys³aæ wiadomoœci autorowi og³oszenia");
            }
            else
            {
                progress.ShowProgressDialog("Proszê czekaæ. Trwa przetwarzanie informacji..");
                var conversationInfoModel = await messagesService.GetConversationInfoModel(this.advertisement.SellerId);

                progress.CloseProgressDialog();
                if (conversationInfoModel.ConversationId == 0)
                {
                    //if 0 that means user is trying to send message to himself
                    AlertsService.ShowLongToast(this, "Nie mo¿esz wys³aæ wiadomoœci do samego siebie :)");
                }
                else
                {
                    var conversationIntent = new Intent(this, typeof(ConversationActivity));
                    conversationIntent.PutExtra(ExtrasKeys.CONVERSATION_INFO_MODEL, JsonConvert.SerializeObject(conversationInfoModel));
                    StartActivity(conversationIntent);
                }
            }
        }