Exemplo n.º 1
0
 public ActionResult Index()
 {
     try
     {
         var list = reposatoryType.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 ActionResult Create()
 {
     try
     {
         var ALLList = reposatoryEvaluationplan.GetAll();
         //   var stru = reposatorystructure.find(ChModels.Personnel).Structure_Code;
         ViewBag.type = reposatorytype.GetAll().Select(m => new { ID = m.ID, Code = m.Code + "->" + m.Name });
         var model = new HR.Models.EvaluationPlan();
         if (ALLList.Count() == 0)
         {
             model.Code = "1";
         }
         else
         {
             model.Code = (ALLList.LastOrDefault().ID + 1).ToString();
         }
         return(View(model));
     }
     catch (Exception)
     {
         TempData["Message"] = HR.Resource.pers_2.Faild;
         return(RedirectToAction("index"));
     }
 }