Esempio n. 1
0
 public bool AddStudentMarks(clsStudentMarks sm)
 {
     SqlParameter[] sp = new SqlParameter[6];
     sp[0] = new SqlParameter("@Student_ID",sm.Student_ID);
     sp[1] = new SqlParameter("@Course_ID",sm.Course_ID);
     sp[2] = new SqlParameter("@Subject_ID",sm.Subject_ID);
     sp[3] = new SqlParameter("@Exam_Date",sm.Exam_Date);
     sp[4] = new SqlParameter("@Faculty_ID",sm.Faculty_ID);
     sp[5] = new SqlParameter("@Obtained_Marks",sm.Obtained_Marks);
     return datalayer.Execute_NonQuery("sp_AddStudentMarks", CommandType.StoredProcedure, sp);
 }
Esempio n. 2
0
    //public void bindStudents(int Course_ID, int Class_ID)
    //{
    //    clsStudent stud = new clsStudent();
    //    DataSet ds = stud.listStudentByClassID(Course_ID, Class_ID);
    //    rpt_StudentMarks.DataSource = ds.Tables[0];
    //    rpt_StudentMarks.DataBind();
    //}
    protected void btnSaveMarks_Click(object sender, EventArgs e)
    {
        clsStudentMarks sm = new clsStudentMarks();
        sm.Course_ID = Convert.ToInt32(ddCourse.SelectedValue);
        sm.Subject_ID = Convert.ToInt32(ddSubject.SelectedValue);
        sm.Exam_Date = Convert.ToDateTime(txtExamDate.Text);

        if (rpt_StudentMarks.Items.Count > 0)
        {
            foreach (RepeaterItem i in rpt_StudentMarks.Items)
            {
                Label lblID = (Label)i.FindControl("lblStud_ID");
                sm.Student_ID = Convert.ToInt32(lblID.Text);
                TextBox tb = (TextBox)i.FindControl("txtStudentMarks");
                sm.Obtained_Marks = tb.Text;
                sm.AddStudentMarks(sm);
            }
        }
    }