protected void BtnScore_Click(object sender, EventArgs e) { if (DDLmission.SelectedValue != "") { int i = 0; DateTime time1 = DateTime.Now; string msg = " "; foreach (GridViewRow row in GridViewScore.Rows) { RadioButtonList RScore = (RadioButtonList)row.FindControl("RadioScore"); Label LbWid = (Label)row.FindControl("LabelWid"); int Wscore = Convert.ToInt32(RScore.SelectedValue); int Wid = Int32.Parse(LbWid.Text); LearnSite.BLL.Works onework = new LearnSite.BLL.Works(); onework.ScoreWork(Wid, Wscore); if (Wscore == 12) { onework.WgoodBest(Wid); } else { onework.WgoodNormal(Wid); } System.Threading.Thread.Sleep(100); msg = msg + " " + RScore.SelectedValue; i++; } Labeltest.Text = "顺序输出本页评价结果:" + msg; DateTime time2 = DateTime.Now; System.Threading.Thread.Sleep(1000); Labelmsg.Text = "成功评价" + i.ToString() + "个作品,花费" + LearnSite.Common.Computer.Datagone(time1, time2).ToString() + "秒"; showscore(); } }
protected void DataListworks_ItemCommand(object source, DataListCommandEventArgs e) { int Wscore = 0; int Wid = Int32.Parse(DataListworks.DataKeys[e.Item.ItemIndex].ToString()); LearnSite.BLL.Works ws = new LearnSite.BLL.Works(); if (e.CommandName == "G") { Wscore = 12; ws.WgoodBest(Wid); } else { if (e.CommandName == "A") { Wscore = 10; } if (e.CommandName == "P") { Wscore = 6; } if (e.CommandName == "E") { Wscore = 2; } ws.WgoodNormal(Wid); } ws.ScoreWork(Wid, Wscore); System.Threading.Thread.Sleep(500); ShowWorks(); }