コード例 #1
0
        public IEnumerable <BLLProgrammer_Sphere> RateProgrammers(IEnumerable <string> sortings)
        {
            var res     = new List <BLLProgrammer_Sphere>();
            var Spheres = GetSphere(sortings);

            var users = uow.Programmers.GetAll();

            foreach (var item in Spheres)
            {
                users = users.Intersect(uow.Spheres.GetUsersWithSphere(item), new UserComparer());
            }

            foreach (var user in users)
            {
                var userSkills  = new BLLProgrammer_Sphere();
                var userProfile = uow.Programmers.GetById(user.Id);
                userSkills.IdProgrammer = user.Id;
                foreach (var sphere in Spheres)
                {
                    var bllsphere = SphereMapper.GetBLLEntity(sphere);
                    bllsphere.Level = uow.Spheres.GetLevelOfSphere(user.Id, sphere.Id);
                    userSkills.Spheres.Add(bllsphere);
                }
                res.Add(userSkills);
            }

            return(res);
        }
コード例 #2
0
 public ActionResult CreateSphere(MvcSphere sphere)
 {
     if (ModelState.IsValid)
     {
         spheres.Create(SphereMapper.GetBLLEntity(sphere));
         return(RedirectToRoute("Spheres"));
     }
     return(View());
 }
コード例 #3
0
 public IEnumerable <BLLSphere> GetAll()
 {
     return(uow.Spheres.GetAll().Select(s => SphereMapper.GetBLLEntity(s)));
 }
コード例 #4
0
 public BLLSphere Get(int id)
 {
     return(SphereMapper.GetBLLEntity(uow.Spheres.GetById(id)));
 }