protected void ClassAndSection(object sender, EventArgs e)
 {
     DBHandler.DBHandler db = new DBHandler.DBHandler(con);
     Entities.CampusClassSection t1 = new Entities.CampusClassSection()
     {
         className = ClassDropDown.SelectedValue,
         sectionName = SectionDropDown.SelectedValue,
     };
     Entities.personalInfo p1 = new Entities.personalInfo()
     {
         pKId = Session["School"].ToString(),
     };
     db.InsertCampusClassSection(t1, p1);
     ClassSectionLabel.Text = "Added Successfully";
     GridView1.DataBind();
     UpdatePanel1.Update();
     Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('ClassAndSection')", true);
 }
        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 AddTeacher(object sender, EventArgs e)
 {
     Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('TeacherSection')", 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.personalInfo t1 = new Entities.personalInfo()
         {
             pKId = TID.Value,
             passCode = TPassword.Value,
             firstName = TFirstName.Value,
             middleName = TMiddleName.Value,
             lastName = TLastName.Value,
             iAm = Session["School"].ToString(),
             phone = TPhoneNo.Value,
             emergencyContact = TEmergency.Value,
             cellNo = TMobNo.Value,
             eMail = TEmail.Value,
             enrollmentDate = TEnrollmentDate.Text,
             dOB = TDateOfBirth.Text,
             gender = Convert.ToInt32(TGender.SelectedIndex.ToString()),
             userType = TTypeOfUser.SelectedValue,
             isNew = IsNew.Checked,
             isActive = TIsActive.Checked,
             address1 = TAddress1.Value,
             address2 = TAddress2.Value,
             address3 = TAddress3.Value,
             fileName = Path.GetFileName(FileUpload1.PostedFile.FileName),
             recordFile = size,
         };
         db.insertTest(t1);
         UpdateTeacher();
         SqlDataSource7.DataBind();
         GridView3.DataBind();
     }
 }
        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 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 AssignStudent(object sender, EventArgs e)
 {
     Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('AssignStudentClass')", true);
     if (Page.IsValid)
     {
         DBHandler.DBHandler db = new DBHandler.DBHandler(con);
         Entities.personalInfo t1 = new Entities.personalInfo()
         {
             pKId = Session["School"].ToString(),
         };
         Entities.StudentSubject t2 = new Entities.StudentSubject()
         {
             pKId = SchoolID.Value,
             year=Year.Text,
         };
         Entities.Class c1 = new Entities.Class()
         {
             className = DropDownList1.SelectedValue,
         };
         Entities.Section s1 = new Entities.Section()
         {
             sectionName = DropDownList2.SelectedValue,
         };
         db.AssignStudentClass(t1, t2, c1, s1);
         SqlDataSource6.DataBind();
         GridView1.DataBind();
     }
 }
示例#7
0
 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();
     }
 }
示例#8
0
 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();
     }
 }