public ActionResult Create()
 {
     try
     {
         /////////create code///////
         var stru    = reposatorystructure.find(ChModels.Personnel).Structure_Code;
         var ALLList = reposatoryelement.GetAll();
         var model   = new EvaluationElements();
         if (ALLList.Count() == 0)
         {
             model.Code = stru + "1";
         }
         else
         {
             model.Code = stru + (ALLList.LastOrDefault().ID + 1).ToString();
         }
         ViewBag.competitions = reposatorycomp.GetAll().Select(m => new{ Code = m.Code + "-->" + m.Name, ID = m.ID });
         model.defaultDegree  = 0;
         return(View(model));
     }
     catch (Exception)
     {
         return(RedirectToAction("Index"));
     }
 }
        public ActionResult Index()
        {
            try
            {
                var list = reposatoryEvaluationElementCompetenies.GetAll();

                if (list != null)
                {
                    return(View(list));
                }
                else
                {
                    TempData["Message"] = HR.Resource.pers_2.Faild; return(View());
                }
            }
            catch (Exception)
            {
                TempData["Message"] = HR.Resource.pers_2.Faild;
                return(View());
            }
        }
        public JsonResult GetCompet(int id)
        {
            var obj          = reposatoryElements.find_evaandcomp(id);
            var obj2         = reposatoryElementComp.GetAll();
            var eva_And_Comp = from e in obj
                               join d in obj2 on e.EvaluationElementCompeteniesID equals d.ID
                               select new performancEevaluationVM
            {
                degeree = e.Default_degree,
                code    = d.Code,
                Desc    = d.Description,
            };
            var t = eva_And_Comp.ToList();

            return(Json(t));
        }