protected void UpdateMarks(object sender, EventArgs e) { foreach (GridViewRow row in GridView2.Rows) { if (row.RowType == DataControlRowType.DataRow) { CheckBox Status = row.FindControl("Status") as CheckBox; bool IsPresent = Status.Checked ? true : false; string Marks = (row.FindControl("Marks") as TextBox).Text.Trim(); string SchoolID = (row.FindControl("SchoolID") as Label).Text.Trim(); string StudentName = (row.FindControl("StudentName") as Label).Text.Trim(); DBHandler.DBHandler db = new DBHandler.DBHandler(con); Entities.StudentExam s1 = new Entities.StudentExam() { pKId = SchoolID, examDate = DropDownList4.SelectedValue, isPresent = IsPresent, obtainedMarks = Convert.ToDecimal(Marks), subjectName = DropDownList3.SelectedValue, }; db.AddStudentExam(s1); } } Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('UpdateMarks')", true); }
private void Details() { DBHandler.DBHandler db = new DBHandler.DBHandler(con); Entities.StudentExam t1 = new Entities.StudentExam() { pKId = Session["School"].ToString(), }; Entities.Class c1 = new Entities.Class() { className = "Class 5", }; Entities.ExamType e1 = new Entities.ExamType() { examType = "Mid term", }; DataSet ds = new DataSet(); ds = db.Graph(t1, c1, e1); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string sub; string per; sub = ds.Tables[0].Rows[i]["subjectName"].ToString(); per = ds.Tables[0].Rows[i]["Percentage"].ToString(); chartData = chartData + sub + "-" + per + "$"; } Response.Write(chartData); } }
public void AddStudentExam(Entities.StudentExam c1) { using (WSqlCommand s1 = new WSqlCommand(dbconstring, "[dbo].[spAddStudentMarks]")) { s1.AddParameter("@subjectName", System.Data.SqlDbType.NVarChar, c1.subjectName); s1.AddParameter("@examDate", System.Data.SqlDbType.Date, c1.examDate); s1.AddParameter("@obtainedMarks", System.Data.SqlDbType.Real, c1.obtainedMarks); s1.AddParameter("@ispresent", System.Data.SqlDbType.Bit, c1.isPresent); s1.AddParameter("@pkid", System.Data.SqlDbType.NVarChar, c1.pKId); s1.Execute(); } }
public DataSet Graph(Entities.StudentExam c1, Entities.Class c2, Entities.ExamType e1) { DataSet ds; using (WSqlCommand dbCom = new WSqlCommand(dbconstring, "[dbo].[spSelectStudentMarks]")) { dbCom.AddParameter("@studentId", SqlDbType.NVarChar, c1.pKId); dbCom.AddParameter("@className", SqlDbType.NVarChar, c2.className); dbCom.AddParameter("@examType", SqlDbType.NVarChar, e1.examType); ds = new DataSet(); ds = dbCom.Execute(); } return(ds); }
protected void ShowMarks(object sender, EventArgs e) { DBHandler.DBHandler db = new DBHandler.DBHandler(con); Entities.StudentExam t1 = new Entities.StudentExam() { pKId = Session["School"].ToString(), }; Entities.Class c1 = new Entities.Class() { className = DropDownList3.SelectedValue, }; Entities.ExamType e1 = new Entities.ExamType() { examType = DropDownList4.SelectedValue, }; DataSet ds = new DataSet(); ds = db.Graph(t1, c1, e1); GridView7.DataSource = ds; GridView7.DataBind(); Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('ProgrssStudent')", true); }
protected void UpdateMarks(object sender, EventArgs e) { foreach (GridViewRow row in GridView2.Rows) { if (row.RowType == DataControlRowType.DataRow) { CheckBox Status = row.FindControl("Status") as CheckBox; bool IsPresent = Status.Checked ? true : false; string Marks = (row.FindControl("Marks") as TextBox).Text.Trim(); string SchoolID = (row.FindControl("SchoolID") as Label).Text.Trim(); string StudentName = (row.FindControl("StudentName") as Label).Text.Trim(); DBHandler.DBHandler db = new DBHandler.DBHandler(con); Entities.StudentExam s1 = new Entities.StudentExam() { pKId = SchoolID, examDate = DropDownList4.SelectedValue, isPresent = IsPresent, obtainedMarks = Convert.ToDecimal(Marks), subjectName=DropDownList3.SelectedValue, }; db.AddStudentExam(s1); } } Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('UpdateMarks')", true); }