Ejemplo n.º 1
0
 protected void GridViewScore_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     string Wid = e.CommandArgument.ToString();
     int Wscore=0;
     if (e.CommandName == "G")
     {
         Wscore = 12;
         updatescore(Wid, Wscore);
     }
     if (e.CommandName == "A")
     {
         Wscore = 10;
         updatescore(Wid, Wscore);
     }
     if (e.CommandName == "P")
     {
          Wscore = 6;
         updatescore(Wid, Wscore);
     }
     if (e.CommandName == "E")
     {
          Wscore = 2;
         updatescore(Wid, Wscore);
     }
     if (e.CommandName == "Del")
     {
         int index = Convert.ToInt32(Wid);
         int aWid = Convert.ToInt32(((GridView)sender).DataKeys[index].Values["Wid"].ToString());
         LearnSite.BLL.Works bll = new LearnSite.BLL.Works();
         bll.Delete(aWid);//删除一个作品记录
         System.Threading.Thread.Sleep(500);
         showscore();
         GridViewScore.DataBind();
     }
 }