// [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)); }
public ActionResult Create() { List <Company> companyList = new List <Company>(); List <Department> departmentlist = new List <Department>(); List <RiskType> riskTypeList = new List <RiskType>(); companyList = _company.AllCompanies().ToList(); companyList.Insert(0, new Company { Id = 0, Name = "Select" }); departmentlist = _department.AllDepartments().ToList(); departmentlist.Insert(0, new Department { Id = 0, Name = "Select" }); riskTypeList = _riskType.AllRiskTypes().ToList(); riskTypeList.Insert(0, new RiskType { Id = 0, Name = "Select" }); ViewBag.CompanyDetails = companyList; ViewBag.DepartmentDetails = departmentlist; ViewBag.RiskTypeDetails = riskTypeList; return(View()); }
public IActionResult Entry() { // view bag values for the front end ViewBag.CompanyCount = _company.AllCompanies().Count(); ViewBag.DepartmentCount = _department.AllDepartments().Count(); ViewBag.RiskTypeCount = _riskType.AllRiskTypes().Count(); ViewBag.RegisteredRisks = _registerRisk.AllRiskRegisters().Count(); return(View()); }
public ActionResult Details(int id) { //var _registerRisks = _registerRisk.AllRiskRegisters(); var _riskTypes = _riskType.AllRiskTypes(); var _result = _registerRisk.GetRiskRegister(id); var _returnView = _riskType.AllRiskTypes().Where(t => t.Id == _result.RiskTypeId).FirstOrDefault(); var registerVM = new RegisterRiskVM() { Id = _result.Id, Activity = _result.Activity, InherentRisk = _result.InherentRisk, LoggedBy = _result.LoggedBy, RiskTypeName = _returnView.Name, Mitigants = _result.Mitigants, DateCreated = _result.DateCreated }; return(View(registerVM)); }
// GET: RiskType public ActionResult Index() { var _riskTypes = _riskType.AllRiskTypes(); return(View(_riskTypes)); }