Exemple #1
0
        public ModelResponse DeleteOrgContact(UserInfo user, long contactId)
        {
            bool ret;

            try
            {
                //Authorization
                if (user == null)
                {
                    return(new ModelResponse(101));
                }
                if (string.IsNullOrWhiteSpace(user.UserId))
                {
                    return(new ModelResponse(101));
                }
                if (PUserRepo.GetUserClass(user) != UserClass.OrgAdmin)
                {
                    return(new ModelResponse(101));
                }

                //Delete
                ret = Repo.DeleteOrgContact(contactId, (long)user.PortalUserId, user.UserId);
            }
            catch (Exception ex)
            {
                return(new ModelResponse(ex));
            }

            return(new ModelResponse(0, ret));
        }