Ejemplo n.º 1
0
 public ActionResult ImpactNonMoneyList(int id)
 {
     RiskImpactModelView vm = new RiskImpactModelView();
     vm.RiskImpact = db.RiskImpacts.Where(p => p.RiskId == id).FirstOrDefault();
     vm.RiskNonMoneyImpacts = db.RiskNonMoneyImpacts.Where(p => p.RiskId == id);
     return View(vm);
 }
Ejemplo n.º 2
0
        public ActionResult ImpactDetail(int id)
        {
            RiskImpact impact = db.RiskImpacts.Where(p=>p.RiskId==id).FirstOrDefault();
            if (impact == null)
            {
                impact = new RiskImpact();
                impact.RiskId = id;
                impact.IsMoneyImpact = true;
                impact.ImpactLevelId = Utils.IMPACTLEVEL1;
                db.RiskImpacts.AddObject(impact);
                db.SaveChanges();

                impact.Risk.ImpactLevelId = Utils.IMPACTLEVEL1;
                if (impact.Risk.ProbLevelId != null)
                    impact.Risk.RiskLevel = (int)impact.Risk.ProbLevelId * (int)impact.Risk.ImpactLevelId;
                db.SaveChanges();
            }
            RiskImpactModelView vm = new RiskImpactModelView();
            vm.RiskImpact = impact;
            vm.RiskNonMoneyImpacts = db.RiskNonMoneyImpacts.Where(p => p.RiskId == id);
            return View(vm);
        }