public ResultViewModel <UserSkillEditViewModel> Post(UserSkillEditViewModel UserSkill)
        {
            ResultViewModel <UserSkillEditViewModel> result
                = new ResultViewModel <UserSkillEditViewModel>();

            try
            {
                if (!ModelState.IsValid)
                {
                    result.Message = "In Valid Model State";
                }
                else if (UserSkillService.GetAll(UserSkill.UserID).Where(i => i.SkillID == UserSkill.SkillID).Count() > 0)
                {
                    result.Successed = false;
                    result.Message   = "Skill Already Exist";
                }
                else
                {
                    UserSkillEditViewModel selectedUserSkill
                        = UserSkillService.Add(UserSkill);

                    result.Successed = true;
                    result.Data      = selectedUserSkill;
                }
            }
            catch (Exception ex)
            {
                result.Successed = false;
                result.Message   = "Semething Went Wrong";
            }
            return(result);
        }
示例#2
0
        public void Ry()
        {
            UserSkillService uss = new UserSkillService();

            uss.Add(new Models.BaseInfo.zxjc_ryxx_jn()
            {
                user_code = "001",
                gcdm      = "9200",
                jnbh      = "001"
            });
        }