Exemple #1
0
        private void fillddl()
        {
            int ID = Convert.ToInt32(Session["ID"].ToString());
            RegistredCourses  obj      = new RegistredCourses();
            NowTimeUniversity timee    = new NowTimeUniversity();
            DataRow           T        = timee.drSearchYearANdSemester();
            string            year     = T["NowYear"].ToString();
            string            Semester = T["NowSemester"].ToString();
            DataTable         tbl1     = obj.dtSearchRegisterSubject(ID, year, Semester);

            ddlCourse1.DataSource     = tbl1;
            ddlCourse1.DataTextField  = "SubjectName";
            ddlCourse1.DataValueField = "SubjectID";
            ddlCourse1.DataBind();

            ddlCourse2.DataSource     = tbl1;
            ddlCourse2.DataTextField  = "SubjectName";
            ddlCourse2.DataValueField = "SubjectID";
            ddlCourse2.DataBind();

            ddlCourse3.DataSource     = tbl1;
            ddlCourse3.DataTextField  = "SubjectName";
            ddlCourse3.DataValueField = "SubjectID";
            ddlCourse3.DataBind();

            ddlCourse4.DataSource     = tbl1;
            ddlCourse4.DataTextField  = "SubjectName";
            ddlCourse4.DataValueField = "SubjectID";
            ddlCourse4.DataBind();
            ddlCourse1.Items.Insert(0, new System.Web.UI.WebControls.ListItem("<اختر مادة>", "0"));
            ddlCourse2.Items.Insert(0, new System.Web.UI.WebControls.ListItem("<اختر مادة>", "0"));
            ddlCourse3.Items.Insert(0, new System.Web.UI.WebControls.ListItem("<اختر مادة>", "0"));
            ddlCourse4.Items.Insert(0, new System.Web.UI.WebControls.ListItem("<اختر مادة>", "0"));
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            bool   Result = false;
            int    ID     = Convert.ToInt32(Session["ID"]);
            string Path   = "";

            string Data = labDate.Text.ToString() + txtYear.Text.ToString();

            if (fuSignatureStudent.HasFile)
            {
                string Private = fuSignatureStudent.FileName.ToString();
                Path = System.Web.HttpContext.Current.Server.MapPath("Test") + "/" + fuSignatureStudent.FileName.ToString();
                fuSignatureStudent.SaveAs(Server.MapPath("Test") + "/" + fuSignatureStudent.FileName);
                SignatureStudents newSig  = new SignatureStudents();
                string            Pasword = txtPassSign.Text.ToString();

                string strencrypt = newSig.encrypet(Data, Path, Pasword);
                Result = newSig.Decreypt(strencrypt, ID);
            }

            if (Result == true)
            {
                string Reason   = "";
                string year     = "";
                string semester = "";
                if (txtStatus.Text != string.Empty)
                {
                    Reason = txtStatus.Text.ToString();
                }
                if (txtYear.Text != string.Empty)
                {
                    year = txtYear.Text.ToString();
                }
                if (ddlSemester.SelectedIndex != 0 && ddlSemester.SelectedIndex != -1)
                {
                    semester = ddlSemester.Text.ToString();
                }
                DelaySemesterClass obj         = new DelaySemesterClass();
                string             Datenow     = labDate.Text.ToString();
                NowTimeUniversity  timee       = new NowTimeUniversity();
                DataRow            T           = timee.drSearchYearANdSemester();
                string             nowsemester = T["NowSemester"].ToString();
                string             nowYear     = T["NowYear"].ToString();
                if (obj.AddDelaySemester(ID, nowYear, nowsemester, year, semester, Reason, Datenow, "", 0, "", "", 0, "", 6) == 1)
                {
                    txtStatus.Text            = "";
                    ddlSemester.SelectedIndex = 0;
                    txtYear.Text = "";
                    SentMail s = new SentMail();
                    s.sendemailReg();
                    Response.Redirect("HomeStudent.aspx");
                }
                errorLabel.Visible = false;
            }
            else
            {
                errorLabel.Text    = " التوقيع المدخل خاطئ أو كلمة المرور";
                errorLabel.Visible = true;
            }
        }
        public DataTable dtNotAcceptHeadAltSubApplication()
        {
            NowTimeUniversity timee      = new NowTimeUniversity();
            DataRow           T          = timee.drSearchYearANdSemester();
            string            semester   = T["NowSemester"].ToString();
            string            Year       = T["NowYear"].ToString();
            SqlConnection     Connection = new SqlConnection(Connectionstring);

            Connection.Open();
            DataTable      dt = new DataTable();
            SqlDataAdapter DA = new SqlDataAdapter("select  Students.UniversityID as UniversityID , Students.StudentName as StudentName,Section.Name as SectionName ,AlternativeSubject.Date as DateRequest ,AlternativeSubject.ID  as IDFORM from Students,Section,AlternativeSubject where Students.SectionID=Section.ID  and Students.ID=AlternativeSubject.StudentID and ((AlternativeSubject.DeanAccept <> 0 and AlternativeSubject.DeanAccept IS NOT null) and (AlternativeSubject.RegestrationAccept = 0 OR AlternativeSubject.RegestrationAccept IS null))and AlternativeSubject.Year=" + Year + " and AlternativeSubject.Semester=N" + "'" + semester + "'", Connection);

            DA.Fill(dt);
            Connection.Close();
            return(dt);
        }
        public DataTable dtViewStudents(int ID)
        {
            NowTimeUniversity timee    = new NowTimeUniversity();
            DataRow           T        = timee.drSearchYearANdSemester();
            string            semester = T["NowSemester"].ToString();
            string            Year     = T["NowYear"].ToString();

            SqlConnection Connection = new SqlConnection(Connectionstring);

            Connection.Open();
            DataTable      dt = new DataTable();
            SqlDataAdapter DA = new SqlDataAdapter("select * from AlternativeSubject where Year=" + Year + " and Semester=N" + "'" + semester + "'" + " and StudentID= " + ID, Connection);

            DA.Fill(dt);
            Connection.Close();
            return(dt);
        }
Exemple #5
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            bool   Result = false;
            int    ID     = Convert.ToInt32(Session["ID"]);
            string Path   = "";

            string Data = labDate.Text.ToString() + txtNumHours.Text.ToString();

            if (fuSignature.HasFile)
            {
                string Private = fuSignature.FileName.ToString();
                Path = System.Web.HttpContext.Current.Server.MapPath("Test") + "/" + Private;
                string Pasword = txtPassSign.Text.ToString();

                fuSignature.SaveAs(Server.MapPath("Test") + "/" + fuSignature.FileName);
                SignatureStudents newSig     = new SignatureStudents();
                string            strencrypt = newSig.encrypet(Data, Path, Pasword);
                Result = newSig.Decreypt(strencrypt, ID);
            }
            if (Result == true)
            {
                string            date1     = labDate.Text.ToString();
                string            Reason    = txtReasons.Text.ToString();
                DropSemester      objsem    = new DropSemester();
                int               NumOFHour = Convert.ToInt32(txtNumHours.Text.ToString());
                NowTimeUniversity timee     = new NowTimeUniversity();
                DataRow           T         = timee.drSearchYearANdSemester();
                string            semester  = T["NowSemester"].ToString();
                string            Year      = T["NowYear"].ToString();

                if (objsem.AddDropSemester(ID, Year, semester, Reason, NumOFHour, date1, "", 0, "", 0, "", 0, "", 0, 0, "", 2) == 1)
                {
                    txtReasons.Text = "";
                    SentMail s = new SentMail();
                    s.sendemailAcadimic(ID);
                    Response.Redirect("HomeStudent.aspx");
                }
                errorLabel.Visible = false;
            }
            else
            {
                errorLabel.Text    = " التوقيع المدخل خاطئ أو كلمة المرور";
                errorLabel.Visible = true;
            }
        }
Exemple #6
0
        private void fillddl()
        {
            int ID = Convert.ToInt32(Session["ID"].ToString());
            RegistredCourses  obj      = new RegistredCourses();
            NowTimeUniversity timee    = new NowTimeUniversity();
            DataRow           T        = timee.drSearchYearANdSemester();
            string            year     = T["NowYear"].ToString();
            string            Semester = T["NowSemester"].ToString();
            DataTable         tbl1     = obj.dtSearchRegisterSubject(ID, year, Semester);

            ddlNameCourse1.DataSource     = tbl1;
            ddlNameCourse1.DataTextField  = "SubjectName";
            ddlNameCourse1.DataValueField = "SubjectID";
            ddlNameCourse1.DataBind();

            ddlNameCourse2.DataSource     = tbl1;
            ddlNameCourse2.DataTextField  = "SubjectName";
            ddlNameCourse2.DataValueField = "SubjectID";
            ddlNameCourse2.DataBind();

            ddlNameCourse3.DataSource     = tbl1;
            ddlNameCourse3.DataTextField  = "SubjectName";
            ddlNameCourse3.DataValueField = "SubjectID";
            ddlNameCourse3.DataBind();

            ddlNameCourse1.Items.Insert(0, new ListItem("<اختر مادة>", "0"));
            ddlNameCourse2.Items.Insert(0, new ListItem("<اختر مادة>", "0"));
            ddlNameCourse3.Items.Insert(0, new ListItem("<اختر مادة>", "0"));


            int RegHours = 0;

            for (int i = 0; i < tbl1.Rows.Count; i++)
            {
                DataRow dr = tbl1.Rows[i];
                RegHours = RegHours + Convert.ToInt32(dr["Hours"].ToString());
            }

            txtNmberHours.Text = RegHours + "";
        }
Exemple #7
0
        private void fillddl()
        {
            int ID = Convert.ToInt32(Session["ID"].ToString());
            RegistredCourses  obj      = new RegistredCourses();
            NowTimeUniversity timee    = new NowTimeUniversity();
            DataRow           T        = timee.drSearchYearANdSemester();
            string            year     = T["NowYear"].ToString();
            string            Semester = T["NowSemester"].ToString();
            DataTable         tbl1     = obj.dtSearchRegisterSubject(ID, year, Semester);

            gvCourses.DataSource = tbl1;
            gvCourses.DataBind();
            int RegHours = 0;

            for (int i = 0; i < tbl1.Rows.Count; i++)
            {
                DataRow dr = tbl1.Rows[i];
                RegHours = RegHours + Convert.ToInt32(dr["Hours"].ToString());
            }

            txtNumHours.Text = RegHours + "";
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            bool Result = false;
            //Define Avariable
            int    CourseNum1            = 0;
            int    AlternativeCourseNum1 = 0;
            string TypeCouseNum1         = "";
            string Reason = "";

            int    ID   = Convert.ToInt32(Session["ID"].ToString());
            string Path = "";

            string Data = txtNumberCourse1.Text.ToString() + txtAlternativeNum1C1.Text.ToString() +
                          labHoursCourse1.Text.ToString() + labHoursAlternative.Text.ToString();

            if (fuSignature.HasFile)
            {
                string Private = fuSignature.FileName.ToString();
                Path = System.Web.HttpContext.Current.Server.MapPath("Test") + "/" + Private;
                string Pasword = txtPassSign.Text.ToString();
                fuSignature.SaveAs(Server.MapPath("Test") + "/" + fuSignature.FileName);
                //  Path = "/Test/" + fuSignatureStudent.FileName;
                SignatureStudents newSig     = new SignatureStudents();
                string            strencrypt = newSig.encrypet(Data, Path, Pasword);
                Result = newSig.Decreypt(strencrypt, ID);
            }

            if (Result == true)
            {
                //Check input Data
                if (txtNumberCourse1.Text != String.Empty)
                {
                    CourseNum1 = Convert.ToInt32(txtNumberCourse1.Text.ToString());
                }

                if (txtAlternativeNum1C1.Text != String.Empty)
                {
                    AlternativeCourseNum1 = Convert.ToInt32(txtAlternativeNum1C1.Text.ToString());
                }
                if (labTypeCourse1.Text != String.Empty)
                {
                    TypeCouseNum1 = labTypeCourse1.Text.ToString();
                }

                if (txtReason.Text != String.Empty)
                {
                    Reason = txtReason.Text.ToString();
                }
                AlternativeSub    obj      = new AlternativeSub();
                NowTimeUniversity timee    = new NowTimeUniversity();
                DataRow           T        = timee.drSearchYearANdSemester();
                string            semester = T["NowSemester"].ToString();
                string            Year     = T["NowYear"].ToString();
                string            Date1    = labDate.Text.ToString();
                if (obj.AddAlternativeSubject(ID, Date1, Year, semester, CourseNum1, TypeCouseNum1, AlternativeCourseNum1, Reason, 0, 0, 0, 0, 3) == 1)
                {
                    ddlCourse1.SelectedIndex            = -1;
                    ddlAlternativeCourse1.SelectedIndex = -1;
                    txtReason.Text = "";
                    ddlAlternativeCourse1.SelectedIndex = -1;
                    txtAlternativeNum1C1.Text           = "";
                    txtNumberCourse1.Text    = "";
                    labTypeCourse1.Text      = "";
                    labHoursCourse1.Text     = "";
                    labHoursAlternative.Text = "";
                    SentMail s = new SentMail();
                    s.sendemailAcadimic(ID);
                    Response.Redirect("HomeStudent.aspx");
                }
                errorLabel.Visible = false;
            }
            else
            {
                errorLabel.Text    = "التوقيع المدخل خاطئ أو كلمة المرور";
                errorLabel.Visible = true;
            }
        }
Exemple #9
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Result = false;


            int    ID   = Convert.ToInt32(Session["ID"].ToString());
            string Path = "";
            string Data = labNumberStudent.Text.ToString() + txtCourseNum1.Text.ToString() + txtCourseNum2.Text.ToString() +
                          txtCourseNum3.Text.ToString() + txtCourseNum4.Text.ToString() + txtDateCourse1.Text.ToString() + txtDateCourse2.Text.ToString() + txtDateCourse3.Text.ToString()
                          + txtDateCourse4.Text.ToString();

            if (fuSignatureStudent.HasFile)
            {
                string Private = fuSignatureStudent.FileName.ToString();
                Path = System.Web.HttpContext.Current.Server.MapPath("Test") + "/" + Private;
                string Pasword = txtPassSign.Text.ToString();
                fuSignatureStudent.SaveAs(Server.MapPath("Test") + "/" + fuSignatureStudent.FileName);
                SignatureStudents newSig     = new SignatureStudents();
                string            strencrypt = newSig.encrypet(Data, Path, Pasword);
                Result = newSig.Decreypt(strencrypt, ID);
            }

            if (Result == true)
            {
                int CourseNum1 = 0;
                int CourseNum2 = 0;
                int CourseNum3 = 0;
                int CourseNum4 = 0;

                if (txtCourseNum1.Text != string.Empty)
                {
                    CourseNum1 = Convert.ToInt32(txtCourseNum1.Text.ToString());
                }

                if (txtCourseNum2.Text != string.Empty)
                {
                    CourseNum2 = Convert.ToInt32(txtCourseNum2.Text.ToString());
                }

                if (txtCourseNum3.Text != string.Empty)
                {
                    CourseNum3 = Convert.ToInt32(txtCourseNum3.Text.ToString());
                }

                if (txtCourseNum4.Text != string.Empty)
                {
                    CourseNum4 = Convert.ToInt32(txtCourseNum4.Text.ToString());
                }

                string ExamCourse1Date = txtDateCourse1.Text.ToString();

                string ExamCourse2Date = txtDateCourse2.Text.ToString();
                string ExamCourse3Date = txtDateCourse3.Text.ToString();
                string ExamCourse4Date = txtDateCourse4.Text.ToString();

                string Reason = txtReason.Text.ToString();

                string strReasonFile  = "";
                string strReasonFile2 = "";
                if (fuDetiels1.HasFile)
                {
                    strReasonFile = fuDetiels1.FileName.ToString();
                    fuDetiels1.SaveAs(Server.MapPath("../UploadFiles") + "/" + fuDetiels1.FileName);
                }

                if (fuDetiels2.HasFile)
                {
                    strReasonFile2 = fuDetiels2.FileName.ToString();

                    fuDetiels2.SaveAs(Server.MapPath("../UploadFiles") + "/" + fuDetiels2.FileName);
                }
                string      date  = labDate.Text.ToString();
                AbsenceExam obj11 = new AbsenceExam();

                NowTimeUniversity timee    = new NowTimeUniversity();
                DataRow           T        = timee.drSearchYearANdSemester();
                string            semester = T["NowSemester"].ToString();
                string            Year     = T["NowYear"].ToString();

                if (obj11.AddAbsenceExam(ID, date, Year, semester, CourseNum1, ExamCourse1Date, CourseNum2, ExamCourse2Date, CourseNum3, ExamCourse3Date, CourseNum4, ExamCourse4Date, Reason, strReasonFile, strReasonFile2, 0, "", 1) == 1)
                {
                    txtReason.Text           = "";
                    txtCourseNum1.Text       = "";
                    ddlCourse1.SelectedIndex = -1;
                    ddlCourse2.SelectedIndex = -1;
                    ddlCourse3.SelectedIndex = -1;
                    ddlCourse4.SelectedIndex = -1;
                    labTeacher1.Text         = "";
                    labTeacher2.Text         = "";
                    labTeacher3.Text         = "";
                    labTeacher4.Text         = "";

                    SentMail s = new SentMail();
                    s.sendemailDean(ID);
                    Response.Redirect("HomeStudent.aspx");
                }
                errorLabel.Visible = false;
            }



            else
            {
                errorLabel.Text    = "التوقيع المدخل خاطئ أو كلمة المرور";
                errorLabel.Visible = true;
            }
        }
Exemple #10
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            bool   Result = false;
            int    ID     = Convert.ToInt32(Session["ID"]);
            string Path   = "";

            string Data = txtNumCourse1.Text.ToString() + txtNumCourse2.Text.ToString() + txtNumCourse3.Text.ToString() +
                          txtNmberHours.Text.ToString() + txtNumHourAfter.Text.ToString() + DateTime.Today.ToString();

            if (fuSignatureStudent.HasFile)
            {
                string Private = fuSignatureStudent.FileName.ToString();
                Path = System.Web.HttpContext.Current.Server.MapPath("Test") + "/" + Private;
                string Pasword = txtPassSign.Text.ToString();
                fuSignatureStudent.SaveAs(Server.MapPath("Test") + "/" + fuSignatureStudent.FileName);
                SignatureStudents newSig     = new SignatureStudents();
                string            strencrypt = newSig.encrypet(Data, Path, Pasword);
                Result = newSig.Decreypt(strencrypt, ID);
            }
            if (Result == true)
            {
                string Reson = "";
                int    NumHoursResginter;
                int    NumpullHours;
                int    CourseNum1 = 0;
                int    CourseNum2 = 0;
                int    CourseNum3 = 0;


                if (txtNumCourse1.Text != string.Empty)
                {
                    CourseNum1 = Convert.ToInt32(txtNumCourse1.Text.ToString());
                }

                if (txtNumCourse2.Text != string.Empty)
                {
                    CourseNum2 = Convert.ToInt32(txtNumCourse2.Text.ToString());
                }

                if (txtNumCourse3.Text != string.Empty)
                {
                    CourseNum3 = Convert.ToInt32(txtNumCourse3.Text.ToString());
                }
                if (txtNmberHours.Text != string.Empty)
                {
                    NumHoursResginter = Convert.ToInt32(txtNmberHours.Text.ToString());
                }
                if (txtNumHourAfter.Text != string.Empty)
                {
                    NumpullHours = Convert.ToInt32(txtNumHourAfter.Text.ToString());
                }
                if (txtReason.Text != string.Empty)
                {
                    Reson = txtReason.Text.ToString();
                }

                string            Course1time   = txtTimeCourse1.Text.ToString();
                string            Course2time   = txtTimeCourse2.Text.ToString();
                string            Course3time   = txtTimeCourse3.Text.ToString();
                int               NumHourREG    = Convert.ToInt32(txtNmberHours.Text.ToString());
                int               NumHourAFpull = Convert.ToInt32(txtNumHourAfter.Text.ToString());
                string            DateNow       = labDate.Text.ToString();
                NowTimeUniversity timee         = new NowTimeUniversity();
                DataRow           T             = timee.drSearchYearANdSemester();
                string            semester      = T["NowSemester"].ToString();
                string            Year          = T["NowYear"].ToString();
                PullCourseClass   obj           = new PullCourseClass();
                if (NumHourAFpull >= 9)
                {
                    if (obj.AddPullCourse(ID, Year, semester, CourseNum1, CourseNum2, CourseNum3, DateNow, Reson, Course1time, Course2time, Course3time, NumHourREG, NumHourAFpull, "", "", 0, "", "", 0, 0, 5) == 1)
                    {
                        txtReason.Text               = "";
                        txtNumCourse1.Text           = "";
                        txtNumCourse2.Text           = "";
                        txtNumCourse3.Text           = "";
                        ddlNameCourse1.SelectedIndex = -1;
                        ddlNameCourse2.SelectedIndex = -1;
                        ddlNameCourse3.SelectedIndex = -1;
                        labTeacher1.Text             = "";
                        labTeacher2.Text             = "";
                        labTeacher3.Text             = "";
                        txtNmberHours.Text           = "";
                        txtNumHourAfter.Text         = "";
                        txtTimeCourse1.Text          = "";
                        txtTimeCourse2.Text          = "";
                        txtTimeCourse3.Text          = "";
                        labError.Visible             = false;
                        error.Style.Add("display", "none");
                        SentMail s = new SentMail();
                        s.sendemailHead(ID);
                        Response.Redirect("HomeStudent.aspx");
                    }
                }
                else
                {
                    labError.Visible = true;
                    error.Style.Add("display", "block");
                }
                errorLabel.Visible = false;
            }
            else
            {
                errorLabel.Text    = " التوقيع المدخل خاطئ أو كلمة المرور";
                errorLabel.Visible = true;
            }
        }