/// <summary> /// /// </summary> /// <param name="id">id == wg_jobtemlate - jobid</param> /// <returns></returns> public ActionResult EditList(string id) { MeasuresBLL mbll = new MeasuresBLL(); var meetingjoblist = workmeetingbll.GetJobs("", "", "", "", "").Where(x => x.TemplateId == id).Select(x => x.JobId).ToList(); var dangers = new DangerService().GetList("").ToList().Where(x => meetingjoblist.Contains(x.JobId)).ToList(); foreach (DangerEntity d in dangers) { var measures = mbll.GetMeasureList(d.Id).OrderBy(x => x.DangerSource); var dangertemplates = workmeetingbll.getdangertemplate(id).OrderBy(x => x.Dangerous); int i = 1; foreach (MeasuresEntity m in measures) { d.newdanger += "(" + i + ")." + m.DangerSource + "<br />"; d.newmeasure += "(" + i + ")." + m.Measure + "<br />"; i++; } i = 1; foreach (DangerTemplateEntity t in dangertemplates) { d.olddanger += "(" + i + ")." + t.Dangerous + "<br />"; d.oldmeasure += "(" + i + ")." + t.Measure + "<br />"; i++; } } ViewData["dangers"] = dangers; return(View()); }