Пример #1
0
        public static string AddUserSkill(string[] Skills, string[] LanuagesKnown)
        {
            UserProfileInfo userProfileInfo = new UserProfileInfo();
            string          message         = Constant.CONST_SKILL_INFORMATION_FAILURE;

            if (SessionWrapper.LoggedUser == null)
            {
                return(message = Constant.SESSION_EXPIRE);
            }
            int count = 0;

            try
            {
                UserSkill userSkill = new UserSkill();
                userSkill.UserId = SessionWrapper.LoggedUser.UserId;

                userSkill.UserAdditionalSkills = new List <UserAdditionalSkill>();
                UserAdditionalSkill userAdditional;
                while (count < Skills.Length)
                {
                    if (!String.IsNullOrEmpty(Skills[count]))
                    {
                        userAdditional       = new UserAdditionalSkill();
                        userAdditional.Skill = Skills[count].Trim();
                        userSkill.UserAdditionalSkills.Add(userAdditional);
                    }
                    count++;
                }


                userSkill.UserLanuagesKnowns = new List <UserLanuagesKnown>();
                UserLanuagesKnown userLanguages;
                count = 0;
                while (count < LanuagesKnown.Length)
                {
                    if (!String.IsNullOrEmpty(LanuagesKnown[count]))
                    {
                        userLanguages         = new UserLanuagesKnown();
                        userLanguages.Lanuage = LanuagesKnown[count].Trim();
                        userSkill.UserLanuagesKnowns.Add(userLanguages);
                    }
                    count++;
                }
                userProfileInfo = UserSkillHelper.SaveUserSkill(userSkill);
            }
            catch { }

            if (userProfileInfo.IsFirstRecord)
            {
                message = Constant.CONST_SKILL_ADD_SUCCESS;
            }
            else
            {
                message = Constant.CONST_SKILL_SUCCESS;
            }

            return(message);
        }
Пример #2
0
        private void SetAdditionalSkill()
        {
            UserSkill userSkill = UserSkillHelper.GetUserSkillByUserId(SessionWrapper.LoggedUser.UserId);

            if (userSkill != null)
            {
                List <UserAdditionalSkill> userAdditionalSkillList = UserSkillHelper.GetAdditionalSkillListBySkillId(userSkill.UserSkillId);
                if (userAdditionalSkillList.Count > 0)
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "AddSkillControl(" + userAdditionalSkillList.Count + ");", true);
                    FillInformation(userAdditionalSkillList);
                }
            }
        }
Пример #3
0
        public static string DeleteLanguagesKnownById(int LanguagesKnownId)
        {
            bool   isDeleted = false;
            string message   = string.Empty;

            if (SessionWrapper.LoggedUser == null)
            {
                return(message = Constant.SESSION_EXPIRE);
            }
            try
            {
                isDeleted = UserSkillHelper.DeleteUserLanuages(LanguagesKnownId);
            }
            catch { }
            if (isDeleted)
            {
                message = Constant.CONST_LANGUAGE_DELETE_SUCCESS;
            }
            return(message);
        }
Пример #4
0
        public static string DeleteAdditionalSkillById(int AdditionalSkillId)
        {
            bool   isDeleted = false;
            string message   = string.Empty;

            if (SessionWrapper.LoggedUser == null)
            {
                return(message = Constant.SESSION_EXPIRE);
            }
            try
            {
                isDeleted = UserSkillHelper.DeleteUserSkill(AdditionalSkillId);
            }
            catch { }
            if (isDeleted)
            {
                message = Constant.CONST_SKILL_DELETE_SUCCESS;
            }

            return(message);
        }
Пример #5
0
 public static List <int>[] GetSkillIdList()
 {
     return(UserSkillHelper.GetSkillIdList(SessionWrapper.LoggedUser.UserId));
 }