// [Route("/ErrorRegister")]
        // GET: ErrorRegister
        public ActionResult Index()
        {
            var userId = User.Identity.Name;

            //var loggedInUser = _appUserService.GetAppUser(t => t.Id == userId).FirstOrDefault();

            var _returnRegisters = _errorRegister.AllErrorRegisters();
            var _companyList     = _company.AllCompanies();
            var _departmentList  = _department.AllDepartments();
            var _riskList        = _riskType.AllRiskTypes();

            var query = from errors in _returnRegisters
                        join companylist in _companyList on errors.CompanyId equals companylist.Id
                        join departmentlist in _departmentList on errors.DepartmentId equals departmentlist.Id
                        join risklist in _riskList on errors.RiskTypeId equals risklist.Id
                        select new ErrorRegisterVM
            {
                Id          = errors.Id,
                DateCreated = errors.DateCreated,
                ErrorType   = errors.ErrorType,
                Narration   = errors.Narration,
                Officer     = errors.Officer,
                Status      = errors.Status,
                ErrorStatus = errors.ErrorStatus,
                Remark      = errors.Remark,
                RiskType    = risklist.Name,
                Company     = companylist.Name,
                Department  = departmentlist.Name,
                DateUpdated = errors.DateUpdated,
                UpdatedBy   = userId
            };

            return(View(query));
        }
Пример #2
0
        // GET: ErrorRegister
        public ActionResult Index()
        {
            var _returnRegisters = _errorRegister.AllErrorRegisters();

            return(View(_returnRegisters));
        }