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 AddBranch(object sender, EventArgs e)
 {
     Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('foo')", true);
     if (Page.IsValid)
     {
         DBHandler.DBHandler db = new DBHandler.DBHandler(con);
         Entities.Campus c1 = new Entities.Campus()
         {
             campusName = CampusName.Value,
             address = address.Value,
             zipCode = Convert.ToInt32(ZipCode.Value.ToString()),
             phone1 = Phone1.Value,
             phone2 = Phone2.Value,
             phone3 = Phone3.Value,
             principal = PrincipalName.Value,
             email = CEmail.Value,
             isActive = CCheck.Checked,
         };
         Entities.ZipCodes z1 = new Entities.ZipCodes()
         {
             zipCode = Convert.ToInt32(ZipCode.Value.ToString()),
             cityName = CityName.Value,
         };
         db.InsertBranch(c1, z1);
         Clabel.Text = "Campus Added Successfully";
     }
 }
        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 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);
 }
        protected void GridView2_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "reply")
            {
                int rowindex = ((GridViewRow)((ImageButton)e.CommandSource).NamingContainer).RowIndex;
                int s = Convert.ToInt32(GridView2.DataKeys[rowindex].Value);
                DBHandler.DBHandler db = new DBHandler.DBHandler(con);
                Entities.Tickets cc1 = new Entities.Tickets()
                {
                    issueId = s,
                };

                 DataSet ds = new DataSet();
                ds = db.SelectTicket(cc1);

                if (ds != null
                && ds.Tables.Count > 0
                && ds.Tables[0].Rows.Count > 0)
                {
                    TextArea2.Value = ds.Tables[0].Rows[0]["issue"].ToString();

                    TextBox3.Text = ds.Tables[0].Rows[0]["generatedBy"].ToString();
                    TextBox4.Text = ds.Tables[0].Rows[0]["issueId"].ToString();
                    Page.ClientScript.RegisterStartupScript(GetType(), "id", "TicketReplyPop()", 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);
            }
        }
        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);
            }
        }
Ejemplo n.º 8
0
 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);
 }
        protected void UpdateAttendance(object sender, EventArgs e)
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('TAttendance')", true);
            if (Page.IsValid)
            {
                foreach (GridViewRow row in GridView1.Rows)
                {
                    if (row.RowType == DataControlRowType.DataRow)
                    {
                        CheckBox             Status           = row.FindControl("Status") as CheckBox;
                        bool                 attendanceStatus = Status.Checked ? true : false;
                        string               pKId             = (row.FindControl("pKId") as Label).Text.Trim();
                        string               sttendenceDate   = (this.Date.Text.Trim());
                        DBHandler.DBHandler  db = new DBHandler.DBHandler(con);
                        Entities.TAttendance t1 = new Entities.TAttendance()
                        {
                            pKId       = pKId,
                            date       = sttendenceDate,
                            attendance = attendanceStatus,
                        };
                        db.InsertTeacherAttendance(t1);

                        AttendanceLabel.Text = "Updated Successfully";
                    }
                }
            }
        }
        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);
            }
        }
Ejemplo n.º 12
0
        protected void GridView12_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "reply")
            {
                int rowindex            = ((GridViewRow)((ImageButton)e.CommandSource).NamingContainer).RowIndex;
                int s                   = Convert.ToInt32(GridView12.DataKeys[rowindex].Value);
                DBHandler.DBHandler db  = new DBHandler.DBHandler(con);
                Entities.Tickets    cc1 = new Entities.Tickets()
                {
                    issueId = s,
                };

                DataSet ds = new DataSet();
                ds = db.SelectTicket(cc1);

                if (ds != null &&
                    ds.Tables.Count > 0 &&
                    ds.Tables[0].Rows.Count > 0)
                {
                    TextArea2.Value = ds.Tables[0].Rows[0]["issue"].ToString();

                    TextBox3.Text = ds.Tables[0].Rows[0]["generatedBy"].ToString();
                    TextBox4.Text = ds.Tables[0].Rows[0]["issueId"].ToString();
                    Page.ClientScript.RegisterStartupScript(GetType(), "id", "sTicketReplyPop()", true);
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('PendingTickets')", true);
                }
            }
        }
        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 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);
 }
Ejemplo n.º 15
0
 protected void AddBranch(object sender, EventArgs e)
 {
     Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('foo')", true);
     if (Page.IsValid)
     {
         DBHandler.DBHandler db = new DBHandler.DBHandler(con);
         Entities.Campus     c1 = new Entities.Campus()
         {
             campusName = CampusName.Value,
             address    = address.Value,
             zipCode    = Convert.ToInt32(ZipCode.Value.ToString()),
             phone1     = Phone1.Value,
             phone2     = Phone2.Value,
             phone3     = Phone3.Value,
             principal  = PrincipalName.Value,
             email      = CEmail.Value,
             isActive   = CCheck.Checked,
         };
         Entities.ZipCodes z1 = new Entities.ZipCodes()
         {
             zipCode  = Convert.ToInt32(ZipCode.Value.ToString()),
             cityName = CityName.Value,
         };
         db.InsertBranch(c1, z1);
         Clabel.Text = "Campus Added Successfully";
     }
 }
 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();
     }
 }
Ejemplo n.º 17
0
 protected void AddExam(object sender, EventArgs e)
 {
     Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('ExamType')", true);
     if (Page.IsValid)
     {
         DBHandler.DBHandler db = new DBHandler.DBHandler(con);
         Entities.ExamType   e1 = new Entities.ExamType()
         {
             examTypeId = ExamID.Value,
             examType   = ExamName.Value,
         };
         db.AddExamypes(e1);
         GridView1.DataBind();
         UpdatePanel1.Update();
         ExamDate1.UpdateExam();
     }
 }
Ejemplo n.º 18
0
 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 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 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);
 }
Ejemplo n.º 21
0
        public long AddAccountDetails(ArrayList AddAccountAL, int _CompanyIndex)
        {
            Logger.InfoLog("ControlGenerator:: Inside AddAccountDetails");
            long ReturnDBVal = -1;

            try
            {
                PACT.DBHandler.DBHandler DBH = new DBHandler.DBHandler();
                string s = DBH.SetAccountDetails(_CompanyIndex, AddAccountAL, out ReturnDBVal);
                Logger.InfoLog("ControlGenerator:: Success: DBH.SetAccountDetails " + ReturnDBVal.ToString());
                return(ReturnDBVal);
            }
            catch (Exception ex)
            {
                Logger.ErrorLog("ControlGenerator:: AddAccount Details" + ex.StackTrace.ToString());
                return(ReturnDBVal);
            }
        }
        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 AddSurvey(object sender, EventArgs e)
 {
     Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('NewSurvey')", true);
     if (Page.IsValid)
     {
         DBHandler.DBHandler db = new DBHandler.DBHandler(con);
         Entities.Survey s1 = new Entities.Survey()
         {
             surveyName = ASurveyName.Value,
             surveyDate = DateTime.Now.ToShortDateString(),
             surveyGeneratedBy = Session["School"].ToString(),
             surveyGeneratedFor = DropDownList3.SelectedValue,
             type = Convert.ToInt32(RadioButtonList1.SelectedValue),
         };
         surveyid = db.InsertSurvey(s1);
         Panel1.Visible = true;
         Panel2.Visible = false;
     }
 }
Ejemplo n.º 24
0
 protected void TicketReply(object sender, EventArgs e)
 {
     Page.ClientScript.RegisterStartupScript(GetType(), "id", "sTicketReplyPop()", true);
     if (Page.IsValid)
     {
         DBHandler.DBHandler db = new DBHandler.DBHandler(con);
         Entities.Tickets    t1 = new Entities.Tickets()
         {
             generatedBy  = Session["School"].ToString(),
             generatedFor = TextBox3.Text,
             issueDate    = DateTime.Now.ToShortDateString(),
             issue        = TextBox2.Text,
             linkedWith   = Convert.ToInt32(TextBox4.Text),
             isNew        = false,
         };
         db.AddTicket(t1);
         Label7.Text = "Replied Successfully";
     }
 }
Ejemplo n.º 25
0
        public void Smiles()
        {
            DBHandler.DBHandler   db = new DBHandler.DBHandler(con);
            Entities.personalInfo p1 = new Entities.personalInfo()
            {
                pKId = Session["School"].ToString(),
            };

            DataSet ds = new DataSet();

            ds = db.CountSmiles(p1);
            if (ds != null &&
                ds.Tables.Count > 0 &&
                ds.Tables[0].Rows.Count > 0)
            {
                //  Label1.Text = ds.Tables[0].Rows[0]["Smilies"].ToString();
                // Label2.Text = ds.Tables[0].Rows[0]["Sad"].ToString();
            }
        }
 protected void ADDEvaluation(object sender, EventArgs e)
 {
     Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('Evaluation')", true);
     if (Page.IsValid)
     {
         DBHandler.DBHandler      db = new DBHandler.DBHandler(con);
         Entities.Recommendations r1 = new Entities.Recommendations()
         {
             studentId      = EDropDown.SelectedValue,
             teacher        = Session["School"].ToString(),
             Adate          = DateTime.Now.ToShortDateString(),
             appitude       = EAptitude.Value,
             attitude       = EAttitude.Value,
             recommendation = ERecommendation.Value,
         };
         db.AddEvaluation(r1);
         Label1.Text = "Student Evaluated Successfully";
     }
 }
Ejemplo n.º 27
0
 protected void AddSurvey(object sender, EventArgs e)
 {
     Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('NewSurvey')", true);
     if (Page.IsValid)
     {
         DBHandler.DBHandler db = new DBHandler.DBHandler(con);
         Entities.Survey     s1 = new Entities.Survey()
         {
             surveyName         = ASurveyName.Value,
             surveyDate         = DateTime.Now.ToShortDateString(),
             surveyGeneratedBy  = Session["School"].ToString(),
             surveyGeneratedFor = DropDownList3.SelectedValue,
             type = Convert.ToInt32(RadioButtonList1.SelectedValue),
         };
         surveyid       = db.InsertSurvey(s1);
         Panel1.Visible = true;
         Panel2.Visible = false;
     }
 }
Ejemplo n.º 28
0
        public long AddAccountDetails(ArrayList AddAccountAL, int _CompanyIndex)
        {
            Logger.InfoLog("ControlGenerator:: Inside AddAccountDetails");
            long ReturnDBVal = -1;

            try
            {
                PACT.DBHandler.DBHandler DBH = new DBHandler.DBHandler();
                string s = DBH.SetAccountDetails(_CompanyIndex, AddAccountAL, out ReturnDBVal);
                Logger.InfoLog("ControlGenerator:: Success: DBH.SetAccountDetails " + ReturnDBVal.ToString());
                return ReturnDBVal;

            }
            catch (Exception ex)
            {
                Logger.ErrorLog("ControlGenerator:: AddAccount Details" + ex.StackTrace.ToString());
                return ReturnDBVal;
            }
        }
Ejemplo n.º 29
0
        protected void GridView8_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "show")
            {
                int rowindex = ((GridViewRow)((ImageButton)e.CommandSource).NamingContainer).RowIndex;
                s = Convert.ToInt32(GridView8.DataKeys[rowindex].Value);
                GridViewRow             row   = (GridViewRow)(((ImageButton)e.CommandSource).NamingContainer);
                string                  check = (row.FindControl("type") as Label).Text.Trim();
                DBHandler.DBHandler     db    = new DBHandler.DBHandler(con);
                Entities.SurveyQuestion q1    = new Entities.SurveyQuestion()
                {
                    surveyId = s,
                };
                DataSet ds = new DataSet();
                ds = db.ShowSurvey(q1);
                if (ds != null &&
                    ds.Tables.Count > 0 &&
                    ds.Tables[0].Rows.Count > 0)
                {
                    if (check == "Yes/No")
                    {
                        GridView9.DataSource = ds;
                        GridView9.DataBind();
                        Page.ClientScript.RegisterStartupScript(GetType(), "id", "sShowSurveyPop()", true);
                        Panel4.Visible = true;
                        Panel3.Visible = false;
                    }
                    else if (check == "Rating")
                    {
                        GridView10.DataSource = ds;
                        GridView10.DataBind();
                        Page.ClientScript.RegisterStartupScript(GetType(), "id", "sShowSurveyPop()", true);
                        Panel4.Visible = false;
                        Panel3.Visible = true;
                    }
                }

                else
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('ShowSurvey')", true);
                }
            }
        }
        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();

            }
        }
Ejemplo n.º 31
0
 protected void AddSection(object sender, EventArgs e)
 {
     Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('AddSections')", true);
     if (Page.IsValid)
     {
         DBHandler.DBHandler db = new DBHandler.DBHandler(con);
         Entities.Section    t1 = new Entities.Section()
         {
             sectionName = SectionName.Value,
         };
         db.InsertSection(t1);
         SSections.DataBind();
         GSections.DataBind();
         UpdatePanel3.Update();
         AddClassSection1.UpdateSection();
         TecherSection1.UpdateSection();
         StudentSection1.UpdateSection();
         ExamDate1.UpdateSection();
         SectionLabel.Text = "Section Added Successfully";
     }
 }
Ejemplo n.º 32
0
        private DataSet GetScreenInfo(int _ScreenID, string _CompanyIndex)
        {
            Logger.InfoLog("ControlGenerator:: Inside GetScreenInfo");
            try
            {
                PACT.DBHandler.DBHandler DBH = new DBHandler.DBHandler();
                ArrayList AL = new ArrayList();
                AL.Add(1);
                AL.Add("Majeed");
                AL.Add(0);

                DataSet ds = DBH.GetAddAccountScreenDetails(1, AL);

                return(ds);
            }
            catch (Exception ex)
            {
                Logger.ErrorLog("ControlGenerator:: GetScreenInfo" + ex.StackTrace.ToString());
                return(null);
            }
        }
Ejemplo n.º 33
0
 protected void AddTicket(object sender, EventArgs e)
 {
     Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('NewTicket')", true);
     if (Page.IsValid)
     {
         DBHandler.DBHandler db = new DBHandler.DBHandler(con);
         Entities.Tickets    t1 = new Entities.Tickets()
         {
             generatedBy  = Session["School"].ToString(),
             generatedFor = IcreatedFor.Text,
             issueDate    = DateTime.Now.ToShortDateString(),
             issue        = TextBox1.Text,
         };
         db.AddTicket(t1);
         GridView11.DataBind();
         UpdatePanel1.Update();
         Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('NewTicket')", true);
         Label6.Text   = "Issue Added Successfully";
         TextBox1.Text = " ";
     }
 }
 protected void UpdateGrades(object sender, EventArgs e)
 {
     foreach (GridViewRow row in GridView1.Rows)
     {
         if (row.RowType == DataControlRowType.DataRow)
         {
             string Marks = (row.FindControl("Grade") 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.StudentSubject s1 = new Entities.StudentSubject()
             {
                 pKId = SchoolID,
                 grade = Marks,
                 subjectName=DropDownList7.SelectedValue,
             };
             db.InsertStudentGrade(s1);
         }
     }
     Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('UpdateGrade')", true);
 }
 protected void UpdateGrades(object sender, EventArgs e)
 {
     foreach (GridViewRow row in GridView1.Rows)
     {
         if (row.RowType == DataControlRowType.DataRow)
         {
             string Marks               = (row.FindControl("Grade") 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.StudentSubject s1 = new Entities.StudentSubject()
             {
                 pKId        = SchoolID,
                 grade       = Marks,
                 subjectName = DropDownList7.SelectedValue,
             };
             db.InsertStudentGrade(s1);
         }
     }
     Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('UpdateGrade')", true);
 }
 protected void AddTicket(object sender, EventArgs e)
 {
     Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('NewTicket')", true);
     if (Page.IsValid)
     {
         DBHandler.DBHandler db = new DBHandler.DBHandler(con);
         Entities.Tickets t1 = new Entities.Tickets()
         {
             generatedBy = Session["School"].ToString(),
             generatedFor = IcreatedFor.Text,
             issueDate = DateTime.Now.ToShortDateString(),
             issue = TextBox1.Text,
         };
         db.AddTicket(t1);
         GridView1.DataBind();
         UpdatePanel1.Update();
         Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('NewTicket')", true);
         Label2.Text = "Issue Added Successfully";
         TextBox1.Text = " ";
     }
 }
Ejemplo n.º 37
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();
        }
Ejemplo n.º 38
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);
        }
Ejemplo n.º 39
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";
     }
 }
Ejemplo n.º 40
0
        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 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 AddStudent(object sender, EventArgs e)
 {
     Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('StudentSection')", 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             = SID.Value,
             passCode         = SPassword.Value,
             firstName        = SFirstName.Value,
             middleName       = SMiddleName.Value,
             lastName         = SLastName.Value,
             phone            = SPhoneNo.Value,
             cellNo           = SMobNo.Value,
             emergencyContact = SEmergency.Value,
             iAm            = Session["School"].ToString(),
             eMail          = SEmail.Value,
             enrollmentDate = SEnrollmentDate.Text,
             dOB            = SDateOfBirth.Text,
             gender         = Convert.ToInt32(SGender.SelectedIndex.ToString()),
             userType       = STypeOfUser.SelectedValue,
             isActive       = SIsActive.Checked,
             isNew          = IsNew.Checked,
             address1       = SAddress1.Value,
             address2       = SAddress2.Value,
             address3       = SAddress3.Value,
             fileName       = Path.GetFileName(FileUpload1.PostedFile.FileName),
             recordFile     = size,
         };
         db.insertTest(t1);
         Label2.Text = "Added Successfully";
         SqlDataSource4.DataBind();
         GridView3.DataBind();
     }
 }
Ejemplo n.º 43
0
 protected void AdminAssign(object sender, EventArgs e)
 {
     Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('admin')", 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             = AID.Value,
             firstName        = AFirstName.Value,
             middleName       = AMiddleName.Value,
             lastName         = ALastName.Value,
             iAm              = Session["School"].ToString(),
             phone            = APhoneNo.Value,
             emergencyContact = AEmergency.Value,
             cellNo           = AMobNo.Value,
             eMail            = AEmail.Value,
             enrollmentDate   = AEnrollmentDate.Text,
             dOB              = ADateOfBirth.Text,
             gender           = Convert.ToInt32(DropDownList2.SelectedIndex.ToString()),
             userType         = DropDownList1.SelectedValue,
             isActive         = IsActive.Checked,
             isNew            = IsNew.Checked,
             passCode         = APassword.Value,
             address1         = AAdress1.Value,
             address2         = AAdress2.Value,
             address3         = AAdress3.Value,
             fileName         = Path.GetFileName(FileUpload1.PostedFile.FileName),
             recordFile       = size,
         };
         db.insertTest(t1);
         SqlDataSource4.DataBind();
         GridView3.DataBind();
     }
 }
        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";

            }
        }
        protected void SubmitSurvey(object sender, EventArgs e)
        {
            if (Panel3.Visible == true)
            {
                foreach (GridViewRow row in GridView3.Rows)
                {
                    if (row.RowType == DataControlRowType.DataRow)
                    {
                        int questionid = int.Parse((row.FindControl("Label1") as Label).Text);
                        DropDownList ddl = row.FindControl("DropDownList4") as DropDownList;
                        int answer = ddl.SelectedIndex;
                        DBHandler.DBHandler db = new DBHandler.DBHandler(con);
                        Entities.SurveyReply s1 = new Entities.SurveyReply()
                        {
                            surveyId = s,
                            questionId = questionid,
                            answer = answer,
                            repliedBy = Session["School"].ToString(),
                        };
                        db.SurveyReply(s1);
                    }
                }

                DBHandler.DBHandler db1 = new DBHandler.DBHandler(con);
                Entities.SurveyReply s2 = new Entities.SurveyReply()
                {
                    surveyId = s,
                    repliedBy = Session["School"].ToString(),
                };
                Entities.Survey s3 = new Entities.Survey()
                {
                    surveyDate = DateTime.Now.ToShortDateString(),
                };

                db1.InsertSurveyResponse(s2, s3);

                Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('ShowSurvey')", true);

            }

            else if (Panel4.Visible == true)
            {
                foreach (GridViewRow row in GridView1.Rows)
                {
                    if (row.RowType == DataControlRowType.DataRow)
                    {
                        int questionid = int.Parse((row.FindControl("Label1") as Label).Text);
                        CheckBox ddl = row.FindControl("CheckBox1") as CheckBox;
                        int answer = ddl.Checked ? 6 : 7;
                        DBHandler.DBHandler db = new DBHandler.DBHandler(con);
                        Entities.SurveyReply s1 = new Entities.SurveyReply()
                        {
                            surveyId = s,
                            questionId = questionid,
                            answer = answer,
                            repliedBy = Session["School"].ToString(),
                        };
                        db.SurveyReply(s1);
                    }
                }

                DBHandler.DBHandler db1 = new DBHandler.DBHandler(con);
                Entities.SurveyReply s2 = new Entities.SurveyReply()
                {
                    surveyId = s,
                    repliedBy = Session["School"].ToString(),
                };
                Entities.Survey s3 = new Entities.Survey()
                {
                    surveyDate = DateTime.Now.ToShortDateString(),
                };

                db1.InsertSurveyResponse(s2, s3);

                Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('ShowSurvey')", 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();
     }
 }
        protected void UpdateAttendance(object sender, EventArgs e)
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('TAttendance')", true);
            if (Page.IsValid)
            {
                foreach (GridViewRow row in GridView1.Rows)
                {
                    if (row.RowType == DataControlRowType.DataRow)
                    {
                        CheckBox Status = row.FindControl("Status") as CheckBox;
                        bool attendanceStatus = Status.Checked ? true : false;
                        string pKId = (row.FindControl("pKId") as Label).Text.Trim();
                        string sttendenceDate = (this.Date.Text.Trim());
                        DBHandler.DBHandler db = new DBHandler.DBHandler(con);
                        Entities.TAttendance t1 = new Entities.TAttendance()
                        {
                            pKId = pKId,
                            date = sttendenceDate,
                            attendance = attendanceStatus,
                        };
                        db.InsertTeacherAttendance(t1);

                        AttendanceLabel.Text = "Updated Successfully";

                    }
                }
            }
        }
        protected void GenerateSurvey(object sender, EventArgs e)
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('NewSurvey')", true);
            if (Page.IsValid)
            {

                for (int i = 1; i < 11; i++)
                {
                    if (i == 1 && AQuestion1.Value != "")
                    {
                        DBHandler.DBHandler db = new DBHandler.DBHandler(con);
                        Entities.SurveyQuestion s1 = new Entities.SurveyQuestion()
                        {
                            surveyId = surveyid,
                            questionId = i,
                            question = AQuestion1.Value,
                        };
                        db.GenerateSurvey(s1);
                    }
                    if (i == 2 && AQuestion2.Value != "")
                    {
                        DBHandler.DBHandler db = new DBHandler.DBHandler(con);
                        Entities.SurveyQuestion s1 = new Entities.SurveyQuestion()
                        {
                            surveyId = surveyid,
                            questionId = i,
                            question = AQuestion2.Value,
                        };
                        db.GenerateSurvey(s1);
                    }
                    if (i == 3 && AQuestion3.Value != "")
                    {
                        DBHandler.DBHandler db = new DBHandler.DBHandler(con);
                        Entities.SurveyQuestion s1 = new Entities.SurveyQuestion()
                        {
                            surveyId = surveyid,
                            questionId = i,
                            question = AQuestion3.Value,
                        };
                        db.GenerateSurvey(s1);
                    }
                    if (i == 4 && AQuestion4.Value != "")
                    {
                        DBHandler.DBHandler db = new DBHandler.DBHandler(con);
                        Entities.SurveyQuestion s1 = new Entities.SurveyQuestion()
                        {
                            surveyId = surveyid,
                            questionId = i,
                            question = AQuestion4.Value,
                        };
                        db.GenerateSurvey(s1);
                    }
                    if (i == 5 && AQuestion5.Value != "")
                    {
                        DBHandler.DBHandler db = new DBHandler.DBHandler(con);
                        Entities.SurveyQuestion s1 = new Entities.SurveyQuestion()
                        {
                            surveyId = surveyid,
                            questionId = i,
                            question = AQuestion5.Value,
                        };
                        db.GenerateSurvey(s1);
                    }
                    if (i == 6 && AQuestion6.Value != "")
                    {
                        DBHandler.DBHandler db = new DBHandler.DBHandler(con);
                        Entities.SurveyQuestion s1 = new Entities.SurveyQuestion()
                        {
                            surveyId = surveyid,
                            questionId = i,
                            question = AQuestion6.Value,
                        };
                        db.GenerateSurvey(s1);
                    }
                    if (i == 7 && AQuestion7.Value != "")
                    {
                        DBHandler.DBHandler db = new DBHandler.DBHandler(con);
                        Entities.SurveyQuestion s1 = new Entities.SurveyQuestion()
                        {
                            surveyId = surveyid,
                            questionId = i,
                            question = AQuestion7.Value,
                        };
                        db.GenerateSurvey(s1);
                    }
                    if (i == 8 && AQuestion8.Value != "")
                    {
                        DBHandler.DBHandler db = new DBHandler.DBHandler(con);
                        Entities.SurveyQuestion s1 = new Entities.SurveyQuestion()
                        {
                            surveyId = surveyid,
                            questionId = i,
                            question = AQuestion8.Value,
                        };
                        db.GenerateSurvey(s1);
                    }
                    if (i == 9 && AQuestion9.Value != "")
                    {
                        DBHandler.DBHandler db = new DBHandler.DBHandler(con);
                        Entities.SurveyQuestion s1 = new Entities.SurveyQuestion()
                        {
                            surveyId = surveyid,
                            questionId = i,
                            question = AQuestion9.Value,
                        };
                        db.GenerateSurvey(s1);
                    }
                    if (i == 10 && AQuestion10.Value != "")
                    {
                        DBHandler.DBHandler db = new DBHandler.DBHandler(con);
                        Entities.SurveyQuestion s1 = new Entities.SurveyQuestion()
                        {
                            surveyId = surveyid,
                            questionId = i,
                            question = AQuestion10.Value,
                        };
                        db.GenerateSurvey(s1);
                    }
                }
                Panel2.Visible = true;
                Panel1.Visible = false;

            }
        }
Ejemplo n.º 49
0
        private DataSet GetScreenInfo(int _ScreenID, string _CompanyIndex)
        {
            Logger.InfoLog("ControlGenerator:: Inside GetScreenInfo");
            try
            {
                PACT.DBHandler.DBHandler DBH = new DBHandler.DBHandler();
                ArrayList AL = new ArrayList();
                AL.Add(1);
                AL.Add("Majeed");
                AL.Add(0);

                DataSet ds = DBH.GetAddAccountScreenDetails(1, AL);

                return ds;
            }
            catch (Exception ex)
            {
                Logger.ErrorLog("ControlGenerator:: GetScreenInfo" + ex.StackTrace.ToString());
                return null;
            }
        }
        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 AddExam(object sender, EventArgs e)
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('ExamType')", true);
            if (Page.IsValid)
            {
                DBHandler.DBHandler db = new DBHandler.DBHandler(con);
                Entities.ExamType e1 = new Entities.ExamType()
                {
                    examTypeId = ExamID.Value,
                    examType = ExamName.Value,
                };
                db.AddExamypes(e1);
                GridView1.DataBind();
                UpdatePanel1.Update();
                ExamDate1.UpdateExam();

            }
        }
 protected void GridView2_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "show")
     {
         int rowindex = ((GridViewRow)((ImageButton)e.CommandSource).NamingContainer).RowIndex;
          s = Convert.ToInt32(GridView2.DataKeys[rowindex].Value);
         GridViewRow row = (GridViewRow)(((ImageButton)e.CommandSource).NamingContainer);
         string check = (row.FindControl("type") as Label).Text.Trim();
          DBHandler.DBHandler db = new DBHandler.DBHandler(con);
          Entities.SurveyQuestion q1 = new Entities.SurveyQuestion()
          {
              surveyId=s,
          };
          DataSet ds = new DataSet();
          ds = db.ShowSurvey(q1);
          if (ds != null
         && ds.Tables.Count > 0
         && ds.Tables[0].Rows.Count > 0)
          {
              if (check == "Yes/No")
              {
                  GridView1.DataSource = ds;
                  GridView1.DataBind();
                  Page.ClientScript.RegisterStartupScript(GetType(), "id", "ShowSurveyPop()", true);
                  Panel4.Visible = true;
                  Panel3.Visible = false;
              }
              else if (check == "Rating")
              {
                  GridView3.DataSource = ds;
                  GridView3.DataBind();
                  Page.ClientScript.RegisterStartupScript(GetType(), "id", "ShowSurveyPop()", true);
                  Panel4.Visible = false;
                  Panel3.Visible = true;
              }
          }
          else
          {
              Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('ShowSurvey')", true);
          }
     }
 }
        protected void AddSection(object sender, EventArgs e)
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('AddSections')", true);
            if (Page.IsValid)
            {

                DBHandler.DBHandler db = new DBHandler.DBHandler(con);
                Entities.Section t1 = new Entities.Section()
                {
                    sectionName = SectionName.Value,
                };
                db.InsertSection(t1);
                SSections.DataBind();
                GSections.DataBind();
                UpdatePanel3.Update();
                AddClassSection1.UpdateSection();
                TecherSection1.UpdateSection();
                StudentSection1.UpdateSection();
                ExamDate1.UpdateSection();
                SectionLabel.Text = "Section Added Successfully";

            }
        }
        protected void Loginc(object sender, EventArgs e)
        {
            user = username.Value;
             data = user.Split('@')[0];
             data2 = user.Split('@')[1];
             DBHandler.DBHandler db = new DBHandler.DBHandler(con);
             Entities.tblSchoolId t1 = new Entities.tblSchoolId()
             {
                 schoolId = data,
             };
             Entities.Campus c1 = new Entities.Campus()
             {
                 campusName = data2,
             };
             DataSet ds = new DataSet();
             ds = db.CheckUserType(t1,c1);
             if (ds != null
               && ds.Tables.Count > 0
               && ds.Tables[0].Rows.Count > 0)
             {

                 usertype = ds.Tables[0].Rows[0]["userType"].ToString();
                 passcode = ds.Tables[0].Rows[0]["passCode"].ToString();
                 session = ds.Tables[0].Rows[0]["pKId"].ToString();

             }
             else
             {
                 Label1.Text = "Invalid Username or Password";
             }

             if (usertype == "admin" || usertype=="Admin")
             {
                 if (password.Value == passcode)
                 {
                     Session["School"] = session;
                     Response.Redirect("Admin.aspx");
                 }
                 else
                 {
                     Label1.Text = "Invalid Username or Password";
                 }

             }
             else if (usertype == "teacher" || usertype=="Teacher")
             {
                 if (password.Value == passcode)
                 {
                     Session["School"] = session;
                     Response.Redirect("Teacher.aspx");
                 }
                 else
                 {
                     Label1.Text = "Invalid Username or Password";
                 }
             }

             else if (usertype == "student" || usertype == "Student")
             {
                 if (password.Value == passcode)
                 {
                     Session["School"] = session;
                     Response.Redirect("Students.aspx");
                 }
                 else
                 {
                     Label1.Text = "Invalid Username or Password";
                 }
             }
        }
 protected void TicketReply(object sender, EventArgs e)
 {
     Page.ClientScript.RegisterStartupScript(GetType(), "id", "TicketReplyPop()", true);
     if (Page.IsValid)
     {
         DBHandler.DBHandler db = new DBHandler.DBHandler(con);
         Entities.Tickets t1 = new Entities.Tickets()
         {
             generatedBy = Session["School"].ToString(),
             generatedFor = TextBox3.Text,
             issueDate = DateTime.Now.ToShortDateString(),
             issue = TextBox2.Text,
             linkedWith = Convert.ToInt32(TextBox4.Text),
             isNew = false,
         };
         db.AddTicket(t1);
         Label1.Text = "Replied Successfully";
     }
 }