protected void AssignHomeWork(object sender, EventArgs e) { Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('AssignHomeWork')", true); if (Page.IsValid) { Stream str = FileUpload1.PostedFile.InputStream; BinaryReader br = new BinaryReader(str); Byte[] size = br.ReadBytes((int)str.Length); DBHandler.DBHandler db = new DBHandler.DBHandler(con); Entities.Notes n1 = new Entities.Notes() { teacher = Session["School"].ToString(), date = DateTime.Now.ToShortDateString(), fileName = Path.GetFileName(FileUpload1.PostedFile.FileName), dataFile = size, description = TextArea1.Value, noteType = "Assignment", }; Entities.Section s1 = new Entities.Section() { sectionName = DropDownList2.SelectedValue, }; Entities.Class c1 = new Entities.Class() { className = DropDownList1.SelectedValue, }; Entities.Subjects s2 = new Entities.Subjects() { subjectName = DropDownList3.SelectedValue, }; db.AddNotes(n1, s2, s1, c1); TextArea1.Value = " "; } }
protected void AssignTest(object sender, EventArgs e) { Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('UpcomingTest')", true); if (Page.IsValid) { DBHandler.DBHandler db = new DBHandler.DBHandler(con); Entities.Notes n1 = new Entities.Notes() { teacher = Session["School"].ToString(), date = DateTime.Now.ToShortDateString(), description = TextArea2.Value, noteType = "Quiz", }; Entities.Section s1 = new Entities.Section() { sectionName = DropDownList5.SelectedValue, }; Entities.Class c1 = new Entities.Class() { className = DropDownList4.SelectedValue, }; Entities.Subjects s2 = new Entities.Subjects() { subjectName = DropDownList6.SelectedValue, }; db.AddNotes(n1, s2, s1, c1); TextArea2.Value = " "; } }
protected void UpdateCoursePlan(object sender, EventArgs e) { Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('CourseProgress')", true); if (Page.IsValid) { DBHandler.DBHandler db = new DBHandler.DBHandler(con); Entities.CoursePlan cc1 = new Entities.CoursePlan() { year = DateTime.Now.Year.ToString(), Goal = Goal.Value, progressId = DropDownList7.SelectedIndex + 1, }; Entities.Section s1 = new Entities.Section() { sectionName = DropDownList10.SelectedValue, }; Entities.Class c1 = new Entities.Class() { className = DropDownList8.SelectedValue, }; Entities.Subjects s2 = new Entities.Subjects() { subjectName = DropDownList9.SelectedValue, }; Entities.personalInfo p1 = new Entities.personalInfo() { pKId = Session["School"].ToString(), }; db.CoursePlan(cc1, s2, s1, c1, p1); } }
protected void AssignTeacher(object sender, EventArgs e) { DBHandler.DBHandler db = new DBHandler.DBHandler(con); Entities.Section s3 = new Entities.Section() { sectionName = SectionDropDown.SelectedValue, }; Entities.personalInfo p1 = new Entities.personalInfo() { pKId = Session["School"].ToString(), }; Entities.personalInfo p2 = new Entities.personalInfo() { pKId = TeacherDropDown.SelectedValue, }; Entities.Class c1 = new Entities.Class() { className = ClassDropDown.SelectedValue, }; Entities.Subjects s2 = new Entities.Subjects() { subjectName = SubjectDropDown.SelectedValue, }; db.AssignCourses(s3, p1, p2, c1, s2); GridView2.DataBind(); UpdatePanel1.Update(); Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('AssignCourses')", true); }
protected void UpdateAttendance(object sender, EventArgs e) { foreach (GridViewRow row in GridView2.Rows) { if (row.RowType == DataControlRowType.DataRow) { CheckBox Status = row.FindControl("Status") as CheckBox; bool attendanceStatus = Status.Checked ? true : false; CheckBox Status1 = row.FindControl("Status1") as CheckBox; bool smiles = Status1.Checked ? true : false; string pKId = (row.FindControl("SchoolID") as Label).Text.Trim(); DBHandler.DBHandler db = new DBHandler.DBHandler(con); Entities.Subjects s1 = new Entities.Subjects() { subjectName = DropDownList3.SelectedValue, }; Entities.SAttendance s2 = new Entities.SAttendance() { pKId = pKId, Sdate = TextBox1.Text, attendance = attendanceStatus, smilies = smiles, }; db.InsertStudentAttendance(s2, s1); } } Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('SAttendance')", true); }
protected void UpdateAttendance(object sender, EventArgs e) { foreach (GridViewRow row in GridView2.Rows) { if (row.RowType == DataControlRowType.DataRow) { CheckBox Status = row.FindControl("Status") as CheckBox; bool attendanceStatus = Status.Checked ? true : false; CheckBox Status1 = row.FindControl("Status1") as CheckBox; bool smiles = Status1.Checked ? true : false; string pKId = (row.FindControl("SchoolID") as Label).Text.Trim(); DBHandler.DBHandler db = new DBHandler.DBHandler(con); Entities.Subjects s1 = new Entities.Subjects() { subjectName=DropDownList3.SelectedValue, }; Entities.SAttendance s2 = new Entities.SAttendance() { pKId=pKId, Sdate = TextBox1.Text, attendance=attendanceStatus, smilies=smiles, }; db.InsertStudentAttendance(s2,s1); } } Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('SAttendance')", true); }
public void AddCourse(Entities.Subjects c1) { using (WSqlCommand s1 = new WSqlCommand(dbconstring, "[dbo].[spAddSubject]")) { s1.AddParameter("@subjectId", System.Data.SqlDbType.NVarChar, c1.subjectId); s1.AddParameter("@subjectName", System.Data.SqlDbType.NVarChar, c1.subjectName); s1.Execute(); } }
public void InsertStudentAttendance(Entities.SAttendance a1, Entities.Subjects c1) { using (WSqlCommand s1 = new WSqlCommand(dbconstring, "[dbo].[spInsertStudentAttendance]")) { s1.AddParameter("@pkid", System.Data.SqlDbType.NVarChar, a1.pKId); s1.AddParameter("@subjectName", System.Data.SqlDbType.NVarChar, c1.subjectName); s1.AddParameter("@Sdate", System.Data.SqlDbType.Date, a1.Sdate); s1.AddParameter("@attendance", System.Data.SqlDbType.Bit, a1.attendance); s1.AddParameter("@smilies", System.Data.SqlDbType.Bit, a1.smilies); s1.Execute(); } }
public void AddExamDate(Entities.ExamDate c1, Entities.Subjects s2, Entities.Section s3, Entities.Class c2, Entities.personalInfo p1, Entities.ExamType e1) { using (WSqlCommand s1 = new WSqlCommand(dbconstring, "[dbo].[spInsertExamDate]")) { s1.AddParameter("@subjectName", System.Data.SqlDbType.NVarChar, s2.subjectName); s1.AddParameter("@sectionName", System.Data.SqlDbType.NVarChar, s3.sectionName); s1.AddParameter("@className", System.Data.SqlDbType.NVarChar, c2.className); s1.AddParameter("@examTypeId", System.Data.SqlDbType.NVarChar, e1.examTypeId); s1.AddParameter("@iAm", System.Data.SqlDbType.NVarChar, p1.pKId); s1.AddParameter("@examDate", System.Data.SqlDbType.Date, c1.examDate); s1.AddParameter("@totalMarks", System.Data.SqlDbType.Int, c1.totalMarks); s1.Execute(); } }
public void CoursePlan(Entities.CoursePlan c1, Entities.Subjects s2, Entities.Section s3, Entities.Class c2, Entities.personalInfo p1) { using (WSqlCommand s1 = new WSqlCommand(dbconstring, "[dbo].[spInsertCourseProgress]")) { s1.AddParameter("@subjectName", System.Data.SqlDbType.NVarChar, s2.subjectName); s1.AddParameter("@sectionName", System.Data.SqlDbType.NVarChar, s3.sectionName); s1.AddParameter("@className", System.Data.SqlDbType.NVarChar, c2.className); s1.AddParameter("@pKId", System.Data.SqlDbType.NVarChar, p1.pKId); s1.AddParameter("@progressId", System.Data.SqlDbType.Int, c1.progressId); s1.AddParameter("@year", System.Data.SqlDbType.NVarChar, c1.year); s1.AddParameter("@goal", System.Data.SqlDbType.NVarChar, c1.Goal); s1.Execute(); } }
public void AddNotes(Entities.Notes c1, Entities.Subjects s2, Entities.Section s3, Entities.Class c2) { using (WSqlCommand s1 = new WSqlCommand(dbconstring, "[dbo].[spAddNotes]")) { s1.AddParameter("@subjectName", System.Data.SqlDbType.NVarChar, s2.subjectName); s1.AddParameter("@sectionName", System.Data.SqlDbType.NVarChar, s3.sectionName); s1.AddParameter("@className", System.Data.SqlDbType.NVarChar, c2.className); s1.AddParameter("@teacher", System.Data.SqlDbType.NVarChar, c1.teacher); s1.AddParameter("@noteType", System.Data.SqlDbType.NVarChar, c1.noteType); s1.AddParameter("@assignDate", System.Data.SqlDbType.Date, c1.date); s1.AddParameter("@fileName", System.Data.SqlDbType.NVarChar, c1.fileName); s1.AddParameter("@dataFile", System.Data.SqlDbType.VarBinary, c1.dataFile); s1.AddParameter("@description", System.Data.SqlDbType.NVarChar, c1.description); s1.Execute(); } }
protected void AddCourse(object sender, EventArgs e) { Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('Courses')", true); if (Page.IsValid) { DBHandler.DBHandler db = new DBHandler.DBHandler(con); Entities.Subjects t1 = new Entities.Subjects() { subjectId = CourseId.Value, subjectName = CourseName.Value, }; db.AddCourse(t1); GridView2.DataBind(); UpdatePanel4.Update(); TecherSection1.UpdateCourse(); ExamDate1.UpdateCourse(); } }
protected void AddExamDate(object sender, EventArgs e) { Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('ExamDate')", true); if (Page.IsValid) { DBHandler.DBHandler db = new DBHandler.DBHandler(con); Entities.ExamDate cc1 = new Entities.ExamDate() { examDate = EDate.Text, totalMarks = Convert.ToInt32(TotalMarks.Value), }; Entities.Section s1 = new Entities.Section() { sectionName = DropDownList2.SelectedValue, }; Entities.Class c1 = new Entities.Class() { className = DropDownList1.SelectedValue, }; Entities.Subjects s2 = new Entities.Subjects() { subjectName = DropDownList3.SelectedValue, }; Entities.personalInfo p1 = new Entities.personalInfo() { pKId = Session["School"].ToString(), }; Entities.ExamType e1 = new Entities.ExamType() { examTypeId = DropDownList4.SelectedValue, }; db.AddExamDate(cc1, s2, s1, c1, p1, e1); GridView1.DataBind(); UpdatePanel1.Update(); } }
protected void ShowAttendance(object sender, EventArgs e) { DBHandler.DBHandler db = new DBHandler.DBHandler(con); Entities.personalInfo p1 = new Entities.personalInfo() { pKId = Session["School"].ToString(), }; Entities.Subjects s2 = new Entities.Subjects() { subjectName = DropDownList2.SelectedValue, }; Entities.SAttendance s1 = new Entities.SAttendance() { Sdate = DropDownList1.SelectedValue, }; DataSet ds = new DataSet(); ds = db.ShowStudentAttendacne(p1, s1, s2); GridView4.DataSource = ds; GridView4.DataBind(); Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('Attendance')", true); }
protected void AssignTeacher(object sender, EventArgs e) { DBHandler.DBHandler db = new DBHandler.DBHandler(con); Entities.Section s3 = new Entities.Section() { sectionName = SectionDropDown.SelectedValue, }; Entities.personalInfo p1 = new Entities.personalInfo() { pKId = Session["School"].ToString(), }; Entities.personalInfo p2 = new Entities.personalInfo() { pKId = TeacherDropDown.SelectedValue, }; Entities.Class c1 = new Entities.Class() { className = ClassDropDown.SelectedValue, }; Entities.Subjects s2 = new Entities.Subjects() { subjectName = SubjectDropDown.SelectedValue, }; db.AssignCourses(s3,p1,p2,c1,s2); GridView2.DataBind(); UpdatePanel1.Update(); Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('AssignCourses')", true); }
public DataSet ShowStudentAttendacne(Entities.personalInfo p1, Entities.SAttendance s1, Entities.Subjects s2) { DataSet ds; using (WSqlCommand dbCom = new WSqlCommand(dbconstring, "[dbo].[spShowAttandus]")) { dbCom.AddParameter("@iAm", System.Data.SqlDbType.NVarChar, p1.pKId); dbCom.AddParameter("@subjectName", System.Data.SqlDbType.NVarChar, s2.subjectName); dbCom.AddParameter("@month", System.Data.SqlDbType.NVarChar, s1.Sdate); dbCom.AddOutputParameter("@smilies", System.Data.SqlDbType.Int); dbCom.AddOutputParameter("@sad", System.Data.SqlDbType.Int); dbCom.AddOutputParameter("@presents", System.Data.SqlDbType.Int); dbCom.AddOutputParameter("@absents", System.Data.SqlDbType.Int); ds = new DataSet(); ds = dbCom.Execute(); } return(ds); }
public void AssignCourses(Entities.Section s3, Entities.personalInfo p1, Entities.personalInfo p2, Entities.Class c1, Entities.Subjects s2) { using (WSqlCommand s1 = new WSqlCommand(dbconstring, "[dbo].[spAssignTeacher]")) { s1.AddParameter("@subjectName", System.Data.SqlDbType.NVarChar, s2.subjectName); s1.AddParameter("@sectionName", System.Data.SqlDbType.NVarChar, s3.sectionName); s1.AddParameter("@className", System.Data.SqlDbType.NVarChar, c1.className); s1.AddParameter("@iAm ", System.Data.SqlDbType.NVarChar, p1.pKId); s1.AddParameter("@pKId", System.Data.SqlDbType.NVarChar, p2.pKId); s1.Execute(); } }