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 = " ";
            }
        }
        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);
            }
        }
        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 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);
            }
        }
예제 #5
0
 protected void AddClass(object sender, EventArgs e)
 {
     Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('AddClasses')", true);
     if (Page.IsValid)
     {
         DBHandler.DBHandler db = new DBHandler.DBHandler(con);
         Entities.Class      t1 = new Entities.Class()
         {
             classId   = ClassId.Value,
             className = ClassName.Value,
         };
         db.InsertClass(t1);
         SClasses.DataBind();
         GClasses.DataBind();
         UpdatePanel2.Update();
         AddClassSection1.UpdateClass();
         TecherSection1.UpdateClass();
         StudentSection1.UpdateClass();
         ExamDate1.UpdateClass();
         ClassLabel.Text = "Class Added Successfully";
     }
 }
예제 #6
0
        public void Quiz()
        {
            DBHandler.DBHandler db = new DBHandler.DBHandler(con);
            Entities.Notes      t1 = new Entities.Notes()
            {
                noteType = "Quiz",
            };

            Entities.personalInfo p1 = new Entities.personalInfo()
            {
                pKId = Session["School"].ToString(),
            };
            Entities.Class c1 = new Entities.Class()
            {
                className = "Class 5",
            };
            DataSet ds = new DataSet();

            ds = db.ShowSubNotes(t1, p1, c1);
            GridView3.DataSource = ds;
            GridView3.DataBind();
        }
예제 #7
0
        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);
        }