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 != 3) { stiQuaList.RemoveAt(i); } } System.Web.UI.HtmlControls.HtmlInputText tb; for (int i = 0; i < stiQuaList.Count; i++) { tb = (System.Web.UI.HtmlControls.HtmlInputText)divTable.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.StimulationApplicationForCrew crew = CY.CSTS.Core.Business.StimulationApplicationForCrew.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 / 13 - 1) != 0) { totlescore = totlescore / ((ansList.Count / 13) - 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() { List<StimulationCriterionQuestion> questlist = StimulationCriterionQuestion.GetAllStimulationCriterionQuestion() as List<StimulationCriterionQuestion>; questlist = questlist.Where(Item => Item.StimulationContentType == 3).ToList(); List<StimulationCriterionAnswer> stianswerlist = new List<StimulationCriterionAnswer>(); for (int i = 0; i < questlist.Count; i++) { CY.CSTS.Core.Business.StimulationCriterionAnswer ans = new CY.CSTS.Core.Business.StimulationCriterionAnswer(); ans = CY.CSTS.Core.Business.StimulationCriterionAnswer.GetAnseerByQuestNappIdNexpertId(questlist[i].Id, id, U.Id); if (ans == null) { //this.SubmitApp.Visible = false; ans = CY.CSTS.Core.Business.StimulationCriterionAnswer.GetAnseerByQuest(questlist[i].Id, id); if (ans == null) { ans = new StimulationCriterionAnswer(); } } stianswerlist.Add(ans); } int count = stianswerlist.Count; if (count >= 1) { lab_usetime.Text = stianswerlist[0].Content; if (stianswerlist[0].Credit != 0) { tbScore1.Value = stianswerlist[0].Credit.ToString(); } } if (count >= 2) { lab_value.Text = stianswerlist[1].Content; if (stianswerlist[1].Credit != 0) { tbScore2.Value = stianswerlist[1].Credit.ToString(); } } if (count >= 3) { lab_external.Text = stianswerlist[2].Content; if (stianswerlist[2].Credit != 0) { tbScore3.Value = stianswerlist[2].Credit.ToString(); } } if (count >= 4) { lab_sample.Text = stianswerlist[3].Content; if (stianswerlist[3].Credit != 0) { tbScore4.Value = stianswerlist[3].Credit.ToString(); } } if (count >= 5) { lab_income.Text = stianswerlist[4].Content; if (stianswerlist[4].Credit != 0) { tbScore5.Value = stianswerlist[4].Credit.ToString(); } } if (count >= 6) { lab_project.Text = stianswerlist[5].Content; if (stianswerlist[5].Credit != 0) { tbScore6.Value = stianswerlist[5].Credit.ToString(); } } if (count >= 7) { lab_litigate.Text = stianswerlist[6].Content; if (stianswerlist[6].Credit != 0) { tbScore7.Value = stianswerlist[6].Credit.ToString(); } } if (count >= 8) { lab_affiche.Text = stianswerlist[7].Content; if (stianswerlist[7].Credit != 0) { tbScore8.Value = stianswerlist[7].Credit.ToString(); } } if (count >= 9) { lab_log.Text = stianswerlist[8].Content; if (stianswerlist[8].Credit != 0) { tbScore9.Value = stianswerlist[8].Credit.ToString(); } } if (count >= 10) { lab_case.Text = stianswerlist[9].Content; if (stianswerlist[9].Credit != 0) { tbScore10.Value = stianswerlist[9].Credit.ToString(); } } if (count >= 11) { lab_collection.Text = stianswerlist[10].Content; if (stianswerlist[10].Credit != 0) { tbScore11.Value = stianswerlist[10].Credit.ToString(); } } if (count >= 12) { lab_achievement.Text = stianswerlist[11].Content; if (stianswerlist[11].Credit != 0) { tbScore12.Value = stianswerlist[11].Credit.ToString(); } } if (count >= 13) { lab_thesis.Text = stianswerlist[12].Content; if (stianswerlist[12].Credit != 0) { tbScore13.Value = stianswerlist[12].Credit.ToString(); } } CY.CSTS.Core.Business.Check check = CY.CSTS.Core.Business.Check.SelectByAppIdAndTypeAndExpId(id, 5, U.Id); if (check != null) { tbAuditDes.Text = 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 != 1) { 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(); } } } } }