private void showSAjobDetails(environment env) { rectProdDetails.Opacity = (env == environment.prod) ? 1d : 0.29d; rectTestDetails.Opacity = (env == environment.test) ? 1d : 0.29d; rectDevDetails.Opacity = (env == environment.dev) ? 1d : 0.29d; if ((dgSearchResults.SelectedIndex < 0) || (dgSearchResults.SelectedItem.ToString() == "{NewItemPlaceholder}")) { // clear the SA job steps return; } results r = ((results)dgSearchResults.SelectedItem); subresult sr = null; envInfo inf = null; string jobname = ""; if (env == environment.prod) { sr = r.prod; inf = prod; jobname = r.prod.SA; } if (env == environment.test) { sr = r.test; inf = test; jobname = r.test.SA; } if (env == environment.dev) { sr = r.dev; inf = dev; jobname = r.dev.SA; } List <jobInfo> ji = new List <jobInfo>(); foreach (DataRow drStep in inf.dtSteps.Rows) { if (drStep["job_id"].ToString() == sr.jobid) { string fontweight = (drStep["step_id"].ToString() == sr.stepid) ? "Bold" : "Normal"; ji.Add(new jobInfo() { Step = drStep["step_id"].ToString(), Type = drStep["subsystem"].ToString(), Description = drStep["step_name"].ToString(), Command = drStep["command"].ToString(), CommandWeight = fontweight, DescriptionWeight = fontweight, StepWeight = fontweight, TypeWeight = fontweight }); } } dgSASteps.ItemsSource = ji; }
public ActionResult getResult(string testno) { HPN_TESTRESULT testResult = (from x in _db.Set <HPN_TESTRESULT>() where x.TESTNO == testno select x).FirstOrDefault(); List <subresult> list = new List <subresult>(); HPN_TEMPLATE t = (from x in _db.Set <HPN_TEMPLATE>() where x.NAME == testResult.TEMPLATENAME select x).FirstOrDefault(); int templateType = 1; if (t != null) { templateType = (int)t.TYPE; } if (!string.IsNullOrEmpty(testResult.RESULT)) { list = testResult.RESULT.JsonDeserialize() as List <subresult>; } else { List <HPN_RESULTDESC> resultList = templateService.getResultDescByScore(testResult.TEMPLATENAME, testResult.RESULT.ToDouble(0)); if (resultList.Count <= 0) { subresult sr = new subresult(); sr.Score = testResult.RESULT.ToDouble(0); sr.RESULT = string.Empty; sr.Remark = string.Empty; list.Add(sr); } else { foreach (HPN_RESULTDESC result in resultList) { subresult sr = new subresult(); sr.Score = testResult.RESULT.ToDouble(0); sr.RESULT = result.RESULT; sr.Remark = result.RESULTDETAIL; list.Add(sr); } } } return(Json(new { Score = testResult.RESULT, Result = list, IsFinish = testResult.USERID == "0" ? true : false, TemplateType = templateType, UserId = testResult.USERID }, JsonRequestBehavior.AllowGet)); }
private void ShowSSISandROCspecifics(results r, DataTable jobs, DataTable steps, string filename, string loc, subresult sr) { foreach (DataRow drStep in steps.Rows) { if (parseSSISjob(drStep["command"].ToString()).ToUpper() == filename.ToUpper()) { foreach (DataRow drJob in jobs.Rows) { if ((drStep["subsystem"].ToString() == "SSIS") && (drJob["job_id"].ToString() == drStep["job_id"].ToString())) { sr.SA = drJob["name"].ToString(); sr.jobid = drJob["job_id"].ToString(); sr.stepid = drStep["step_id"].ToString(); foreach (DataRow drROC in dtProdROC.Rows) { if ((r.prod.SA != null) && (drROC["JobName"].ToString().ToUpper() == r.prod.SA.ToUpper())) { r.ROCProdJob = drROC["Description"].ToString(); } } foreach (DataRow drROC in dtTestROC.Rows) { if ((r.test.SA != null) && (drROC["JobName"].ToString().ToUpper() == r.test.SA.ToUpper())) { r.ROCTestJob = drROC["Description"].ToString(); } } } } } } dgSearchResults.ItemsSource = resultList; }