protected override void OnActivityResult(int requestCode, [GeneratedEnum] Result resultCode, Intent data) { base.OnActivityResult(requestCode, resultCode, data); int attitudesID = -1; string toWhat = ""; ConstantsAndTypes.ATTITUDE_TYPES type = ConstantsAndTypes.ATTITUDE_TYPES.Cautious; int belief = 0; int feeling = -1; ConstantsAndTypes.ACTION_TYPE action = ConstantsAndTypes.ACTION_TYPE.Maintain; string actionOf = ""; if (resultCode == Result.Ok) { if (data != null) { if (data.HasExtra("attitudesID")) { attitudesID = data.GetIntExtra("attitudesID", -1); } if (data.HasExtra("toWhat")) { toWhat = data.GetStringExtra("toWhat"); } if (data.HasExtra("type")) { type = (ConstantsAndTypes.ATTITUDE_TYPES)data.GetIntExtra("type", 0); } if (data.HasExtra("belief")) { belief = data.GetIntExtra("belief", 0); } if (data.HasExtra("feeling")) { feeling = data.GetIntExtra("feeling", -1); } if (data.HasExtra("action")) { action = (ConstantsAndTypes.ACTION_TYPE)data.GetIntExtra("action", -1); } if (data.HasExtra("actionOf")) { actionOf = data.GetStringExtra("actionOf"); } try { Attitudes attitudesItem = null; if (attitudesID == -1) { //new item attitudesItem = new Attitudes(); attitudesItem.IsNew = true; attitudesItem.IsDirty = false; } else { attitudesItem = GlobalData.StructuredPlanAttitudes.Find(attitude => attitude.AttitudesID == attitudesID); attitudesItem.IsNew = false; attitudesItem.IsDirty = true; } attitudesItem.ToWhat = toWhat; attitudesItem.TypeOf = type; attitudesItem.Belief = belief; attitudesItem.Feeling = feeling; attitudesItem.Action = action; attitudesItem.ActionOf = actionOf; attitudesItem.Save(); if (attitudesID == -1) { GlobalData.StructuredPlanAttitudes.Add(attitudesItem); } UpdateAdapter(); } catch (Exception e) { Log.Error(TAG, "OnActivityResult: Exception - " + e.Message); if (GlobalData.ShowErrorDialog) { ErrorDisplay.ShowErrorAlert(this, e, GetString(Resource.String.ErrorStructuredPlanAttitudesConfirm), "StructuredPlanAttitudes.OnActivityResult"); } } } } if (resultCode == Result.Canceled) { Toast.MakeText(this, Resource.String.StructuredplanNoChangesToast, ToastLength.Short).Show(); } }
protected override void OnActivityResult(int requestCode, [GeneratedEnum] Result resultCode, Intent data) { int reactionsID = -1; string to = ""; int strength = -1; ConstantsAndTypes.REACTION_TYPE reaction = ConstantsAndTypes.REACTION_TYPE.Positive; ConstantsAndTypes.ACTION_TYPE intention = ConstantsAndTypes.ACTION_TYPE.Maintain; string actionOf = ""; base.OnActivityResult(requestCode, resultCode, data); if (resultCode == Result.Ok) { try { if (data.HasExtra("reactionsID")) { reactionsID = data.GetIntExtra("reactionsID", -1); } if (data.HasExtra("to")) { to = data.GetStringExtra("to"); } if (data.HasExtra("strength")) { strength = data.GetIntExtra("strength", -1); } if (data.HasExtra("reaction")) { reaction = (ConstantsAndTypes.REACTION_TYPE)data.GetIntExtra("reaction", -1); } if (data.HasExtra("intention")) { intention = (ConstantsAndTypes.ACTION_TYPE)data.GetIntExtra("intention", -1); } if (data.HasExtra("actionOf")) { actionOf = data.GetStringExtra("actionOf"); } Reactions reactionItem = null; if (reactionsID == -1) { //new item reactionItem = new Reactions(); reactionItem.IsNew = true; reactionItem.IsDirty = false; } else { reactionItem = GlobalData.StructuredPlanReactions.Find(react => react.ReactionsID == reactionsID); reactionItem.IsNew = false; reactionItem.IsDirty = true; } reactionItem.ToWhat = to; reactionItem.Action = intention; reactionItem.ActionOf = actionOf; reactionItem.Strength = strength; reactionItem.Type = reaction; reactionItem.Save(); if (reactionsID == -1) { GlobalData.StructuredPlanReactions.Add(reactionItem); } UpdateAdapter(); } catch (Exception e) { Log.Error(TAG, "ConfirmPlanItemAddition: Exception - " + e.Message); if (GlobalData.ShowErrorDialog) { ErrorDisplay.ShowErrorAlert(this, e, GetString(Resource.String.ErrorStructuredPlanReactionsConfirm), "StructuredPlanReactions.ConfirmPlanItemAddition"); } } } if (resultCode == Result.Canceled) { Toast.MakeText(this, Resource.String.StructuredplanNoChangesToast, ToastLength.Short).Show(); } }
protected override void OnActivityResult(int requestCode, [GeneratedEnum] Result resultCode, Intent data) { int relationshipsID = -1; string withWhom = ""; ConstantsAndTypes.RELATIONSHIP_TYPE type = ConstantsAndTypes.RELATIONSHIP_TYPE.Aquaintance; int strength = -1; int feeling = -1; ConstantsAndTypes.ACTION_TYPE action = ConstantsAndTypes.ACTION_TYPE.Maintain; string actionOf = ""; base.OnActivityResult(requestCode, resultCode, data); if (resultCode == Result.Ok) { try { if (data.HasExtra("relationshipsID")) { relationshipsID = data.GetIntExtra("relationshipsID", -1); } if (data.HasExtra("withWhom")) { withWhom = data.GetStringExtra("withWhom"); } if (data.HasExtra("type")) { type = (ConstantsAndTypes.RELATIONSHIP_TYPE)data.GetIntExtra("type", -1); } if (data.HasExtra("strength")) { strength = data.GetIntExtra("strength", -1); } if (data.HasExtra("feeling")) { feeling = data.GetIntExtra("feeling", -1); } if (data.HasExtra("action")) { action = (ConstantsAndTypes.ACTION_TYPE)data.GetIntExtra("action", -1); } if (data.HasExtra("actionOf")) { actionOf = data.GetStringExtra("actionOf"); } Relationships relationshipsItem = null; if (relationshipsID == -1) { //new item relationshipsItem = new Relationships(); relationshipsItem.IsNew = true; relationshipsItem.IsDirty = false; } else { relationshipsItem = GlobalData.StructuredPlanRelationships.Find(attitude => attitude.RelationshipsID == relationshipsID); relationshipsItem.IsNew = false; relationshipsItem.IsDirty = true; } relationshipsItem.WithWhom = withWhom; relationshipsItem.Type = type; relationshipsItem.Strength = strength; relationshipsItem.Feeling = feeling; relationshipsItem.Action = action; relationshipsItem.ActionOf = actionOf; relationshipsItem.Save(); if (relationshipsID == -1) { GlobalData.StructuredPlanRelationships.Add(relationshipsItem); } UpdateAdapter(); } catch (Exception e) { Log.Error(TAG, "ConfirmPlanItemAddition: Exception - " + e.Message); if (GlobalData.ShowErrorDialog) { ErrorDisplay.ShowErrorAlert(this, e, GetString(Resource.String.ErrorStructuredPlanRelationshipsConfirm), "StructuredPlanRelationships.ConfirmPlanItemAddition"); } } } if (resultCode == Result.Canceled) { Toast.MakeText(this, Resource.String.StructuredplanNoChangesToast, ToastLength.Short).Show(); } }
protected override void OnActivityResult(int requestCode, [GeneratedEnum] Result resultCode, Intent data) { int healthID = -1; string aspect = ""; int importance = -1; ConstantsAndTypes.REACTION_TYPE reaction = ConstantsAndTypes.REACTION_TYPE.Positive; ConstantsAndTypes.ACTION_TYPE intention = ConstantsAndTypes.ACTION_TYPE.Maintain; string actionOf = ""; base.OnActivityResult(requestCode, resultCode, data); if (resultCode == Result.Ok) { try { if (data.HasExtra("healthID")) { healthID = data.GetIntExtra("healthID", -1); } if (data.HasExtra("aspect")) { aspect = data.GetStringExtra("aspect"); } if (data.HasExtra("importance")) { importance = data.GetIntExtra("importance", -1); } if (data.HasExtra("reaction")) { reaction = (ConstantsAndTypes.REACTION_TYPE)data.GetIntExtra("reaction", -1); } if (data.HasExtra("intention")) { intention = (ConstantsAndTypes.ACTION_TYPE)data.GetIntExtra("intention", -1); } if (data.HasExtra("actionOf")) { actionOf = data.GetStringExtra("actionOf"); } Health healthItem = null; if (healthID == -1) { //new item healthItem = new Health(); healthItem.IsNew = true; healthItem.IsDirty = false; } else { healthItem = GlobalData.StructuredPlanHealth.Find(healthy => healthy.HealthID == healthID); healthItem.IsNew = false; healthItem.IsDirty = true; } healthItem.Aspect = aspect; healthItem.Action = intention; healthItem.ActionOf = actionOf; healthItem.Importance = importance; healthItem.Type = reaction; healthItem.Save(); if (healthID == -1) { GlobalData.StructuredPlanHealth.Add(healthItem); } UpdateAdapter(); } catch (Exception e) { Log.Error(TAG, "OnActivityResult: Exception - " + e.Message); if (GlobalData.ShowErrorDialog) { ErrorDisplay.ShowErrorAlert(this, e, GetString(Resource.String.ErrorStructuredPlanHealthConfirm), "StructuredPlanHealth.OnActivityResult"); } } } if (resultCode == Result.Canceled) { Toast.MakeText(this, Resource.String.StructuredplanNoChangesToast, ToastLength.Short).Show(); } }
protected override void OnActivityResult(int requestCode, [GeneratedEnum] Result resultCode, Intent data) { int fantasiesID = -1; string ofWhat = ""; int strength = -1; ConstantsAndTypes.REACTION_TYPE reaction = ConstantsAndTypes.REACTION_TYPE.Ambivalent; ConstantsAndTypes.ACTION_TYPE intention = ConstantsAndTypes.ACTION_TYPE.Maintain; string actionOf = ""; base.OnActivityResult(requestCode, resultCode, data); if (resultCode == Result.Ok) { try { if (data.HasExtra("fantasiesID")) { fantasiesID = data.GetIntExtra("fantasiesID", -1); } if (data.HasExtra("ofWhat")) { ofWhat = data.GetStringExtra("ofWhat"); } if (data.HasExtra("strength")) { strength = data.GetIntExtra("strength", -1); } if (data.HasExtra("reaction")) { reaction = (ConstantsAndTypes.REACTION_TYPE)data.GetIntExtra("reaction", -1); } if (data.HasExtra("intention")) { intention = (ConstantsAndTypes.ACTION_TYPE)data.GetIntExtra("intention", -1); } if (data.HasExtra("actionOf")) { actionOf = data.GetStringExtra("actionOf"); } Fantasies fantasiesItem = null; if (fantasiesID == -1) { //new item fantasiesItem = new Fantasies(); fantasiesItem.IsNew = true; fantasiesItem.IsDirty = false; } else { fantasiesItem = GlobalData.StructuredPlanFantasies.Find(fantasiesy => fantasiesy.FantasiesID == fantasiesID); fantasiesItem.IsNew = false; fantasiesItem.IsDirty = true; } fantasiesItem.OfWhat = ofWhat; fantasiesItem.Action = intention; fantasiesItem.ActionOf = actionOf; fantasiesItem.Strength = strength; fantasiesItem.Type = reaction; fantasiesItem.Save(); if (fantasiesID == -1) { GlobalData.StructuredPlanFantasies.Add(fantasiesItem); } UpdateAdapter(); } catch (Exception e) { Log.Error(TAG, "OnActivityResult: Exception - " + e.Message); if (GlobalData.ShowErrorDialog) { ErrorDisplay.ShowErrorAlert(this, e, GetString(Resource.String.ErrorStructuredPlanFantasiesConfirm), "StructuredPlanFantasies.OnActivityResult"); } } } if (resultCode == Result.Canceled) { Toast.MakeText(this, Resource.String.StructuredplanNoChangesToast, ToastLength.Short).Show(); } }