Пример #1
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;
            }
        }
Пример #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            bool   Result = false;
            int    ID     = Convert.ToInt32(Session["ID"]);
            string Path   = "C:/Users/Dua'a-Orcas/Desktop/WebApplication1/WebApplication1/WebApplication1/PageStudents/Test/";
            string Data   = labDate.Text.ToString() + txtYear.Text.ToString();

            if (fuSignatureStudent.HasFile)
            {
                string Private = fuSignatureStudent.FileName.ToString();
                Path = Path + Private;
                fuSignatureStudent.SaveAs(Server.MapPath("Test") + "/" + fuSignatureStudent.FileName);
                //  Path = "/Test/" + fuSignatureStudent.FileName;
                SignatureStudents newSig     = new SignatureStudents();
                string            strencrypt = newSig.encrypet(Data, Path, ID);
                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();
                if (obj.AddDelaySemester(ID, year, semester, Reason, Datenow, "", 0, "", "", 0, "", 6) == 1)
                {
                    txtStatus.Text = "";
                }
                errorLabel.Visible = false;
            }
            else
            {
                errorLabel.Text    = "التوقيع المدخل خاطئ";
                errorLabel.Visible = true;
            }
        }
Пример #3
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;
            }
        }
Пример #4
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            bool   Result = false;
            int    ID     = Convert.ToInt32(Session["ID"]);
            string Path   = "C:/Users/Dua'a-Orcas/Desktop/WebApplication1/WebApplication1/WebApplication1/PageStudents/Test/";
            string Data   = DateTime.Today.ToString() + txtNumHours.Text.ToString();

            if (fuSignature.HasFile)
            {
                string Private = fuSignature.FileName.ToString();
                Path = Path + Private;
                fuSignature.SaveAs(Server.MapPath("Test") + "/" + fuSignature.FileName);
                //  Path = "/Test/" + fuSignatureStudent.FileName;
                SignatureStudents newSig     = new SignatureStudents();
                string            strencrypt = newSig.encrypet(Data, Path, ID);
                Result = newSig.Decreypt(strencrypt, ID);
            }
            if (Result == true)
            {
                string       date1  = DateTime.Today.ToString();
                string       Reason = txtReasons.Text.ToString();
                DropSemester objsem = new DropSemester();

                if (objsem.AddDropSemester(ID, Reason, date1, "", 0, "", 0, "", 0, "", 0, "", 2) == 1)
                {
                    txtReasons.Text  = "";
                    txtNumHours.Text = "";
                }
                errorLabel.Visible = false;
            }
            else
            {
                errorLabel.Text    = "التوقيع المدخل خاطئ";
                errorLabel.Visible = true;
            }
        }
Пример #5
0
        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;
            }
        }
Пример #6
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;
            }
        }
Пример #7
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Result = false;


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

            string Path = "C:/Users/Dua'a-Orcas/Desktop/WebApplication1/WebApplication1/WebApplication1/PageStudents/Test/";
            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 = Path + Private;
                fuSignatureStudent.SaveAs(Server.MapPath("Test") + "/" + fuSignatureStudent.FileName);
                //  Path = "/Test/" + fuSignatureStudent.FileName;
                SignatureStudents newSig     = new SignatureStudents();
                string            strencrypt = newSig.encrypet(Data, Path, ID);
                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);
                }

                AbsenceExam obj11 = new AbsenceExam();



                if (obj11.AddAbsenceExam(ID, CourseNum1, ExamCourse1Date, CourseNum2, ExamCourse2Date, CourseNum3, ExamCourse3Date, CourseNum4, ExamCourse4Date, 0, "", Reason, strReasonFile, strReasonFile2, 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         = "";
                }
                errorLabel.Visible = false;
            }



            else
            {
                errorLabel.Text    = "التوقيع المدخل خاطئ";
                errorLabel.Visible = true;
            }
        }
Пример #8
0
        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 = "C:/Users/Dua'a-Orcas/Desktop/WebApplication1/WebApplication1/WebApplication1/PageStudents/Test/";
            string Data = txtNumberCourse1.Text.ToString() + txtAlternativeNum1C1.Text.ToString() + txtReason.Text.ToString() +
                          labHoursCourse1.Text.ToString() + labHoursAlternative.Text.ToString();

            if (fuSignature.HasFile)
            {
                string Private = fuSignature.FileName.ToString();
                Path = Path + Private;
                fuSignature.SaveAs(Server.MapPath("Test") + "/" + fuSignature.FileName);
                //  Path = "/Test/" + fuSignatureStudent.FileName;
                SignatureStudents newSig     = new SignatureStudents();
                string            strencrypt = newSig.encrypet(Data, Path, ID);
                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();
                if (obj.AddAlternativeSubject(ID, 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 = "";
                }
                errorLabel.Visible = false;
            }
            else
            {
                errorLabel.Text    = "التوقيع المدخل خاطئ";
                errorLabel.Visible = true;
            }
        }
Пример #9
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            bool   Result = false;
            int    ID     = Convert.ToInt32(Session["ID"]);
            string Path   = "C:/Users/Dua'a-Orcas/Desktop/WebApplication1/WebApplication1/WebApplication1/PageStudents/Test/";
            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 = Path + Private;
                fuSignatureStudent.SaveAs(Server.MapPath("Test") + "/" + fuSignatureStudent.FileName);
                //  Path = "/Test/" + fuSignatureStudent.FileName;
                SignatureStudents newSig     = new SignatureStudents();
                string            strencrypt = newSig.encrypet(Data, Path, ID);
                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       = DateTime.Today.ToString();

                PullCourseClass obj = new PullCourseClass();
                if (obj.AddPullCourse(ID, 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          = "";
                }
                errorLabel.Visible = false;
            }
            else
            {
                errorLabel.Text    = "التوقيع المدخل خاطئ";
                errorLabel.Visible = true;
            }
        }
Пример #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;
            }
        }