Ejemplo n.º 1
0
        public Intent GetPropsectDetailIntent(Context context, ProspectItem prospectListItem)
        {
            Intent intent = new Intent(context, typeof(ProspectDetailActivity));

            intent.PutExtra(ProspectDetailActivity.ExistingProspectId, JsonConvert.SerializeObject(prospectListItem));
            return(intent);
        }
Ejemplo n.º 2
0
        void InitializeData()
        {
            if (null != Intent)
            {
                Bundle extras = Intent.Extras;
                _originalProspect = extras != null?JsonConvert.DeserializeObject <ProspectItem>(extras.GetString(ExistingProspectId)) : null;

                _modifiedProspect = _originalProspect;
                bool exited = AsyncHelper.RunSync(async() => await ExitIfConverted());
                if (exited)
                {
                    return;
                }

                string origin = extras == null ? string.Empty : extras.GetString(ProspectDetailsOrigin);

                if (!string.IsNullOrEmpty(origin))
                {
                    Enum.TryParse(origin, out this._origin);
                }

                Task.Run
                (
                    async() =>
                {
                    {
                        if (_originalProspect.SearchResult.ReminderTime != default(DateTime))
                        {
                            CriteriaBuilder criteriaBuilder = new CriteriaBuilder();

                            ProspectFollowup followup = await new ProspectFollowUpsController()

                                                        .GetSingleByCriteria
                                                        (
                                criteriaBuilder
                                .Add("ProspectId", _originalProspect.SearchResult.Id)
                                .AddDateCriterion("ReminderTime", _originalProspect.SearchResult.ReminderTime)
                                                        );


                            if (followup != null && followup.Id != default(Guid))
                            {
                                await
                                new NotificationsCoreService().SetSingleNotificationViewed(
                                    followup.TableName,
                                    followup.Id.ToString());
                            }
                        }
                    }
                }
                );
            }
        }