Esempio n. 1
0
        public PostAProject Insert(PostProjectModel postProjectModel)
        {
            var postAProject = new PostAProject();

            postAProject.WUserId     = HttpUtil.CurrentUser.UserId;
            postAProject.ProjectName = postProjectModel.ProjectName;
            postAProject.Description = postProjectModel.Description;
            postAProject.Price       = postProjectModel.Price;
            postAProject.StartTime   = postProjectModel.StartTime;
            postAProject.EndTime     = postProjectModel.EndTime;
            postAProject.Members     = postProjectModel.Members;

            return(postAProject);
        }
Esempio n. 2
0
        public PostProjectModel creation(PostAProject result, List <ProjectSkills> skills, List <Skill> Allskills)
        {
            var postModel = new PostProjectModel();

            postModel.PostId      = result.PostId;
            postModel.Description = result.Description;
            postModel.EndTime     = result.EndTime;
            postModel.StartTime   = result.StartTime;
            postModel.Members     = result.Members;
            postModel.Price       = result.Price;
            postModel.ProjectName = result.ProjectName;
            var    skillStr = skills.Select(m => m.SkillName).ToList();
            string str      = "";
            int    c        = 0;

            foreach (var v in skillStr)
            {
                if (c != 0)
                {
                    str = str + "," + v;
                }
                else
                {
                    str = v;
                    c++;
                }
            }
            List <string> Skills = new List <string>();

            foreach (var v in Allskills)
            {
                if (!str.Contains(v.SkillName))
                {
                    Skills.Add(v.SkillName);
                }
            }
            postModel.SkillName    = Skills;
            postModel.Selectskills = str;
            return(postModel);
        }