Beispiel #1
0
    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();
    }
 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();
     }
 }
Beispiel #3
0
 private void updatescore(string Wid, int Wscore)
 {
     LearnSite.Model.Works work = new LearnSite.Model.Works();
     work.Wid =Int32.Parse( Wid);
     work.Wscore = Wscore;
     work.Wcheck = true;
     LearnSite.BLL.Works workbll = new LearnSite.BLL.Works();
     if (Wscore == 12)
     {
         workbll.WgoodBest(Int32.Parse(Wid));
     }
     else
     {
         workbll.WgoodNormal(Int32.Parse(Wid));
     }
     workbll.ScoreOneWork(work);
     System.Threading.Thread.Sleep(500);
     Labelmsg.Text = "编号为" + Wid + "的作品评分为" + Wscore + "分";
     showscore();
     GridViewScore.DataBind();
 }