Example #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);
        }
Example #2
0
 public ActionResult CreateSphere(MvcSphere sphere)
 {
     if (ModelState.IsValid)
     {
         spheres.Create(SphereMapper.GetBLLEntity(sphere));
         return(RedirectToRoute("Spheres"));
     }
     return(View());
 }
Example #3
0
        public ActionResult EditSphere(int id)
        {
            MvcSphere sphere = SphereMapper.GetMVCEntity(spheres.Get(id));

            IEnumerable <BLLCategory> allCategories = categories.GetAll();
            List <string>             mvcCategories = allCategories.Select(c => c.Name).ToList();

            ViewBag.Categories = mvcCategories;

            return(View(sphere));
        }
Example #4
0
        public ActionResult Index(IList <string> selector = null, int page = 1)
        {
            var userList = SphereMapper.Map(sphereService.RateProgrammers(selector)).ToList();

            ViewBag.Spheres   = (userList.First().Spheres.Select(s => s.Name)).ToArray();
            ViewBag.AllSkills = (sphereService.GetAll().Select(s => s.Name)).ToArray();
            if (Request.IsAjaxRequest())
            {
                return(PartialView("_Users"));
            }
            else
            {
                return(View());
            }
        }
Example #5
0
 public IEnumerable <BLLSphere> GetAll()
 {
     return(uow.Spheres.GetAll().Select(s => SphereMapper.GetBLLEntity(s)));
 }
Example #6
0
 public BLLSphere Get(int id)
 {
     return(SphereMapper.GetBLLEntity(uow.Spheres.GetById(id)));
 }
Example #7
0
 public void UpDate(BLLSphere sphere)
 {
     uow.Spheres.UpDate(SphereMapper.GetDALEntity(sphere));
     uow.Commit();
 }
Example #8
0
        public ActionResult UserListPdf(IList <string> spheres)
        {
            ViewBag.List = SphereMapper.Map(sphereService.RateProgrammers(spheres)).Take(20).ToList();

            return(View());
        }