Exemplo n.º 1
0
        public IActionResult Index()
        {
            var result = _BehavioralFactor.GetBehavioralFactors()
                         .Select(a => new BehavioralFactorViewModel
            {
                Id          = a.Id,
                Title       = a.Title,
                Description = a.Description,
                Weight      = a.Weight,
                Category    = a.Category.Id
            }).ToList();
            var aes    = _BehavioralFactor.ActiveSeason();
            var season = new EvaluationSeasonItem();

            if (aes != null)
            {
                season.Id        = aes.Id;
                season.Title     = aes.Title;
                season.Remarks   = aes.Remarks;
                season.StartDate = aes.StartDate;
                season.EndDate   = aes.EndDate;
            }
            ;
            var model = new BehavioralFactorIndexViewModel
            {
                BehavioralFactors  = result,
                EmployeeCategories = this.Categories(),
                IsWithActiveSeason = _BehavioralFactor.IsWithActiveSeason(),
                ActiveSeason       = season,
            };

            return(View(model));
        }
Exemplo n.º 2
0
        public IActionResult Index()
        {
            var result = _PeerCriteria.PeerCriteriaHeaders()
                         .Select(a => new PeerCriteriaHeaderViewModel
            {
                Id          = a.Id,
                Title       = a.Title,
                Description = a.Description,
                Weight      = a.Weight
            }).ToList();
            var aes    = _PeerCriteria.ActiveSeason();
            var season = new EvaluationSeasonItem();

            if (aes != null)
            {
                season.Id        = aes.Id;
                season.Title     = aes.Title;
                season.Remarks   = aes.Remarks;
                season.StartDate = aes.StartDate;
                season.EndDate   = aes.EndDate;
            }
            ;
            var model = new PeerCriteriaIndexViewModel
            {
                Criterias          = result,
                IsWithActiveSeason = _PeerCriteria.IsWithActiveSeason(),
                ActiveSeason       = season,
            };

            return(View(model));
        }
Exemplo n.º 3
0
        public IActionResult Index()
        {
            var UserId = int.Parse(HttpContext.Session.GetString("UserId"));
            var result = _Services.Accounts(UserId)
                         .Select(a => new RecommendationIndexItem
            {
                Id   = a.Id,
                Name = a.FirstName + " " + a.MiddleName + " " + a.LastName,
                IsWithRecommendation = _Services.IsWithRecommendation(a.Id)
            }).ToList();

            var aes    = _Services.ActiveSeason();
            var season = new EvaluationSeasonItem();

            if (aes != null)
            {
                season.Id        = aes.Id;
                season.Title     = aes.Title;
                season.Remarks   = aes.Remarks;
                season.StartDate = aes.StartDate;
                season.EndDate   = aes.EndDate;
            }
            ;
            var model = new RecommendationIndexViewModel
            {
                Accounts           = result,
                IsWithActiveSeason = _Services.IsWithActiveSeason(),
                ActiveSeason       = season,
            };

            return(View(model));
        }
        public IActionResult Index()
        {
            var result = _RatingTable.RatingTables().Select(a => new RatingTableViewModel
            {
                Id          = a.Id,
                Description = a.Description
            }).ToList();

            var aes    = _RatingTable.ActiveSeason();
            var season = new EvaluationSeasonItem();

            if (aes != null)
            {
                season.Id        = aes.Id;
                season.Title     = aes.Title;
                season.Remarks   = aes.Remarks;
                season.StartDate = aes.StartDate;
                season.EndDate   = aes.EndDate;
            }

            var model = new RatingTableIndexViewModel
            {
                RatingTables       = result,
                IsWithActiveSeason = _RatingTable.IsWithActiveSeason(),
                ActiveSeason       = season,
            };

            return(View(model));
        }
Exemplo n.º 5
0
        public IActionResult Index()
        {
            var result = _Services.GetAllKeyResultArea().Select(
                a => new KeyResultAreaViewModel
            {
                Id          = a.Id,
                Title       = a.Title,
                Description = a.Description,
                Weight      = a.Weight
            }
                ).ToList();
            var aes    = _Services.ActiveSeason();
            var season = new EvaluationSeasonItem();

            if (aes != null)
            {
                season.Id        = aes.Id;
                season.Title     = aes.Title;
                season.Remarks   = aes.Remarks;
                season.StartDate = aes.StartDate;
                season.EndDate   = aes.EndDate;
            }
            ;
            var model = new KeyResultAreaIndexViewModel
            {
                KeyResultAreas     = result,
                IsWithActiveSeason = _Services.IsWithActiveSeason(),
                ActiveSeason       = season,
            };

            return(View(model));
        }
        // GET: /<controller>/
        public IActionResult Index(int?page)
        {
            int currentpage;

            if (page == null)
            {
                currentpage = 1;
            }
            else
            {
                currentpage = (int)page;
            }

            var maxcount = currentpage < 5 ? 5 : currentpage + 2;
            var mincount = currentpage < 5 ? 1 : currentpage - 2;

            var maxpage = (_Services.GetAllAccounts().Count() / 10) + 1;

            maxcount = currentpage <= maxpage ? maxcount : maxpage;
            var result = _Services.Employees(currentpage);

            var aes    = _Services.ActiveSeason();
            var season = new EvaluationSeasonItem();

            if (aes != null)
            {
                season.Id        = aes.Id;
                season.Title     = aes.Title;
                season.Remarks   = aes.Remarks;
                season.StartDate = aes.StartDate;
                season.EndDate   = aes.EndDate;
            }
            ;
            var model = new PeerAssignmentIndexViewModel
            {
                Accounts           = result,
                IsWithActiveSeason = _Services.IsWithActiveSeason(),
                ActiveSeason       = season,
            };

            ViewBag.MaxCount    = maxcount;
            ViewBag.MinCount    = mincount;
            ViewBag.CurrentPage = currentpage;
            ViewBag.MaxPage     = maxpage;
            return(View(model));
        }
Exemplo n.º 7
0
        public IActionResult Assign(int id)
        {
            var result = _Services.RecommendationByEmployeeId(id);
            var item   = new RecommendationItem();
            var aes    = _Services.ActiveSeason();
            var season = new EvaluationSeasonItem();

            if (aes != null)
            {
                season.Id        = aes.Id;
                season.Title     = aes.Title;
                season.Remarks   = aes.Remarks;
                season.StartDate = aes.StartDate;
                season.EndDate   = aes.EndDate;
            }
            ;

            if (result == null)
            {
                item.Id           = 0;
                item.EmployeeId   = id;
                item.EmployeeName = _Services.GetNameById(id);
            }
            else
            {
                item.Id             = result.Id;
                item.EmployeeId     = id;
                item.EmployeeName   = _Services.GetNameById(id);
                item.Recommendation = result.Comment;
                item.CreatedBy      = result.CreatedBy;
                item.CreationDate   = result.CreationDate;
            }
            item.IsWithActiveSeason = _Services.IsWithActiveSeason();
            item.ActiveSeason       = season;
            return(View(item));
        }
        public IActionResult Index()
        {
            var UserId = int.Parse(HttpContext.Session.GetString("UserId"));
            var result = _Evaluation.AssignedEmployees(UserId)
                         .Select(a => new EmployeeViewModel
            {
                Id         = a.Id,
                Name       = a.LastName + ", " + a.FirstName + " " + a.MiddleName,
                EmployeeNo = a.EmployeeNo,
                Company    = a.Company.Description,
                Branch     = a.Branch.Description,
                Department = a.Department.Description,
                Position   = a.Position.Description,
                Category   = a.Category.Description,
            }).ToList();
            var aes    = _Evaluation.ActiveSeason();
            var season = new EvaluationSeasonItem();

            if (aes != null)
            {
                season.Id        = aes.Id;
                season.Title     = aes.Title;
                season.Remarks   = aes.Remarks;
                season.StartDate = aes.StartDate;
                season.EndDate   = aes.EndDate;
            }
            ;
            var model = new EmployeeEvaluationIndexViewModel
            {
                Employees          = result,
                IsWithActiveSeason = _Evaluation.IsWithActiveSeason(),
                ActiveSeason       = season,
            };

            return(View(model));
        }
Exemplo n.º 9
0
        public IActionResult Assignment(int id)
        {
            var _employee = _Services.EmployeeById(id);
            var employee  = new EmployeeViewModel
            {
                Id         = _employee.Id,
                EmployeeNo = _employee.EmployeeNo,
                Name       = _employee.LastName + ", " + _employee.FirstName + " " + _employee.MiddleName,
                Company    = _employee.Company.Description,
                Branch     = _employee.Branch.Description,
                Category   = _employee.Category.Description,
                Department = _employee.Department.Description,
                Position   = _employee.Position.Description,
            };

            var kralist        = new List <AssignedKeyResultViewModel>();
            var behaviorallist = new List <AssignedBehavioralViewModel>();
            var header         = _Services.EmployeeAssignmentByEmployeeId(id);

            if (header != null)
            {
                var kra = _Services.EmployeeKRAAssignmentByHeaderId(header.Id)
                          .Select(a => new AssignedKeyResultViewModel
                {
                    Id          = a.Id,
                    Title       = a.KeyResultArea.Title,
                    Description = a.KeyResultArea.Description,
                    Weight      = a.KeyResultArea.Weight
                }).ToList();
                kralist = kra;
                var behavioral = _Services.EmployeeBehavioralAssignmentByHeaderId(header.Id)
                                 .Select(a => new AssignedBehavioralViewModel
                {
                    Id          = a.Id,
                    Title       = a.BehavioralFactor.Title,
                    Description = a.BehavioralFactor.Description,
                    Weight      = a.BehavioralFactor.Weight
                }).ToList();
                behaviorallist = behavioral;
            }
            var kraitems = _Services.GetAvailableKRA(id)
                           .Select(a => new KeyResultAreaViewModel
            {
                Id    = a.Id,
                Title = a.Title,
            }).ToList();
            var bfitems = _Services.GetAvailableBehavioral(id)
                          .Select(a => new BehavioralFactorViewModel
            {
                Id    = a.Id,
                Title = a.Title,
            }).ToList();

            var aes    = _Services.ActiveSeason();
            var season = new EvaluationSeasonItem();

            if (aes != null)
            {
                season.Id        = aes.Id;
                season.Title     = aes.Title;
                season.Remarks   = aes.Remarks;
                season.StartDate = aes.StartDate;
                season.EndDate   = aes.EndDate;
            }
            ;


            var model = new EmployeeAssignViewModel
            {
                Employee = employee,
                AssignedBehavioralItems = behaviorallist,
                AssignedKeyResultsItems = kralist,
                BehavioralFactors       = bfitems,
                KeyResultAreas          = kraitems,
                IsWithActiveSeason      = _Services.IsWithActiveSeason(),
                ActiveSeason            = season,
            };

            return(View(model));
        }