//统计每个调查申请单的结果明细 public List <V_SatisfactionResult> Result_SurveyByRequireID(string id) { List <V_SatisfactionResult> lstSub = new List <V_SatisfactionResult>(); var v = from ent in dal.GetObjects <T_OA_REQUIRERESULT>() where ent.T_OA_REQUIRE.REQUIREID == id select ent; var subkeys = from ent in v group ent by ent.SUBJECTID into e select e; foreach (var i in subkeys) { V_SatisfactionResult sub = new V_SatisfactionResult(); List <V_SSubjectAnswerResult> lstAnswer = new List <V_SSubjectAnswerResult>(); var v2 = from ent in v where ent.SUBJECTID == i.Key select ent; var answerKeys = from ent in v2 where ent.SUBJECTID == i.Key group ent by ent.RESULT into e select e; foreach (var j in answerKeys) { V_SSubjectAnswerResult info = new V_SSubjectAnswerResult(); var v3 = (from ent in v2 where ent.RESULT == j.Key select ent).Count(); info.AnswerCode = j.Key; info.Count = int.Parse(v3.ToString()); lstAnswer.Add(info); } //sub.SubjectID = i.Key; sub.LstAnswer = lstAnswer; lstSub.Add(sub); } return(lstSub); }
void Result_ESurveyByRequireIDCompleted(object sender, Result_ESurveyByRequireIDCompletedEventArgs e) { if (e.Result != null) { _osubAnswerResult = e.Result; txbTitle.Text = _Survey.RequireMaster.REQUIRETITLE; txbContent.Text = _Survey.RequireMaster.CONTENT; foreach (V_EmployeeSurveySubject subInfo in _Survey.SubjectViewList) { V_SatisfactionResult v = _osubAnswerResult.FirstOrDefault(ee => ee.SubjectID == subInfo.SubjectInfo.SUBJECTID); SurveyShowList_1 subjectItem = new SurveyShowList_1(); subjectItem.SubjectViewInfo = subInfo; subjectItem._SubAnswerResult = v; spSurveysList.Children.Add(subjectItem); } } }
void Result_SurveyByRequireIDCompleted(object sender, Result_SurveyByRequireIDCompletedEventArgs e) { if (e.Result != null) { _osubAnswerResult = e.Result; foreach (T_OA_SATISFACTIONDETAIL subInfo in EmployeeSurveyInfo.SubjectViewList) { V_SatisfactionResult v = _osubAnswerResult.FirstOrDefault(ee => ee.SubjectID == subInfo.SUBJECTID); SurveyShowList_sat_1 subjectItem = new SurveyShowList_sat_1(SumResult); subjectItem.SubjectViewInfo = subInfo; subjectItem.oanswer = _oanswer; subjectItem.SubAnswerResult = v; subjectItem.AnswerID = distribute.ANSWERID; subjectItem.PercentAge = Convert.ToDecimal(distribute.PERCENTAGE); spSurveysList.Children.Add(subjectItem); } } loadbar.Stop(); }