protected void btnCommit_Click(object sender, EventArgs e) { IList<CY.CSTS.Core.Business.StimulationCriterionQuestion> stiQuaList = CY.CSTS.Core.Business.StimulationCriterionQuestion.GetAllStimulationCriterionQuestion(); for (int i = stiQuaList.Count - 1; i >= 0; i--) { if (stiQuaList[i].StimulationContentType != 2) { stiQuaList.RemoveAt(i); } } System.Web.UI.HtmlControls.HtmlInputText tb; for (int i = 0; i < stiQuaList.Count; i++) { tb = (System.Web.UI.HtmlControls.HtmlInputText)tableDetail.FindControl("tbScore" + (i + 1)); if (tb != null) { CY.CSTS.Core.Business.StimulationCriterionAnswer ans = CY.CSTS.Core.Business.StimulationCriterionAnswer.GetAnseerByQuest(stiQuaList[i].Id, id); if (ans != null) { CY.CSTS.Core.Business.StimulationCriterionAnswer ansScore; if (CY.CSTS.Core.Business.StimulationCriterionAnswer.GetAnseerByQuestNappIdNexpertId(stiQuaList[i].Id, id, U.Id) != null) { ansScore = CY.CSTS.Core.Business.StimulationCriterionAnswer.GetAnseerByQuestNappIdNexpertId(stiQuaList[i].Id, id, U.Id); } else { ansScore = new CY.CSTS.Core.Business.StimulationCriterionAnswer(); ansScore.QuestionID = ans.QuestionID; ansScore.ApplicationId = id; ansScore.Content = ans.Content; } int score = 0; if (int.TryParse(tb.Value, out score)) { ansScore.Credit = int.Parse(tb.Value); ansScore.ExpertID = U.Id; ansScore.Save(); } } } } CY.CSTS.Core.Business.StimulationApplicationForSubCenterAndCollaborateUnit crew = CY.CSTS.Core.Business.StimulationApplicationForSubCenterAndCollaborateUnit.Load(id); if (crew != null) { int totlescore = 0; IList<CY.CSTS.Core.Business.StimulationCriterionAnswer> ansList = CY.CSTS.Core.Business.StimulationCriterionAnswer.SelectStimulationCriterionAnswerDynamic("[ApplicationId]='" + crew.Id + "'", ""); if (ansList != null) { for (int i = 0; i < ansList.Count; i++) { if (ansList[i] != null) { totlescore += ansList[i].Credit; } } } if ((ansList.Count / 15 - 1) != 0) { totlescore = totlescore / ((ansList.Count / 15) - 1); crew.Score = totlescore; crew.Save(); } CY.CSTS.Core.Business.Check check = CY.CSTS.Core.Business.Check.SelectByAppIdAndTypeAndExpId(id, 5, U.Id); if (check == null) { check = new CY.CSTS.Core.Business.Check(); } if (!string.IsNullOrEmpty(tbAuditDes.Text)) { check.AuditDes = tbAuditDes.Text.ToString(); check.AuditPerson = U.Id; check.ApplicationID = id; check.AuditType = 5; check.AuditTime = System.DateTime.Now; check.Save(); } } }
protected void bindTable(Guid expertId) { lbAuditDes.InnerText = ""; IList<CY.CSTS.Core.Business.StimulationCriterionQuestion> stiQuaList = CY.CSTS.Core.Business.StimulationCriterionQuestion.GetAllStimulationCriterionQuestion(); for (int i = stiQuaList.Count - 1; i >= 0; i--) { if (stiQuaList[i].StimulationContentType != 3 || stiQuaList[i].Index > 13) { stiQuaList.RemoveAt(i); } } IList<CY.CSTS.Core.Business.StimulationCriterionAnswer> stianswerlist = new List<CY.CSTS.Core.Business.StimulationCriterionAnswer>(); int totleScore = 0; for (int i = 0; i < stiQuaList.Count; i++) { CY.CSTS.Core.Business.StimulationCriterionAnswer ans = new CY.CSTS.Core.Business.StimulationCriterionAnswer(); ans = CY.CSTS.Core.Business.StimulationCriterionAnswer.GetAnseerByQuestNappIdNexpertId(stiQuaList[i].Id, idCoorExpertScore, expertId); if (ans == null) { ans = new CY.CSTS.Core.Business.StimulationCriterionAnswer(); } stianswerlist.Add(ans); totleScore += ans.Credit; } lbtotleScore.Text = totleScore.ToString(); lab_usetime.Text = stianswerlist[0].Content; lab_value.Text = stianswerlist[1].Content; lab_external.Text = stianswerlist[2].Content; lab_sample.Text = stianswerlist[3].Content; lab_income.Text = stianswerlist[4].Content; lab_project.Text = stianswerlist[5].Content; lab_litigate.Text = stianswerlist[6].Content; lab_affiche.Text = stianswerlist[7].Content; lab_log.Text = stianswerlist[8].Content; lab_case.Text = stianswerlist[9].Content; lab_collection.Text = stianswerlist[10].Content; lab_achievement.Text = stianswerlist[11].Content; lab_thesis.Text = stianswerlist[12].Content; lb_usetime.Text = stianswerlist[0].Credit.ToString(); lb_value.Text = stianswerlist[1].Credit.ToString(); lb_external.Text = stianswerlist[2].Credit.ToString(); lb_sample.Text = stianswerlist[3].Credit.ToString(); lb_income.Text = stianswerlist[4].Credit.ToString(); lb_project.Text = stianswerlist[5].Credit.ToString(); lb_litigate.Text = stianswerlist[6].Credit.ToString(); lb_affiche.Text = stianswerlist[7].Credit.ToString(); lb_log.Text = stianswerlist[8].Credit.ToString(); lb_case.Text = stianswerlist[9].Credit.ToString(); lb_collection.Text = stianswerlist[10].Credit.ToString(); lb_achievement.Text = stianswerlist[11].Credit.ToString(); lb_thesis.Text = stianswerlist[12].Credit.ToString(); CY.CSTS.Core.Business.Check check = CY.CSTS.Core.Business.Check.SelectByAppIdAndTypeAndExpId(idCoorExpertScore, 5, expertId); if (check != null) { lbAuditDes.InnerText = check.AuditDes; } }
protected void btnCommit_Click(object sender, EventArgs e) { IList<CY.CSTS.Core.Business.StimulationCriterionQuestion> stiQuaList = CY.CSTS.Core.Business.StimulationCriterionQuestion.GetAllStimulationCriterionQuestion(); for (int i = stiQuaList.Count - 1; i >= 0; i--) { if (stiQuaList[i].StimulationContentType != 2 || stiQuaList[i].Index > 12) { stiQuaList.RemoveAt(i); } } System.Web.UI.WebControls.Label lb; System.Web.UI.HtmlControls.HtmlInputText tb; for (int i = 0; i < stiQuaList.Count; i++) { tb = (System.Web.UI.HtmlControls.HtmlInputText)tableDetail.FindControl("tbScore" + (i + 1)); if (tb != null) { CY.CSTS.Core.Business.StimulationCriterionAnswer ans = CY.CSTS.Core.Business.StimulationCriterionAnswer.GetAnseerByQuest(stiQuaList[i].Id, id); if (ans != null) { lb = (System.Web.UI.WebControls.Label)tableDetail.FindControl("lbRow" + (i + 1)); if (lb != null) { lb.Text = ans.Content; } CY.CSTS.Core.Business.StimulationCriterionAnswer ansScore; if (CY.CSTS.Core.Business.StimulationCriterionAnswer.GetAnseerByQuestNappIdNexpertId(stiQuaList[i].Id, id, U.Id) != null) { ansScore = CY.CSTS.Core.Business.StimulationCriterionAnswer.GetAnseerByQuestNappIdNexpertId(stiQuaList[i].Id, id, U.Id); } else { ansScore = new CY.CSTS.Core.Business.StimulationCriterionAnswer(); ansScore.QuestionID = ans.QuestionID; ansScore.ApplicationId = id; ansScore.Content = ans.Content; } int score = 0; if (int.TryParse(tb.Value, out score)) { ansScore.Credit = int.Parse(tb.Value); ansScore.ExpertID = U.Id; ansScore.Save(); } } else { ans = CY.CSTS.Core.Business.StimulationCriterionAnswer.GetAnseerByQuest(stiQuaList[i].Id, id); if (ans != null) { lb = (System.Web.UI.WebControls.Label)tableDetail.FindControl("lbRow" + (i + 1)); if (lb != null) { lb.Text = ans.Content; } } } } } CY.CSTS.Core.Business.StimulationApplicationForSubCenterAndCollaborateUnit crew = CY.CSTS.Core.Business.StimulationApplicationForSubCenterAndCollaborateUnit.Load(id); if (crew != null) { int totlescore = 0; IList<CY.CSTS.Core.Business.StimulationCriterionAnswer> ansList = CY.CSTS.Core.Business.StimulationCriterionAnswer.SelectStimulationCriterionAnswerDynamic("[ApplicationId]='" + crew.Id + "'", ""); if (ansList != null) { for (int i = 0; i < ansList.Count; i++) { if (ansList[i] != null) { totlescore += ansList[i].Credit; } } } if ((ansList.Count / 12 - 1) != 0) { totlescore = totlescore / ((ansList.Count / 12) - 1); crew.Score = totlescore; crew.Save(); } } }