Example #1
0
        public IActionResult DeleteWorkExperience(long id)
        {
            WorkExperience a = wexp_repo.Find(id);

            if (a == null)
            {
                return(NotFound());
            }
            wexp_repo.Delete(a);
            return(Ok());
        }
Example #2
0
 public bool Delete(int?id)
 {
     if (_workExperienceRepository.Get(id) == null)
     {
         MessageBox.Show("Sorry, your data is not found");
     }
     else
     {
         status = _workExperienceRepository.Delete(id);
     }
     return(status);
 }
Example #3
0
        /// <summary>
        /// 删除用户资料
        /// </summary>
        /// <param name="userProfile">用户资料</param>
        /// <returns>删除成功返回true,否则返回false</returns>
        public bool Delete(long userId)
        {
            UserProfile userProfile = profileRepository.Get(userId);

            if (userProfile == null)
            {
                return(false);
            }
            EventBus <UserProfile> .Instance().OnBefore(userProfile, new CommonEventArgs(EventOperationType.Instance().Delete()));

            profileRepository.Delete(userProfile);
            IEnumerable <EducationExperience> educationExperiences = GetEducationExperiences(userId);

            if (educationExperiences != null)
            {
                foreach (var educationExperience in educationExperiences)
                {
                    educationExperienceRepository.Delete(educationExperience);
                }
            }

            IEnumerable <WorkExperience> workExperiences = GetWorkExperiences(userId);

            if (workExperiences != null)
            {
                foreach (var workExperience in workExperiences)
                {
                    workExperienceRepository.Delete(workExperience);
                }
            }

            //通过UserId  删除个人标签
            TagService tagService = new TagService(TenantTypeIds.Instance().UserProfile());

            tagService.DeleteOwnerTag(userId);
            EventBus <UserProfile> .Instance().OnAfter(userProfile, new CommonEventArgs(EventOperationType.Instance().Delete()));

            //同时删除教育经历、工作经历、个人标签、头像文件等
            return(true);
        }