예제 #1
0
        public ActionResult DeleteIndividualProfile(Guid id)
        {
            try
            {
                string profileId = string.Empty;

                //Delete Individual Profile.
                profileId = profileRepository.DeleteIndividualProfile(id, LogInManager.LoggedInUserId, LogInManager.LoggedInUserId);

                if (!string.IsNullOrWhiteSpace(profileId))
                {
                    #region Record Activity Log
                    RecordActivityLog.RecordActivity(Pages.INDIVIDUAL_PROFILE, "Deleted profile.");
                    #endregion

                    return(Json(new
                    {
                        IsSuccess = true,
                        data = new
                        {
                            ProfileId = id
                        }
                    }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(new
                    {
                        IsSuccess = false,
                        errorMessage = "Individual profile not deleted successfully."
                    }, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception e)
            {
                Utility.Utility.LogError(e, "DeleteIndividualProfile");
                return(Json(new { IsSuccess = false, errorMessage = e.Message }));
            }
        }