Ejemplo n.º 1
0
 protected void uiGridViewStudentResults_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EditResults")
     {
         int id = Convert.ToInt32(e.CommandArgument.ToString());
         CurrentResult = id;
         DBLayer db = new DBLayer();
         DataSet ds = new DataSet();
         ds = db.GetResult(id);
         if (ds.Tables[0].Rows.Count > 0)
         {
             uiDropDownListCourses.SelectedValue = ds.Tables[0].Rows[0]["CourseID"].ToString();
             uiTextBoxGrade.Text = ds.Tables[0].Rows[0]["Grade"].ToString();
             uiTextBoxEvaluation.Text = ds.Tables[0].Rows[0]["Evaluation"].ToString();
             uiRadioButtonListResult.Items[0].Selected = (bool)ds.Tables[0].Rows[0]["FirstHalfMidTerm"];
             uiRadioButtonListResult.Items[1].Selected = (bool)ds.Tables[0].Rows[0]["FirstHalfFinal"];
             uiRadioButtonListResult.Items[2].Selected = (bool)ds.Tables[0].Rows[0]["SecondHalfMidTerm"];
             uiRadioButtonListResult.Items[3].Selected = (bool)ds.Tables[0].Rows[0]["SecondHalfFinal"];
         }
         uiPanelCurrentStudents.Visible = false;
         uiPanelCurrent.Visible = true;
     }
     else if (e.CommandName == "DeleteResults")
     {
         int id = Convert.ToInt32(e.CommandArgument.ToString());
         CurrentResult = id;
         DBLayer db = new DBLayer();
         db.DeleteResult(id);
         uiPanelCurrentStudents.Visible = false;
         uiPanelCurrent.Visible = true;
         BindData();
     }
 }