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); }
public ActionResult CreateSphere(MvcSphere sphere) { if (ModelState.IsValid) { spheres.Create(SphereMapper.GetBLLEntity(sphere)); return(RedirectToRoute("Spheres")); } return(View()); }
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)); }
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()); } }
public IEnumerable <BLLSphere> GetAll() { return(uow.Spheres.GetAll().Select(s => SphereMapper.GetBLLEntity(s))); }
public BLLSphere Get(int id) { return(SphereMapper.GetBLLEntity(uow.Spheres.GetById(id))); }
public void UpDate(BLLSphere sphere) { uow.Spheres.UpDate(SphereMapper.GetDALEntity(sphere)); uow.Commit(); }
public ActionResult UserListPdf(IList <string> spheres) { ViewBag.List = SphereMapper.Map(sphereService.RateProgrammers(spheres)).Take(20).ToList(); return(View()); }